[prev in list] [next in list] [prev in thread] [next in thread]
List: gtkmm
Subject: Re: pix buf and colormaps
From: Kees Kling <ckling () upcmail ! nl>
Date: 2012-06-28 13:52:15
Message-ID: 4FEC618F.9090307 () upcmail ! nl
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
-------- Original Message --------
Subject: Re: pix buf and colormaps
Date: Thu, 28 Jun 2012 15:14:27 +0200
From: Kees Kling <ckling@upcmail.nl>
To: Kjell Ahlstedt <kjell.ahlstedt@bredband.net>
On 06/27/2012 04:26 PM, Kjell Ahlstedt wrote:
> 2012-06-26 11:44, Kees Kling skrev:
>> Hi,
>>
>> I have created a pix_buf from 8 bits data with the function
>> create_from_data
>> <http://developer.gnome.org/gtkmm/stable/classGdk_1_1Pixbuf.html#a8a3b524f26acd2f9efc4abe9c294d341>
>> (const guint8* data, Colorspace
>> <http://developer.gnome.org/gtkmm/stable/group__gdkmmEnums.html#ga866d716154abb7f5be26bd36b3017d3f>
>> colorspace, bool has_alpha, int bits_per_sample, int width, int
>> height, int rowstride).
>>
>> It displays fine, but only in greyscale, so I must attach a
>> colortable, which maps a 8 bits value to an RGB color and preferable
>> to an RGBA color. What the best way to do this, I can't find much
>> documentation.
>>
>>
>> Regards
>>
>> Kees Kling
> The documentation of the C module gdk-pixbuf is located at
> http://developer.gnome.org/gdk-pixbuf/stable/.
> Perhaps you can find some information there, e.g. in "The GdkPixbuf
> Structure" section at
> http://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-The-GdkPixbuf-Structure.html.
>
> When I look at that documentation and a small part of the gdk-pixbuf
> source code, I get the impression that each pixel is represented by 3
> or 4 bytes, called either channels or samples: one byte each for red,
> green, blue, and an optional byte for an alpha channel. But if that's
> the whole truth, I don't understand why you get only greyscale pictures.
>
> Kjell
Hi Kjell,
my data is just one byte and I want to display it as a color image. So
for that I'm going to use a colortable with 255 entrys and in fact I
have to translate every byte value in 3 or 4 bytes found in the
colortable. It is nothing new, because I think bmp format does the same.
Off coarse it is possible to do just a one by one pixel translation, but
my data could be rather big, so there is a time and mem penalty. I
should like to know if there is a better way
Regards
Kees
[Attachment #5 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
-------- Original Message --------
<table class="moz-email-headers-table" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject: </th>
<td>Re: pix buf and colormaps</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
<td>Thu, 28 Jun 2012 15:14:27 +0200</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
<td>Kees Kling <a class="moz-txt-link-rfc2396E" \
href="mailto:ckling@upcmail.nl"><ckling@upcmail.nl></a></td> </tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">To: </th>
<td>Kjell Ahlstedt <a class="moz-txt-link-rfc2396E" \
href="mailto:kjell.ahlstedt@bredband.net"><kjell.ahlstedt@bredband.net></a></td>
</tr>
</tbody>
</table>
<br>
<br>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
On 06/27/2012 04:26 PM, Kjell Ahlstedt wrote:
<blockquote cite="mid:4FEB1811.6080408@bredband.net" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">2012-06-26 11:44, Kees Kling skrev:<br>
</div>
<blockquote cite="mid:4FE98492.50800@upcmail.nl" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hi,<br>
<br>
I have created a pix_buf from 8 bits data with the function<br>
<a moz-do-not-send="true"
href="http://developer.gnome.org/gtkmm/stable/classGdk_1_1Pixbuf.html#a8a3b524f26acd2f9efc4abe9c294d341"
class="el">create_from_data</a> (const guint8* data, <a
moz-do-not-send="true"
href="http://developer.gnome.org/gtkmm/stable/group__gdkmmEnums.html#ga866d716154abb7f5be26bd36b3017d3f"
class="el">Colorspace</a> colorspace, bool has_alpha, int
bits_per_sample, int width, int height, int rowstride).<br>
<br>
It displays fine, but only in greyscale, so I must attach a
colortable, which maps a 8 bits value to an RGB color and
preferable to an RGBA color. What the best way to do this, I
can't find much documentation.<br>
<br>
<br>
Regards<br>
<br>
Kees Kling<br>
</blockquote>
The documentation of the C module gdk-pixbuf is located at <a
moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://developer.gnome.org/gdk-pixbuf/stable/">http://developer.gnome.org/gdk-pixbuf/stable/</a>.<br>
Perhaps you can find some information there, e.g. in "The
GdkPixbuf Structure" section at<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-The-GdkPixbuf-Structure. \
html">http://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-The-GdkPixbuf-Structure.html</a>.<br>
<br>
When I look at that documentation and a small part of the
gdk-pixbuf source code, I get the impression that each pixel is
represented by 3 or 4 bytes, called either channels or samples:
one byte each for red, green, blue, and an optional byte for an
alpha channel. But if that's the whole truth, I don't understand
why you get only greyscale pictures.<br>
<br>
Kjell<br>
</blockquote>
Hi Kjell,<br>
<br>
my data is just one byte and I want to display it as a color image.
So for that I'm going to use a colortable with 255 entrys and in
fact I have to translate every byte value in 3 or 4 bytes found in
the colortable. It is nothing new, because I think bmp format does
the same. Off coarse it is possible to do just a one by one pixel
translation, but my data could be rather big, so there is a time
and mem penalty. I should like to know if there is a better way<br>
<br>
Regards <br>
<br>
Kees<br>
<br>
</body>
</html>
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic