Horus Doc || Global Function Guide || General documentation   | Function documentation  

HxScale

Synopsis

HxImageRep HxScale (HxImageRep img, double sx, double sy, double sz, HxGeoIntType gi, int adjustSize)

Input

HxImageRep img
The image you want to rotate.

double sx
The scaling factor for the x-dimension.

double sy
The scaling factor for the y-dimension.

double sz
The scaling factor for the z-dimension.

HxGeoIntType gi
The type of interpolation that is used by the function. Possible values: NEAREST, LINEAR , see the section on Interpolation.

int adjustSize
This parameter determines whether the resulting image has the same size as the input image (adjustSize = 0) or whether the sizes are adjusted (adjustSize not equal to 0).

Return value

HxImageRep
The scaled version of the input image.

Description

The function HxScale scales the image, with factors given for each dimension. sx, sy and sz respectively give the scaling factors for the x-, y- and z-direction. sx, sy and sz should be larger or equal to zero, with the restriction that the resulting image should have at least a size 1 for every dimensioni that the input image has.

Pixels in the result image are calculated by interpolating between the placed pixels of the input image. The type of interpolation is determined by HxGeoIntType gi, see the section on Interpolation. Pixels in the result image that do not originate from pixels in the input image, will get the value `0'.

Since the scaled image will normally not have the size of the input image, you can choose to adjust the size of the output image, such that the complete scaled version fits in (adjustSize = 1). When adjustSize does not equal 1, the size of the result image will be the same as the input image. In this case there is either part of the resulting image that remains `empty' (when scaling factors are smaller than 1) or only the top left corner (in case of 2D) of the image appears in the resulting image (when scaling factors are larger than 1).

Remarks

Valid input images
This function is properly defined for all types of images.

Valid scaling factors
All factors should be larger or equal to zero. Additionally, the factors should be such that the resulting image has a size of at least 1 in every direction. So for 2D images, sx and sy should be large enough. For 3D images, sz also has to be large enough.

See also

anchor_HxReflect, HxRotate, HxExtend, HxRestrict,

Keywords

Geometric,


Generated on Mon Jan 27 15:45:01 2003 for GlobalFunctionGuide by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001