Magick++ API: Quantum

# Quantum Structure

The Quantum structure is used to represent pixels in ImageMagick. ImageMagick may be compiled to support 32 or 64 bit pixels. The size of Quantum is controlled by the value of the QuantumDepth define. The default is 64 bit pixels, which provide the best accuracy. If memory consumption must be minimized, or processing time must be minimized, then ImageMagick may be compiled with QuantumDepth=8. The following table shows the relationship between QuantumDepth, the type of Quantum, and the overall Quantum size.

Effect Of QuantumDepth Values

QuantumDepth | Quantum Type | Quantum Size
8 | unsigned char | 32 bits
16 | unsigned short | 64 bits

The members of the Quantum structure, and their interpretation, are shown in the following table:

Quantum Pixel Layout

Member | Type | Interpretation
RGBColorspace | RGBColorspace + matte | CMYKColorspace
red | Quantum | Red | Red | Cyan
green | Quantum | Green | Green | Magenta
blue | Quantum | Blue | Blue | Yellow
opacity | Quantum | Ignored | Opacity | Ignored