DATAMANIP (kdatamanip) functions


LIBRARY ROUTINE

lkmsquish - compress map to one column by means of Average, RMS or MAX

LIBRARY CALL

int lkmsquish(kobject in_obj, int map_flag, int type, kobject out_obj)

INPUT

OUTPUT

RETURN VALUE

TRUE (1) on success, FALSE (0) otherwise

DESCRIPTION

lkmsquish compresses a map down to one column, effectively converting the map to a "greyscale" map. An example of this operation is encountered when trying to print a pseudocolor RGB image on a B/W laser printer: the RGB color information must be somehow converted to greyscale in order for the printer to know how to dither the image during printing.

lkmsquish is very happy to operate on simple 3-column maps, such as would be encountered when processing a color image in any of the standard coordinate systems (ntscRGB, etc). However, lkmsquish is not limited to 3 column maps - it will operate on maps with any number of cloumns.

The conversion from multiple columns to a single column is done by computing a grey level for each row of the map, one at a time. For type=1, the grey level for a row is the average of the columns in the row. For type=2, the grey level is the RMS value of the columns in the row. For type=3, the grey level is the maximum value found in the colums of the row. Clearly, these schemes are not optimal in any sense, but one of them will usually give an acceptable result.

Ordinarily (map_flag=0), the map is the only part of the input object that is modified. The value data is not touched; it still points to various rows in the map just as before the compression. If map_flag=1, the value data is pulled thru the map and the map segment itself is removed. If mask data is present, then this operation proceeds as described in the man page for kmapdata(1).

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

Restrictions on data or input as applicable

MODIFICATION

none

FILES

$DATAMANIP/objects/library/kdatamanip/src/lkmsquish.c

SEE ALSO

kdatamanip(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.