Chapter Contents

Previous

Next
Image Data Model: _copyColormap

Image Data Model: _copyColormap



Copies the contents of an image's color map into another color map


Syntax
Details
Example

Syntax

CALL SEND (object-id, '_copyColormap', cmap-id);

Argument Type Description
cmap-id
N the identifier of the color map


Details

Define the destination color map with the LOADCLASS and INSTANCE functions before the _copyColormap method is applied and delete the destination color map when finished. You can reattach the color map to an image with either the _mapColors or _dither method.


Example

This example creates an image data model, IMAGE_OBJ, and an image color map, CMAP_OBJ. The _read method reads the TIFF file, ENGINE.TIF, into IMAGE_OBJ, and _copyColormap applies the color map in CMAP_OBJ to IMAGE_OBJ. The _getColor method returns the red, green, and blue values in the color map. _term deletes the color map after it has been used.

image_class=loadclass('sashelp.fsp.imgdat');
image_obj=instance(image_class);
cmap_class=loadclass('sashelp.fsp.imgcmap');
cmap_obj=instance(cmap_class);
call send (image_obj, '_read',
          '/usr/images/engine.tif');
call send (image_obj, '_copyColormap',
           cmap_obj);
call send (cmap_obj, '_getColor', 0, red,
           green, blue);
_msg_ = 'Red is: ' || red;
_msg_ = 'Green is: ' || green;
_msg_ = 'Blue is: ' || blue;
call send (cmap_obj, '_term');


Chapter Contents

Previous

Next

Top of Page

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