Re: Still not understanding pixmaps vs RGBs
- From: Taura Milana <learfox furry ao net>
- To: GTK App Devel <gtk-app-devel-list gnome org>
- Subject: Re: Still not understanding pixmaps vs RGBs
- Date: Fri, 14 Dec 2001 14:59:01 -0800
On 2001.12.14 13:50 Lewin A.R.W. Edwards wrote:
Sorry, I'm probably missing something major, but I don't see what
pixmaps gain me and I'd be really appreciative of some more explanation.
Currently my application works like this:
* Render content into an RGB buffer (Still image decoding and some
special postprocessing). This buffer is the size of the source image,
not the screen size.
* Decimate or expand content, using my own hand-rolled code, into a
second RGB buffer that is screen-sized.
* Draw the RGB buffer into a darea that covers the whole screen (this
step is slow).
I don't think you would need RGB buffers *AND* GdkPixmaps togeather.
You can do all the drawing on client side to yer RGB buffer then send
it to the X server to a GdkWindow and yer all done.
For double buffering just create an extra buffer on your client
side and draw to it each time then send it to the X server's GdkWindow.
One of the reasons I wanted to move to pixmaps is that someone here
recently told me the pixmap functions support resizing. However, they
don't. gdk_draw_pixmap is a 1:1 copy (possibly with clipping). Are there
functions, maybe in XLib, that will do pixmap resizing (scaling) for me?
My decimation/expansion code is horribly inefficient, I think.
Unfortunatly no, I worked with Xlib for 5 years and there is no
such function. If you want to do resizing yer going to have to use
RDK RGB buffers soly and `blit' each pixel using your own zooming
code.
One of the other reasons I wanted to move to pixmaps is that they are
Move? You said resize?
the same memory layout as the screen, which is 16bpp - so I'd have 30%
less data to move around compared to the same sized RGB buffer. So I
wanted access to the internal structure of the pixmap, on the assumption
that it was internally a header (dimensions, depth, phase of the moon
information) followed by a flat display-format buffer.
Moving is easier, resizing is hard.
Is a pixmap something like a PICT on the Macintosh, i.e. more like a
metafile format than just a frame buffer? Or is it like a
device-dependent bitmap on Windows?
It's an abstract offscreen X server side graphical object that you
can draw on only by using Gdk or Xlib functions. It can never be
interacted with on the client side.
It's not a file format since its format may change depending on Visual,
Depth, X Server brand, etc...
--
Sincerely, ,"-_ \|/
-Capt. Taura M. , O=__ --X--
..__ ,_JNMNNEO=_ /|\
OMNOUMmnne. {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn. 'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe. "7OMMMMNNNNNWWEEEEOOOOOO" "'.
EEBNNMMMNWNWWEEIMMNe. __ 7EMMMNNNNNWWWEEEEEEEOO. " .
NNMMMMWWWMMMWEINMMMNn "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._ .
http://furry.ao.net/~learfox/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]