Re: Pixbuff::get_pixels() image format.
- From: Alexander Gehlert <alexander gehlert raritan com>
- To: Evgeny Repekto <repekto argosoft gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Pixbuff::get_pixels() image format.
- Date: Mon, 04 Sep 2006 14:46:04 +0200
Evgeny Repekto wrote:
hi,
you need to create the pixbuf with the option has_alpha=false for 24bit rgb
static Glib::RefPtr<Pixbuf <cid:part1.04040903.00010201@raritan.com>>
create <cid:part2.03050504.02000101@raritan.com> (Colorspace
<cid:part3.01000902.08030200@raritan.com> colorspace, bool has_alpha,
int bits_per_sample, int width, int height)
regards
Alex
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.
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
--
Alexander Gehlert - Intern
reply to : alexander gehlert raritan com
Raritan Zwickau
Software Development
Scheringerstrasse 1
08056 Zwickau
Germany
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]