Pixbuff::get_pixels() image format.



Hi,

For more efficiency I wished to put raw image data to the Pixbuff directly.
I have raw image data in this format:

"RGBRGBRGB..." - stirng of unsigned char, the length of the string is
(image height)x(image width)x3I guess it's famous type of image storing.

I used memcpy function to put my image to the pixbuff. I got the pointer to
the raw image data of Pixbuff by using get_pizels() method of Pixbuff.
But after I have shown the Pixbuff I saw strange image. After some time
of exploring, I got the idea, that I should put image this way

   for (unsigned int i=0; i<mPicHeight; i++)
       memcpy(mPixBuff->get_pixels()+i*mPicWidth*3+i*4*3,
RawPic+i*mPicWidth*3, mPicWidth*3);

What is this strange amount of information (i*4*3)? What for it?

I tried to found the image format but I could not. As it said in the
documentation
for Gdk::PixBuff

"guint8* Gdk::Pixbuf::get_pixels ()const
Queries a pointer to the pixel data of a pixbuf.

Returns:A pointer to the pixbuf's pixel data. Please see <xref
linkend="image-data"/> for information about how the pixel data is
stored in memory. "

What this means <xref linkend="image-data"/>?
Please, answer who knows, or has any ideas. I need to know the format for sure.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]