Write_Image
Synopsis
convert an AVS/Express field to a specified file format and output it to a file
Input Port
in_field
|
Mesh_Unif+Dim2+Node_Data+Scalar
|
ui_parent
|
user interface parent object
|
Parameters
Write_Image_Browser
|
UIfileSB
|
pick file to output
|
flip
|
UItoggle
|
invert boolean
|
format
|
UIradioBox
|
file format
|
file type
|
UIradioBox
|
binary or ASCII
|
bits per pixel
|
UIradioBox
|
depth of image
|
color type
|
UIradioBox
|
RGB, greyscale, etc
|
compression type
|
UIradioBox
|
file compression to use
|
reduction type
|
UIradioBox
|
color quantization to use
|
Output Port
Description
Write_Image writes the input image to disk in the specified format.
Input
field
The input is an AVS/Express field. The input must be a Mesh_Unif+Dim2+Node_Data+Scalar. In addition, you must ensure that the scalar component has veclen=1, and that these four subcomponents are ARGB byte values.
Write_Image re-inverts the scan line order before writing the image to disk. This is because Read_Image initially inverts the scan line order so that the image appears right side up in AVS/Express viewers.
ui_parent
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
Write_Image_Browser
UIfileSB. Selects the disk file to write. The default search pattern is
$XP_PATH<0>/data/image/*.
flip
Boolean indicating whether to invert the image about the x axis, that is in the vertical direction.
format
An integer value indicating the file format. The following image formats are currently supported:
{bmc BULLET.BMP} JPEG (JFIF: JPEG File Interchange Format)
{bmc BULLET.BMP} PBM (Portable Bitmap Utilities)
{bmc BULLET.BMP} SGI Image
{bmc BULLET.BMP} Sun Raster
{bmc BULLET.BMP} GIF (Graphics Interchange Format)
Developer Edition users wishing to create runtimes that include support for writing GIF image format, which uses 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 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 also provided by creating new writers using available API calls. To obtain a current list of the supported image types, you can open v/modules.v and search for "Write_Image" -- the list can be found in the defined radioBox labels.
filetype
An integer indicating whether the output file should be written in binary or ASCII. This option is only appropriate for certain formats, for example PBM.
bits per pixel
An integer indicating the depth (color resolution) of the image.For many formats this is fixed, for example GIF is always 8, AVS .x always 32
color type
An integer indicating whether separate red, green and blue values, or grey levels, or dithered black and white 2 level values should be written. This option is only appropriate for certain formats, for example GIF.
compressiontype
An integer indicating the type of compression to be used when writing the file. For most formats there is no choice, for example GIF is always written using LZW and AVS .x files are always uncompressed. TIFF, however, can support a number of different compression types.
reductiontype
An integer indicating which method to use when the 8 bit red, green and blue values of the input field have to be reduced ("quantized") to 8 bit colormap indices, for example.
Output Port
none.
Example
Not available
File
v/modules.v
compat/modules/converts/fld2avs.c
See also related modules