DATAMANIP commands


PROGRAM NAME

kblend - Output = (Input 1 * Constant) + (Input 2 (1 - Constant))

DESCRIPTION

The Blend operator (kblend) forms a blend of two objects by adding X*(object1)+(1-X)*(object2).

Instead of specifying a constant for the blending ratio, an object can be supplied for the blending values. The value segment of the ratio object is used to determine the proportion in which the two objects are blended. It must take on values between 0 and 1, otherwise an error is generated.

Data Type The data type of the output object's data is cast to the highest order data type of the input objects' data. Internally, the data is processed using one of the following: unsigned byte, long, unsigned long, double, or double complex. Data is not cast to a lower type for processing.

Map Data If any input object contains map data as well as value data, then the value data is mapped through the map before the operation is performed. The output object will contain value data with no associated map, and its data type is the highest of the input (map) data types.

Validity Mask If there is a validity mask associated with any of the input objects, the resulting output object will have a mask. The output object mask is the logical AND of the input object masks. If only one input object has a mask, then the other input object's mask is assumed to be "all valid" (mask value = 1). If a mask is resized for the operation, the mask padding value will be 1.

Input Objects of Different Sizes The input objects can be of different sizes. If the sizes are different, the size of the output object's data will be the maximum of the data sizes of the input objects. When resizing, the input data are padded with a constant value that is defined internally by the operation being performed. If the input objects have map data as well as value data, the maximum data size is determined after mapping.

The subobject position for each source object that has value or mask data is used to determine the minimum common subobject position between them. This minimum position, along with the individual subobject positions, is used when calculating the final destination object size. Size and offsets are calculated so that the subobject positions of the source objects are aligned. These changes are applied before the operation is performed.

The resulting subobject position attribute of the destination object will be be the minimum common subobject position described above.

The subobject position attribute of a data object defines the coordinates at which that subobject was located in its parent data object. This attribute may be automatically set by programs such as the Extract operator (DATAMANIP::kextract), or it can be explicitly set by using the Set Data Attributes operator (DATAMANIP::ksetdattr). The subobject position coordinates can be printed using the Print File Information operator (DATAMANIP::kfileinfo).

Explicit Location and Time Data This routine does not interpret location or time data. Rather, it operates on the implicit data space defined by the organization of the data. Therefore, if more than one input object is supplied, and location or time data exist, the first input object will be the dominant object, and all attributes will be transferred from the first object to the output object (regardless of whether the other inputs have location or time data). Padding or truncation of explicit location data may occur if the resulting output object size is different from the size of input 1.

If the first input object does not contain location or time data, but another input object does contain it, the location or time data will not be propagated.

Failure Modes - Two Input Objects This program can only operate on input objects if all have value data (either or both can have optional map data) or if all fIonlyfP have map data.

REQUIRED ARGUMENTS

-i1
type: infile
desc: first input data object
-i2
type: infile
desc: second input file object
-o
type: outfile
desc: resulting output data object

Mutually Exclusive Group; you must specify ONE of:

-ratio
type: double
desc: Ratio of blending the two objects
default: 0.5
bounds: 0 < [-ratio] < 1
OR
-iratio
type: infile
desc: Input object for providing blending ratios
default: {none}

OPTIONAL ARGUMENTS

none

EXAMPLES

SEE ALSO

RESTRICTIONS

The blend operator has not been updated to be fully polymorphic.

REFERENCES

COPYRIGHT

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