RETRO commands


PROGRAM NAME

vconvert - Convert Data Storage Type (K1)

DESCRIPTION

vconvert performs data storage type conversions from any VIFF type to any other, with the exception of the transform types. Scaling or (mutually exclusive) normalization can be performed if requested. The scaling and normalization options are important for controlling the loss of precision when converting from a higher data type to a lower data type.

Output data storage type BYTE is a special case. If scaling is requested, then the input image is scaled, and then clipped to the range [0..255] before output. If normalization is requested, the data is offset adjusted and scaled to map onto the range [0..255] before output.

Normalization for other output types simply scales the data so that the most positive data value is equal to the normalization target. No offset adjustment is performed. If the most positive value in the image is zero then a zero valued image of the desired data type will be produced.

When converting from type BIT to type BYTE, the output values will be 0 or 255 depending on whether the bit corresponding to the input pixel is 0 or 1. For conversions from BIT to any type other than BYTE, the output value receives either 0 or 1 depending on the input bit value. This was done so that an BYTE image would be displayable immediately after conversion from type BIT.

Use of the -b option is important when trying to normalize a multiband or vector image. If -b false is used, then the largest value of any vector component in the image is used to compute the normalization multiplier. If -b true is used, then a different normalization multiplier is used for each band, as dictated by the data in that band.

REQUIRED ARGUMENTS

-i
type: infile
desc: input image
-o
type: outfile
desc: resulting output image

OPTIONAL ARGUMENTS

-t
type: string toggle
desc: lets user choose output data type
default: int
allowed values:
-b
type: boolean
desc: if true, bands are processed independently
default: false

Mutually Exclusive Group; if desired, specify ONE of:

-n
type: float
desc: specifies normalization value
default: 255
bounds: value > 0.0
OR
-s
type: float
desc: specifies scale factor
default: 1
bounds: no range checking

EXAMPLES

vconvert -i image:moon -s 3.14 -t float -o blah.xv

multiplies "image:moon" by pi then outputs it as a VFF_TYP_FLOAT image.

SEE ALSO

kconvert, knormal

RESTRICTIONS

This routine was ported to the Retro toolbox only because other Retro operators needed the lvconvert library call. Use the new kconvert or knormal programs instead of this program!

There needs to be a way to specify the conversion from a COMPLEX type to a non-COMPLEX type to be either the real part or the magnitude (the current version does the real part only).

REFERENCES

COPYRIGHT

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