A
Andreas
Hi!
I'm not very familiar to C, but I do know a little.
No I'm trying to read someone elses program, and this line (and
simular, less complex lines) realy confuses me. Can someone explain?
I'm not new to the concept of pointers, so I think that I have a fair
chance.
What is this line doing?!?:
srcptr=(MY_PIXEL*)(source->imageData+(top-j)*source->widthStep)+(left-i);
Some header:
#define MY_PIXEL unsigned char
//Only the intresting variabels.
typedef struct _IplImage {
char *imageData; ///< Pointer to aligned image
int widthStep; ///< The size of aligned line in
bytes
...
} IplImage;
int i,j
int left,top;
MY_PIXEL *srcptr;
IplImage *source; // standard Ipl.
best regards,
Andreas Lundgren
I'm not very familiar to C, but I do know a little.
No I'm trying to read someone elses program, and this line (and
simular, less complex lines) realy confuses me. Can someone explain?
I'm not new to the concept of pointers, so I think that I have a fair
chance.
What is this line doing?!?:
srcptr=(MY_PIXEL*)(source->imageData+(top-j)*source->widthStep)+(left-i);
Some header:
#define MY_PIXEL unsigned char
//Only the intresting variabels.
typedef struct _IplImage {
char *imageData; ///< Pointer to aligned image
int widthStep; ///< The size of aligned line in
bytes
...
} IplImage;
int i,j
int left,top;
MY_PIXEL *srcptr;
IplImage *source; // standard Ipl.
best regards,
Andreas Lundgren