aglReshape

Provides Array Visualizer with information about how the given array data is to be interpreted as an array with particular dimensions and data of a particular type.

int aglReshape(
  pvoid array,
  int numdims,
  int *dimsizes,
  int datatype
  );

Parameters

array
A pointer to the array that is to be reshaped.

numdims
The number of dimensions (at most 7) that the reshaped array is to have.

dimsizes
Pointer to a one-dimensional array of Integers, where the first value contains the size of the first dimension, the second value contains the size of the second dimension, etc.

datatype
The type of the data in the array, as shown in the following table. You can use the name on the left as a substitute for the number on the right.

Data Type Code
AGL_UCHAR 4096
AGL_CHAR 4097
AGL_USHORT 4098
AGL_SHORT 4099
AGL_ULONG 4100
AGL_LONG 4101
AGL_FLOAT 4102
AGL_DOUBLE 4103
AGL_ULLONG 4104
AGL_LLONG 4105

Return Value

Returns the value 0 if the call is successful; any other value indicates failure.

Remarks

Caution: The product of the dimension sizes, when multiplied times the number of bytes required for each data element, must be exactly equal to the number of bytes in the array, as requested of, and allocated by aglMalloc. Otherwise, the error AGL_ERROR_RESHAPE_INVALID is returned and the call fails.

See Also

aglMalloc