Read_Image
Synopsis
read an image file and output an AVS/Express field
Input Port
Parameters
Output Port
Description
Read_Image reads an image file and converts it into an AVS/Express Field.
Input
A port to connect to a user interface object that contains the macro's widgets. By default, it is connected to the default user interface object in the application in which the macro is instanced. (This default connection is not drawn.)
Parameters
File browser. Selects the disk file to input and convert. The default search pattern is $XP_PATH<0>/data/image/*.
Boolean indicating whether to invert the image about the x axis, that is, in the vertical direction.
An integer value indicating the file format. A value of 0 causes the format to be determined from the file itself by looking at the id information in the header, or by using the filename extension. Other values indicate the format explicitly. The following image formats are currently supported:AVS .x
Developer Edition users wishing to create runtimes that include support for reading GIF and TIFF image formats, which use the patented LZW compression algorithm, must first obtain a license from Unisys Corporation:
WARNING : Use of this software for providing LZW capability for any purpose is not authorized unless user first enters into a license agreement with Unisys under U.S. Patent No. 4,558,302 and foreign counterparts. For information concering licensing, please contact:
Unisys Corporation
Welch Licensing Department - C1SW19
Township Line & Union Meeting Roads
P.O. Box 500
Blue Bell, PA 19422
Once you have entered into such a license agreement with Unisys Corp, runtime generation support for GIF and TIFF can be enabled in AVS/Express at no additional cost. Contact Advanced Visual Systems customer support for details.
Support for additional image formats can be provided by creating new readers using available API calls. To obtain a current list of the supported image types, you can open v/modules.v and search for "Read_Image" -- the list can be found in the defined radioBox labels.
Output Port
The order of the image's scan lines is reversed. For example, if an input image had four rows of pixels (0, 1, 2, 3) with 0 the "top" of the image, the output image has four rows of pixels (3, 2, 1, 0) with 0 at the "bottom" of the image. The reason for this is that the renderer recognizes 0,0 as the lower left of an object, not the upper left. Reversing the image's scan lines makes the image appear upright in the renderer window.
Because the scan lines are reversed, a few image processing functions may not produce the same result as they would if the image was right side up. To ensure correct results, use the flip input parameter.
veclen equals 4 (alpha, red, green, blue)
id equals GD_RGB_DATA_ID
values array contains the ARGBs of all pixels
primitive data type DTYPE_BYTE
dims array equal to dims[0] = x; dims[1] = y
points array equal to: points[0] = 0.0
points[1] = 0.0
points[2] = (float) x - 1
points[3] = (float) y - 1
Example
File
v/modules.v
modules/rd_image.c
modules/image.hSee also related modules