Herror ::write_image (
    Hobject Image,
    const HTuple &Format,
    const HTuple &FillGray,
    const HTuple &FileName
)
void HImage::WriteImage (
    const HTuple &Format,
    const HTuple &FillGray,
    const HTuple &FileName
) const
void HImageArray::WriteImage (
    const HTuple &Format,
    const HTuple &FillGray,
    const HTuple &FileName
) const

Write images in graphic formats.

The operator ::write_image returns the indicated image (Image) in different image formats in files. Pixels outside the region receive the gray value FillGray.

The following formats are currently supported:

'tiff':
TIFF format, 1 sample per pixel, 8 bits per sample, 
uncompressed,72 dpi; file extension: *.tiff

'tiff_rgb':  
TIFF format, 3 samples per pixel (filed consecutively),
8 bits per sample, uncompressed, 72 dpi; 
file extension: *.tiff

'bmp':
Windows-BMP format, gray value image, 1 byte per pixel;
file extension: *.bmp

'bmp_rgb'
Windows-BMP format, RGB image, 3 bytes per pixel;
file extension: *.bmp
'ima'
The data is written binary line by line (without header or carriage return).
The size of the image and the pixel type are stored
in the description file "FileName.exp".
byte, int4 and real images
can be written.
The  file extension is: *.ima


Parameters

Image (input_object)
image(-array) -> Hobject: HImage(Array)
Output image(s).

Format (input_control)
string -> HTuple.char *
Graphic format.
Default value: 'tiff'
List of values: 'tiff', 'tiff_rgb', 'bmp', 'bmp_rgb', 'ima'

FillGray (input_control)
integer -> HTuple.long
Fill gray value for pixels not belonging to the image region.
Default value: 0
Typical range of values: 0 <= FillGray <= 255

FileName (input_control)
filename(-array) -> HTuple.char *
Name of graphic file.


Result

If the parameter values are correct the operator ::write_image returns the value H_MSG_TRUE. Otherwise an exception handling is raised. If the file cannot be opened ::write_image returns H_MSG_FAIL.


Possible Predecessors

::open_window, ::read_image


Module

Image / region / XLD management



Copyright © 1996-2002 MVTec Software GmbH