Chapter Contents

Previous

Next
GENERATE_CMAP

GENERATE_CMAP



Generates a color map for the selected image


Syntax
Details
Example

Syntax

rc=IMGOP(task-id, 'GENERATE_CMAP', COLORRAMP, reds, greens, blues);
rc=IMGOP(task-id, 'GENERATE_CMAP', GRAYRAMP, n);

reds
is the number of red colors to generate.

Type: Numeric

greens
is the number of green colors to generate.

Type: Numeric

blues
is the number of blue colors to generate.

Type: Numeric

n
is the number of gray colors to generate.

Type: Numeric


Details

GENERATE_CMAP generates two kinds of color maps:

COLORRAMP
is a color ramp of RGB colors that fill the RGB color spectrum, given the desired number of red, green, and blue shades to use. This command generates a color map of reds×greens×blues colors, with a maximum of 256 colors allowed. It is possible to generate a color map that consists only of reds, greens, or blues by specifying that only one shade be used for the other two colors.

GRAYRAMP
is a color map that consists only of grays. The number of shades of gray is limited to 256.

After the color map is generated, it can be applied to an image with either the DITHER command or the MAP_COLORS command.


Example

Use the GENERATE_CMAP command to generate a color ramp and a gray ramp, each containing 100 color map entries:

gray:
   rc=imgop(task-id,'GENERATE_CMAP','GRAYRAMP',100);
return;

color:
  rc=imgop(task-id,'GENERATE_CMAP','COLORRAMP',5,5,4);
return;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.