FLDget_points


Synopsis

get/set the points (extents) array in a Grid_Struct Grid


int FLDget_points (
OMobj_id field,
float **points,
int *size,
int mode);

int FLDset_points (
OMobj_id field,
float *points,
int size,
int mode);

Description

These routines get/set the points array (extents) in a Grid_Struct Grid. The points array is defined as: float points = [npoints][nspace].

Grid_Structs include Grid_Unif and Grid_Rect grids.

Parameters

OMobj_id field

The OMobj_id of a field containing a Grid_Struct.

float **points
float *points

In FLDget_points, points is a pointer to a pointer to floats; upon return, *points is filled in with the address of the points array. You must call ARRfree() on this pointer when you are done with it.

In FLDset_points, points is an array of type float from which the points array is copied to the field.

int *size
int size

In FLDget_points, size is a pointer to an integer variable in which the size of the points array is returned.

In FLdset_points, size is an integer variable from which the size of the points array is copied to the field.

int mode

An integer constant that establishes the access mode for the array subobject. Constants for the possible values are defined in avs/om.h as follows.

For FLDset_points:

Mode

 

Value

 

Meaning

 

OM_SET_ARRAY_COPY

0

Copy the array into the Object Manager

OM_SET_ARRAY_FREE

1

If possible, do not copy the array. AVS/Express copies the array anyway if the function is running in an external process or if data type conversion is required.This mode is generally preferred to OM_SET_ARRAY_COPY

AVS/Express manages the array and will determine when the array can be freed.

You must allocate space for the array with a call to ARRalloc.

OM_SET_ARRAY_STATIC

2

If possible, do not copy the array. Instead, set the object's array pointer to node_data. AVS/Express copies the array anyway if the function is running in an external process or if data type conversion is required.

AVS/Express does not manage the array. You must ensure that the array is valid for the life of the object or until the object replaces the array.

 

For FLDget_points:

Mode

 

Value

 

Meaning

 

OM_GET_ARRAY_RD

0

The program intends to read the array, but not write to it.

OM_GET_ARRAY_WR

1

The program intends to write to the array, completely replacing it, but not read it.

OM_GET_ARRAY_RW

2

The program intends to both read and write to the array.

OM_GET_ARRAY_RD_
COPY

3

The program requires a copy of the array for its own, private use (reading or writing).

 

Example

modules/crop.c
modules/exc_brk3.c
modules/gen_fld.c
modules/pln_crop.c
modules/sct2unif.c
modules/slice.c (and others)

Related routines