IDLgrImage

An image object represents a mapping from a two-dimensional array of data values to a two dimensional array of pixel colors, resulting in a flat 2D-scaled version of the image, drawn at Z = 0.

The image object is drawn at Z =0 and is positioned and sized with respect to two points:

p1 = [LOCATION(0), LOCATION(1), 0]

p2 = [LOCATION(0) + DIMENSION(0), LOCATION(1) + DIMENSION(1), 0].

where LOCATION and DIMENSION are properties of the image object. These points are transformed in three dimensions, resulting in screen space points designated as p1' and p2'. The image data is drawn in a 2D rectangle defined by [(p1'(0), p1'(1), p2'(0), p2'(1)] by scaling the image pixels to fit the rectangle.

An IDLgrImage object is an atomic graphic object ; it is one of the basic drawable elements of the IDL Object Graphics system, and it is not a container for other objects.

Superclasses

This class has no superclasses.

Subclasses

This class has no subclasses.

Creation

See IDLgrImage::Init

Methods

Intrinsic Methods

This class has the following methods:


IDLgrImage::Cleanup

The IDLgrImage:: Cleanup procedure method performs all cleanup on the object. IDLgrImage is described above.

Calling Sequence

OBJ_DESTROY, Obj

or

Obj -> [IDLgrImage::] Cleanup                               ( In a subclass' Cleanup method only .)

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrImage::GetCTM

The IDLgrImage:: GetCTM function method returns the 4 x 4 graphics transform matrix from the current object upward through the graphics tree. IDLgrImage is described above.

Calling Sequence

Result = Obj -> [IDLgrImage::] GetCTM()

Arguments

There are no arguments for this method.

Keywords

DESTINATION

Set this keyword to the object reference of a destination object to specify that the projection matrix for the View object in the current tree be included in the returned transformation matrix. The resulting matrix will transform a point in the data space of the object on which the GetCTM method is called into a normalized coordinate system (-1 to +1 in X, Y, and Z), relative to the View object that contains the image object.

TOP

Set this keyword equal to the object reference to an IDLgrModel object to specify that the returned matrix accumulate from the object on which the GetCTM method is called up to and including the specified model object.


IDLgrImage::GetProperty

The IDLgrImage:: GetProperty procedure method retrieves the value of the property or group of properties for the image. IDLgrImage is described above.

Calling Sequence

Obj -> [IDLgrImage::] GetProperty

Arguments

There are no arguments for this method.

Keywords

Any keyword to IDLgrImage::Init

ALL

Set this keyword to a named variable that will contain an anonymous structure containing the values of all of the properties associated with the state of this object. State information about the object includes things like color, range, tick direction, etc., but not image, vertex, or connectivity data, or user values.

PARENT

Set this keyword equal to a named variable that will contain an object reference to the object that contains this object.

XRANGE

Set this keyword equal to a named variable that will contain a two-element vector of the form [ xmin , xmax ] that specifies the range of x data coordinates covered by the graphic object.

YRANGE

Set this keyword equal to a named variable that will contain a two-element vector of the form [ ymin , ymax ] that specifies the range of y data coordinates covered by the graphic object.

ZRANGE

Set this keyword equal to a named variable that will contain a two-element vector of the form [ zmin , zmax ] that specifies the range of z data coordinates covered by the graphic object.


IDLgrImage::Init

The IDLgrImage:: Init function method initializes the image object. IDLgrImage is described above.

Calling Sequence

Obj = OBJ_NEW('IDLgrImage' [, ImageData] )

or

Result = Obj -> [IDLgrImage::] Init( [ImageData] )         ( In a subclass' Init method only .)

Arguments

ImageData

An array of data values to be displayed as an image. If this argument is not already of byte type, it is converted when the image object is created. ImageData can be any of the following, where n is the width of the image, and m is the height:

If the array has more than one channel, the interleave is specified by the INTERLEAVE property.

Keywords

Properties retrievable via IDLgrImage::GetProperty

BLEND_FUNCTION (Get, Set)

Set this keyword equal to a two-element vector [ src , dst ] specifying one of the functions listed below for each of the source and destination objects. These are only valid for RGB model destinations. If no Alpha data are specified in an image, the image's Alpha value is assumed to be 1.0. The values of the blending function ( V src and V dst ) are used in the following equation

where C d is the initial color of a pixel on the destination device (the background color), C i is the color of the pixel in the image, and C d ' is the resulting color of the pixel.

Setting src and dst in the BLEND_FUNCTION vector to the following values determine how each term in the equation is calculated:

src or dst

V src or V dst ·

What the function does

0

n/a

Alpha blending is disabled. C d ' = C i .

1

0

The value of V src or V dst in the equation is zero, thus the value of the term is zero.

2

1

The value of V src or V dst in the equation is one, thus the value of the term is the same as the color value.

3

Image a ·

The value of V src or V dst in the equation is the value of the alpha channel of the image.

4

1-Image a ·

The value of V src or V dst in the equation is one minus the value of the alpha channel of the image.

CHANNEL (Get, Set)

Set this keyword to a hexadecimal bitmask that defines which color channel(s) to draw. Each bit that is a 1 is drawn; each bit that is a 0 is not drawn. For example, 'ff0000'X represents a Red channel write. The default is to draw all channels, and is represented by the hexadecimal value 'ffffff'X.

DATA (Get, Set)

Set this keyword to a n x m , 2xnxm , 3xn x m , or 4xn x m array of image data for the object. The n and m values may be in any position as specified by the INTERLEAVE keyword. This keyword is equivalent to the optional argument, ImageData .

DIMENSIONS (Get, Set)

Set this keyword equal to a two-element vector of the form [ width , height ] specifying the dimensions of the rectangle in which the image is to be drawn on the device. The image will be resampled as necessary to fit within this rectangle. The default is derived from the dimensions of the given image data and is measured in pixels.

GREYSCALE (Get, Set)

Set this keyword to specify that the image not be drawn through a palette.

If this keyword is not set, for an RGB colormodel destination, if a palette is present in the image object, it is used. If there is no current destination palette, a greyscale palette is used. For a Color Index colormodel destination, the current destination palette is used.

HIDE (Get, Set)

Set this keyword to a boolean value indicating whether this object should be drawn:

INTERLEAVE (Get, Set)

Set this keyword to indicate the dimension over which color is interleaved for images with more than one channel:

LOCATION (Get, Set)

A two- or three-element vector [ x , y ] or [ x , y , z ] specifying the position of the lower lefthand corner of the image, measured in data units. If the vector is of the form [ x , y ], the z value is set equal to zero. The default is [0, 0, 0].

NAME (Get, Set)

Set this keyword equal to a string containing the name associated with this object. The default is the null string, ' '.

NO_COPY (Get, Set)

Set this keyword to relocate the image data from the input variable to the image object, leaving the input variable ImageData undefined. Only the ImageData argument is affected. If this keyword is omitted, the input image data will be duplicated and a copy will be stored in the object.

ORDER (Get, Set)

Set this keyword to force the rows of the image data to be drawn from top to bottom. By default, image data is drawn from the bottom row up to the top row.

PALETTE (Get, Set)

Set this keyword equal to the object reference of a palette object (an instance of the IDLgrPalette object class) to specify the red, green, and blue values of the color lookup table to be associated with the image if it is an indexed color image. This property is ignored if the image is a greyscale or RGB image.

RESET_DATA (Set)

Set this keyword to treat the data provided via the DATA property as a new data set unique to this object, rather than overwriting data that is shared by other objects. There is no reason to use this keyword if the object on which the property is being set does not currently share data with another object (that is, if the SHARE_DATA property is not in use). This keyword has no effect if no new data is provided via the DATA property.

SHARE_DATA (Set)

Set this keyword equal to the object reference of an object with which data is to be shared by this image. An image may only share data with another image. The SHARE_DATA property is intended for use when data values are not set via an argument to the object's Init method or by setting the object's DATA property.

UVALUE (Get, Set)

Set this keyword to a value of any type. You can use this "user value" to contain any information you wish. Remember that if you set the user value equal to a pointer or object reference, you should destroy the pointer or object reference explicitly when destroying the object it is a user value of.

XCOORD_CONV (Get, Set)

Set this keyword to a vector, [ s 0 , s 1 ], of scaling factors used to convert X coordinates from data units to normalized units. The formula for the conversion is as follows:

Normalized X = s 0 + s 1 * Data X

Recommended values are:

[(- X min )/( X max - X min ), 1/( X max - X min )]

The default is [0.0, 1.0].

YCOORD_CONV (Get, Set)

Set this keyword to a vector, [ s 0 , s 1 ], of scaling factors used to convert Y coordinates from data units to normalized units. The formula for the conversion is as follows:

Normalized Y = s 0 + s 1 * Data Y

Recommended values are:

[(- Y min )/( Y max - Y min ), 1/( Y max - Y min )]

The default is [0.0, 1.0].

ZCOORD_CONV (Get, Set)

Set this keyword to a vector, [ s 0 , s 1 ], of scaling factors used to convert Z coordinates from data units to normalized units. The formula for the conversion is as follows:

Normalized Z = s 0 + s 1 * Data Z

Recommended values are:

[(- Z min )/( Z max - Z min ), 1/( Z max - Z min )]

The default is [0.0, 1.0].


IDLgrImage::SetProperty

The IDLgrImage:: SetProperty procedure method sets the value of the property or group of properties for the image. IDLgrImage is described above.

Calling Sequence

Obj -> [IDLgrImage::] SetProperty

Arguments

There are no arguments for this method.

Keywords

Any keyword to IDLgrImage::Init