Herror ::convert_image_type (
    Hobject Image,
    Hobject *ImageConverted,
    const HTuple &NewType
)
HImage HImage::ConvertImageType (
    const HTuple &NewType
) const
HImageArray HImageArray::ConvertImageType (
    const HTuple &NewType
) const

Convert the type of an image.

::convert_image_type converts images of an arbitrary type into an arbitrary new image type. If the conversion is done from a larger to a smaller gray value range (e.g., from 'int4' to 'byte'), too large or too small values are simply ``clipped.'' It is therefore advisable to adapt the range of gray values by calling ::scale_image before calling this operator.


Attention

If the source and destination image type are identical, no new image matrix is allocated.


Parameters

Image (input_object)
(multichannel-)image(-array) -> Hobject: HImage(Array) ( any )
Image whose image type is to be changed.

ImageConverted (output_object)
(multichannel-)image(-array) -> Hobject * : HImage(Array) ( any )
Converted image.

NewType (input_control)
string -> HTuple.char *
Desired image type (i.e., type of the gray values).
Default value: 'byte'
List of values: 'int1', 'int2', 'int4', 'byte', 'real', 'direction', 'cyclic', 'complex', 'dvf', 'lut'


Result

::convert_image_type returns H_MSG_TRUE if all parameters are correct. If the input is empty the behaviour can be set via ::set_system('no_object_result',<Result>). If necessary, an exception is raised.


Possible Predecessors

::scale_image


See also

::scale_image, ::abs_image


Module

Image / region / XLD management



Copyright © 1996-2002 MVTec Software GmbH