Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - IMG_W and IMG_H in img_t: (1 Item)
   
IMG_W and IMG_H in img_t  
I am loading a 640X480 rgb png as follow:

img_t                   image1;
rc = img_load_file(ilib, "/tmp/black.png", NULL, &image1);

I am trying to walk through every pixel in this image and do per pixel calculation.  However, the loop below causes my 
system to crash!
for (i = 0; i <( image1.h * image1.w);  i++)
 // walk through the image using a pointer

After debugging this, it seems if I use image size to be 640*361 everything works fine.  So, why is it that imag1.access
.direct.data is pointing to a memory size that is (640*361) where the image size is 640X480?  My image is a ARGB, so it 
I should have 4 bytes/pixel.

According to the documentation in img_t, the img_w and ima_h fields are the number of pixels.

Can someone help me understand the discrepancy that I am seeing?

Thanks,

R.S.