![]() |
![]() |
![]() |
![]() |
DVread_image
Synopsis
read an image file and output an AVS/Express field
module DVread_image {
string+Iparam filename;
int+Iparam flip;
int+Iparam+opt format;
string+Oparam info;
Mesh_Unif+Dim2+Space2+Node_Data+Vector4+Oparam out;
method+notify_val+notify_inst read_image_update<status=1>
= "DVread_image_update";
};Description
DVread_image reads an image file of a specified type and converts it into an AVS/Express Field.
Input
A string. Names the input file to be read. The string can be either the complete absolute pathname, or a relative pathname. If it is relative, it will be interpreted relative to the user's working directory when AVS/Express was started..
Boolean indicating whether to invert the image about the x axis, i.e. in the vertical direction. The renderers assume that the image origin is at the lower left: toggle the flip param if the image is rendered upside-down
An integer value indicating the image file type. A value of 0 causes the type to be determined from the file itself by looking at the id information in the header, or by using the filename extension. The following image formats are currently supported: AVS .x JPEG PBM SGI Image Sun Raster GIF TIFFDeveloper 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 availabel 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
The output is a new Mesh_Unif object.The new Mesh_Unif contains:Node_Data nnodes equal to the number of pixels nnode_data (number of components) equals 1Data_Array 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_BYTEGrid_Unif (portions derived from Grid_Struct) ndims equal to 2 (from Dim2) 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 - 1Gridnspace equals Space2. 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 renderer is set up to recognize 0,0 as the lower left of an object, not the upper left. Reversing the image's scan lines means that the image appears 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 rightside up. To ensure correct results toggle the flip param in this module. You might also compare the output of the image processing operations (using IPcompare) both with and without inve rting the image to determine if this is necessary.
Example
Libraries.Main.Readers.Read_Image
File
modules/rd_image.c modules/image.h
See also
![]() |
![]() |
![]() |
![]() |