NAME
box_filter -- create unit to box-filter a vector bitmap
PROTOTYPE
unitptr box_filter( int iNum, int iDx, int iDy, float *pfLimits, char *pcOpt, unitptr uHost)
ARGUMENTS
- int iNum
- nr of input channels (3 for RGB)
- int iDx
- - not documented in source --
- int iDy
- size of image rectangle
- float *pfLimits
- ptr to array of 2*iDim filter limits, order is Min1,Max1,Min2,Max2,...
- char *pcOpt
- option string [presently not used]
- unitptr uHost
- host unit
RETURN VALUE:
A pointer to the created unit or NULL in the case of an error.
INTERFACE OF CREATED UNIT:
- in_0[iDx*iDy]:
- (packed input field 0) first input channel
- ...
- ...
- in_iNum-1[iDx*iDy]:
- (packed input field iNum-1) last input channel
- in_0[2*iNum]:
- (input field iNum ) box limits
- CTL_in[1]:
- (control field) a value of 0 disables the operation of
this unit
If pcOptions==NULL
- out_0[iDx*iDy]:
- (packed output field 0) first output channel
- ...
- ...
- out_iNum-1[iDx*iDy]:
- (packed output field iNum-1 ) last output channel
- out_iNum[iDx*iDy]:
- (packed output field iNum) mask values (see below)
EXECUTION OF CREATED UNIT:
INITIALIZATION:
DESCRIPTION:
The iNum input channels are considered as a single image in a
iNum-dim feature space. The unit filters this image, using a
box volume in the iNum-dim feature space the limits of which
can be set at input field in_iNum[]. The initial values for this
input field are taken from argument array pfLimits.
Outputs out_0..out_iNum-1 contain the filtered image. Input pixels
that lie within the specified box volume are unchanged in the
filtered image. Input pixels that lie outside the specified volume
are replaced by 0.
Output out_iNum contains a filter mask: it has value 1 for those
pixels that passed the filter (i.e., were inside the box), 0
for all others.
OPTIONS: [not yet implemented]
By specifying one or several control tokens in pcOpt, the behavior
of this unit can be modified in the following ways:
- %r:g:bB
- choose background pixel value of (r...g,b) instead of
(0,..0) (note that the first value is repeated to
reach the necessary iNum entries)
- %vM:
- choose value v for mask output (instead of default
v=1)
- %Y:
- if iNum>=3, interprete first three inputs as
RGB and interprete first 3 limit pairs as limits
in Yuv-space.
- %F:
- No image planes as output, only filter mask
- %I:
- No filter mask output, only image planes
STATUS:
Preliminary.
SEE ALSO:
FILE
/amnt/loge/users/nistaff02/nistaff/rhaschke/nst7/man/../o.linux//../foldersrc/nst_filter.c