Table of Contents

Name

MAGscrModeNumColors - returns number of colors in MAG image

Synopsis


#include <maglo.h>
int MAGscrModeNumColors(MagImage *mag);

Description

The MAGscrModeNumColors() function returns the number of colors in MAG file that mag is associated to.

A color is represented as palette index, and palette maps palette index to actual color. Actual color for a palette index is obtained through MAGpalette(3) function. The range for palette index is 0 to (the value returned by MAGscrModeNumColors() )-1.

Return Values

One of following values is returned:

  1. The image is in 8 colors. 16 palette mappings are available, but index 8 to 15 is unused.
  2. The image is in 16 colors. 16 palette mappings are available.
  3. The image is in 256 colors.

See Also

MAGscrModeCode(3) , MAGpalette(3) , libmaglo(7)


Table of Contents