IDLgrBuffer

An IDLgrBuffer object is an in-memory, off-screen destination object. Object trees can be drawn to instances of the IDLgrBuffer object and the resulting image can be retrieved from the buffer using the Read() method. The off-screen representation avoids dithering artifacts by providing a full-resolution buffer for objects using either the RGB or Color Index color models.

Superclasses

This class has no superclasses.

Subclasses

This class has no subclasses.

Creation

See IDLgrBuffer::Init

Methods

Intrinsic Methods

This class has the following methods:


IDLgrBuffer::Cleanup

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

Calling Sequence

OBJ_DESTROY, Obj

or

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

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrBuffer::Draw

The IDLgrBuffer:: Draw procedure method draws the given picture to this graphics destination. IDLgrBuffer is described above.

Calling Sequence

Obj -> [IDLgrBuffer::] Draw, Picture

Arguments

Picture

The view (an instance of an IDLgrView object), viewgroup (an instance of an IDLgrViewgroup object) or scene (an instance of an IDLgrScene object) to be drawn.

Keywords

CREATE_INSTANCE

Set this keyword equal to one to specify that this scene or view is the unchanging part of a drawing. Some destinations can make an instance from the current window contents without having to perform a complete redraw. If the view or scene to be drawn is identical to the previously drawn view or scene, this keyword can be set equal to 2 to hint the destination to create the instance from the current window contents if it can.

DRAW_INSTANCE

Set this keyword to specify that this scene, viewgroup, or view is the changing part of the drawing. It is overlaid on the result of the most recent CREATE_INSTANCE draw.


IDLgrBuffer::Erase

The IDLgrBuffer:: Erase procedure method erases this graphics destination. IDLgrBuffer is described above.

Calling Sequence

Obj -> [IDLgrBuffer::] Erase

Arguments

There are no arguments for this method.

Keywords

COLOR

Set this keyword to the color to be used for the erase. The color may be specified as a color lookup table index or as an RGB vector.


IDLgrBuffer::GetContiguousPixels

The IDLgrBuffer:: GetContiguousPixels function method returns an array of long integers whose length is equal to the number of colors available in the index color mode (that is, the value of the N_COLORS property).

The returned array marks contiguous pixels with the ranking of the range's size. This means that within the array, the elements in the largest available range are set to zero, the elements in the second-largest range are set to one, etc. Use this range to set an appropriate colormap for use with the SHADE_RANGE property of the IDLgrSurface and IDLgrPolygon object classes.

To get the largest contiguous range, you could use the following IDL command:

result = obj -> GetContiguousPixels()

Range0 = WHERE(result EQ 0)

A contiguous region in the colormap can be increasing or decreasing in values. The following would be considered contiguous:

[0,1,2,3,4]

[4,3,2,1,0]

IDLgrBuffer is described above.

Calling Sequence

Return = Obj -> [IDLgrBuffer::] GetContiguousPixels()

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrBuffer::GetProperty

The IDLgrBuffer:: GetProperty procedure method retrieves the value of a property or group of properties for the buffer. IDLgrBuffer is described above.

Calling Sequence

Obj -> [IDLgrBuffer::] GetProperty

Keywords

Any keyword to IDLgrBuffer::Init

ALL

Set this keyword to a named variable that will contain an anonymous structure containing the values of all of the retrievable properties associated with this object (except IMAGE_DATA and ZBUFFER_DATA).

IMAGE_DATA

Set this keyword to a named variable that will contain a byte array representing the image that is currently rendered within the buffer. If the buffer uses an RGB color model, the returned array will have dimensions (3, xdim , ydim ). If the window object uses an indexed color model, the returned array will have dimensions ( xdim , ydim ).

SCREEN_DIMENSIONS

Set this keyword to a named variable that will contain a two-element vector of the form [ width , height ] specifying the maximum allowed dimensions (measured in device units) for the buffer object.

ZBUFFER_DATA

Set this keyword to a named variable that will contain a float array representing the zbuffer that is currently within the buffer. The returned array will have dimensions ( xdim , ydim ).


IDLgrBuffer::GetTextDimensions

The IDLgrBuffer:: GetTextDimensions function method retrieves the dimensions of a text object that will be rendered in the buffer. The result is a 3-element floating-point vector [ xDim , yDim , zDim ] representing the dimensions of the text object, measured in data units. IDLgrBuffer is described above.

Calling Sequence

Result = Obj -> [IDLgrBuffer::] GetTextDimensions( TextObj )

Arguments

TextObj

The object reference to a text or axis object for which the text dimensions are requested.

Keywords

DESCENT

Set this keyword equal to a named variable that will contain an array of floating-point values (one for each string in the IDLgrText object). The values represent the distance to travel (parallel to the UPDIR vector) from the text baseline to reach the bottom of the lowest descender in the string. All values will be negative numbers, or zero. This keyword is valid only if TextObj is an IDLgrText object.


IDLgrBuffer::Init

The IDLgrBuffer:: Init function method initializes the buffer object. IDLgrBuffer is described above.

Calling Sequence

Obj = OBJ_NEW('IDLgrBuffer')

or

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

Arguments

There are no arguments for this method.

Keywords

Properties retrievable via IDLgrBuffer::GetProperty

COLOR_MODEL (Get)

Set this keyword to the color model to be used for the buffer:

DIMENSIONS (Get, Set)

Set this keyword to a two-element vector of the form [ width , height ] to specify the dimensions of the buffer in units specified by the UNITS property. The default is [640,480].

GRAPHICS_TREE (Get, Set)

Set this keyword to an object reference of type IDLgrScene, IDLgrViewgroup, or IDLgrView. If this property is set to a valid object reference, calling the Draw method on the destination object with no arguments will cause the object reference associated with this property to be drawn. If this object is valid and the destination object is destroyed, this object reference will be destroyed as well. By default the GRAPHICS_TREE property is set equal to the null-object.

N_COLORS (Get)

Set this keyword to the number of colors (between 2 and 256) to be used if COLOR_MODEL is set to Color Index.

PALETTE (Get, Set)

Set this keyword to the object reference of a palette object (an instance of the IDLgrPalette object class) to specify the red, green, and blue values that are to be loaded into the buffer's color lookup table.

QUALITY (Get, Set)

Set this keyword to an integer indicating the rendering quality at which graphics are to be drawn to the buffer. Valid values are:

RESOLUTION (Get, Set)

Set this keyword to a two-element vector of the form [ xres , yres ] specifying the device resolution in centimeters per pixel. The default value is: [0.0352778, 0.0352778] (72 DPI).

UNITS (Get, Set)

Set this keyword to indicate the units of measure for the DIMENSIONS property. Valid values are:

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.


IDLgrBuffer::PickData

The IDLgrBuffer:: Pickdata function method maps a point in the two-dimensional device space of the buffer to a point in the three-dimensional data space of an object tree. The resulting 3D data space coordinates are returned in a user-specified variable. The Pickdata function returns one if the specified location in the buffer's device space "hits" a graphic object, or zero otherwise. IDLgrBuffer is described above.

Calling Sequence

Result = Obj -> [IDLgrBuffer::] Pickdata( View , Object , Location , XYZLocation )

Arguments

View

The object reference of an IDLgrView object that contains the object being picked.

Object

The object reference of a model or atomic graphic object from which the data space coordinates are being requested.

Location

A two-element vector [ x , y ] specifying the location in the buffer's device space of the point to pick data from.

XYZLocation

A named variable that will contain the three-dimensional data space coordinates of the picked point. Note that the value returned in this variable is a location, not a data value.

Keywords

There are no keywords for this method.


IDLgrBuffer::Read

The IDLgrWindow:: Read function method reads an image from a buffer. The returned value is an instance of the IDLgrImage object class. IDLgrBuffer is described above.

Calling Sequence

Result = Obj -> [IDLgrBuffer::] Read()

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrBuffer::Select

The IDLgrBuffer:: Select function method returns a list of objects selected at a specified location. If no objects are selected, the Select function returns -1. IDLgrBuffer is described above.

Calling Sequence

Result = Obj -> [IDLgrBuffer::] Select( Picture, XY )

Arguments

Picture

The view, viewgroup, or scene (an instance of the IDLgrView , IDLgrViewgroup, or IDLgrScene class) whose children are among the candidates for selection.

If the first argument is a scene or viewgroup, then the returned object list will contain one or more views. If the first argument is a view, the list will contain atomic graphic objects (or model objects which have their SELECT_TARGET property set). Objects are returned in order, according to their distance from the viewer. The closer an object is to the viewer, the lower its index in the returned object list. If multiple objects are at the same distance from the viewer (views in a scene or 2D geometry), the last object drawn will appear at a lower index in the list.

XY

A two-element array defining the center of the selection box in device space. By default, the selection box is 3 pixels by 3 pixels.

Keywords

DIMENSIONS

Set this keyword to a two-element array [ w , h ] to specify that the selection box will have a width w and a height h , and will be centered about the coordinates [ x , y ] specified in the XY argument. The box occupies the rectangle defined by:

    (x-(w/2), y-(h/2)) - (x+(w/1), y+(h/2))

Any object which intersects this box is considered to be selected. By default, the selection box is 3 pixels by 3 pixels.

UNITS

Set this keyword to indicate the units of measure. Valid values are:


IDLgrBuffer::SetProperty

The IDLgrBuffer:: SetProperty procedure method sets the value of a property or group of properties for the buffer. IDLgrBuffer is described above.

Calling Sequence

Obj -> [IDLgrBuffer::] SetProperty

Arguments

There are no arguments for this method.

Keywords

Any keyword to IDLgrBuffer::Init