NAME
remap - remap an image to a different resolution
PROTOTYPE
unitptr remap( int dx1, int dy1, int dx2, int dy2, unitptr dest)
ARGUMENTS
- int dx1
- width in pixels of source image
- int dy1
- height in pixels of source image
- int dx2
- width in pixels of result image
- int dy2
- height in pixels of result image
- unitptr dest
- host unit for newly created instance
RETURN VALUE:
- unitptr u:
- pointer to newly created unit
INTERFACE OF CREATED UNIT:
- X_in[dx1*dy1]:
- (packed input field) pixel values of
source image
- X_out[dx2*dy2]:
- (packed output field 0) result image
DESCRIPTION:
Creates a unit execution of which
maps image rectangle 1 onto image
rectangle 2. Currently, either BOTH dx2 and dy2 must be
integer multiples of dx1,dy1, or BOTH dx1 and dy1 must
be integer multiples of dx2,dy2. In the first case the
smaller image rectangle 1 is mapped to the larger image
rectangle 2 by mapping each pixel of image 1 to a pixel block
of [dx2/dx1]x[dy2/dy1] pixels of image 2. All pixels
within a block have the gray value of the pixel of image
1. In the second case, pixel blocks of size [dx1/dx2]x[dy1/dy2] of
the larger image 1 are mapped to single
pixels of the smaller image 2 by averaging the gray
values within each block. The ratios dxi/dxj, dyi/dyj
need not be equal, but values leading to magnification
along one, and reduction along the other coordinate axis
are prohibited.
SEE ALSO:
combine
FILE
/local/homes/rhaschke/nst7/man/../o.linx86//../foldersrc/nst_pixel.c