Page 1 of 1


Posted: 2016-10-24T10:30:30-07:00
by murmel
hello again to the forum,

I'm trying to extract the ColorMapIndex of a PNG-/GIF-image for any seperate pixel. received help on my last question - it was possible to read the index for some special produced png-images - but it doesn't work in general.

asuming the "MagickGetImageColors(wand)" - which is the total number of colors in the color map - is small up to an certain level - the type IndexPacket is type of something unsigned integer or unsigned char.
but the documentation is unclear and talks about something of type array - I didn't found the reference to type IndexPacket by searching my system and googe-ling around.

how could I access a variable of type IndexPacket - to get the integer information the color of that pixel is between 0 and MagickGetImageColors(wand)] ?

thank you for help
murmel :)

Re: IndexPacket

Posted: 2016-10-24T12:50:58-07:00
by murmel
additional info:

Quantum is defined in: /usr/include/ImageMagick-6/magick/magick-type.h

Code: Select all

 58 typedef ssize_t SignedQuantum;
 60 typedef float Quantum;
 61 #define QuantumRange  255.0
 62 #define QuantumFormat  "%g"
 63 #else
 64 typedef unsigned char Quantum;
 65 #define QuantumRange  ((Quantum) 255)
 66 #define QuantumFormat  "%u"
 67 #endif
 69 #define MaxColormapSize  65536UL
 70 #define MaxMap  65535UL
IndexPacket is defined in: /usr/include/ImageMagick-6/magick/pixel.h

Code: Select all

129 typedef Quantum IndexPacket;
both versions of prototypes are documented:

Code: Select all

IndexPacket	PixelGetIndex (const PixelWand *wand)

Code: Select all

Quantum 	PixelGetIndex (const PixelWand *wand)
only valid for a certain type of "PixelWand" ?

IMHO imagemagick could process any kind of image and so the c-lang functions

maybe there is someone - who could explain.

murmel :)