Read images in graphic formats
The operator read_picture reads image data not available in HORUS format from a file and returns a "suitable" image. The image data must be available in one of the following formats:
'gif' GIF Version 87 and 89a is supported. 'pcx' PCX-Paintbrush Format is supported. 'ras' SUN-Rasterfile Format is supported. 'tiff' TIFF is supported with all compression possibilities. 'xwd' X10- and X11-Windows-Dumps are supported.
If the image format does not correspond to the current image format (see init_horus), the input image is stored in the upper left corner of the output image or only a part of the image is read, respectively. For this purpose the upper left corner of the desired image area can be determined via StartRow and StartColumn. If the input image is smaller than the current HORUS format, the missing pixels are filled with black.
Image files are searched in the current directory (determined by the operating system environment) and the image directory of HORUS The image directory of HORUS is preset to '/bilder' and '/usr/local/horus/images' in a UNIX environment and can be set via the operator set_system. More than one image directory can be indicated. This is done by separating the individual directories by blanks. Furthermore the search path can be set via the environment variable HORUSIMAGES (same structure as in 'image_dir'). Example:
setenv HORUSIMAGES "/usr/images /usr/local/horus/images"
HORUS also searches the image in the sub-directory "images" (images for the program examples). The environment variable HORUSROOT is used for the HORUS directory.
The file name must be indicated as {without} extension.
The extension for 'tiff' image data is called ".tif"
Image (output_object) |
image -> object |
Input image. |
Format (input_control) |
string -> string |
Type of graphic format. | |
Default value: 'tiff' | |
List of values: 'xwd', 'tiff', 'ras', 'pcx', 'gif' |
StartRow (input_control) |
point.y -> integer |
Line index of upper left corner. | |
Default value: 0 | |
Range of values: 0 <= StartRow <= 1024 |
StartColumn (input_control) |
point.x -> integer |
Column index of upper left corner. | |
Default value: 0 | |
Range of values: 0 <= StartColumn <= 1024 |
FileName (input_control) |
filename.named -> string |
Name of file without extension. | |
Default value: 'affe' |
Channels (output_control) |
integer -> integer |
Number of found channels | |
List of values: 1, 3 |
If the parameter values are correct read_picture returns the value TRUE. If the file cannot be opened FAIL is returned. Otherwise an exception is raised.