[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Palette problems using xlib

	I'm trying to make a general purpose image viewer.
	The problem is that I get rgb triplets for each pixel in the image
and the only way I know to find the pixel that corresponds to the triplet
is by using XAllocColor which is so slow that 90 % of the execution time
is spent there. It makes the whole thing really slow. I have to use xlib
and not any toolkit (except maybe the toolkit intrinsics). 
	I'd like to know if anyone out there knows how xloadimage does
this. It draws images quite fast (atleast fast enough for me :-)
	Pre-allocating a 64kB ^ 3 array of unsigned long ints is
prohibitively expensive. 
	It would suffice if someone could send me the source of some
primitive X utility like xloadimage.

Thanx in advance

Trifles make perfection, and perfection is no trifle.
		-- Michelangelo