class
ImageData
ImageData holds unpacked image data. The data is stored in an FieldData object as value fields. For simplicity all images are implemented as 3D images, but has an extent of 1 in Z for 2D images, and an extent of 1 in both Y and Z for 1D images. Cube maps are stored as a 3D image with Z-depth of 6 (one for each side)
Methods
Method | Description |
AddColors | Adds the Colors field. |
AddField | Adds a field. The field must have a name that does not conflict with any of the existing field names. The field is referenced by the image after the call to AddField() |
DeepCopy | Copies the field setup and data from another object. To only copy the setup, set copy_data to false. |
GetClass | Get the name of the ImageData class. |
GetColors | The Colors field. |
GetColorsFormat | The color field format specification. |
GetColorsValueType | The base type used by the colors field. |
GetField | Gets a field. |
GetFieldValueType | Gets the value type of a field. |
GetImageFields | The ImageFields field data object, that holds all fields within the image. |
GetType | The type of this image data. |
GetXSize | The X dimension size of this image data. |
GetYSize | The Y dimension size of this image data. |
GetZSize | The Z dimension size of this image data. |
HasColors | Checks if the image has a color field. |
HasField | Check if a field exists in the IImageData object. |
IsA | Returns true if ImageData is a or is a descendant of the class named as the type parameter. |
IsNull | Returns true if the ImageData object is invalid. |
NewCopy | Creates another image data object with the same field setup. To also copy the data to the new object, set copy_data to true. |
RemoveColors | Removes the Colors field. |
RemoveField | Removes a field. |
Reset | Clears all data from the image, and removes all data fields. The type is reset to 2D. |
Set1DSize | The X dimension size of this image data. |
Set2DSize | The X and Y dimension size of this image data. |
Set3DSize | The X, Y and Z dimension size of this image data. |
SetCubeSize | The 6 uniform cube side dimensions of this image data. |
Static methods
Method | Description |
IsClassA | Returns true if the class is a or is a descendant of the class named as the type parameter. |
SafeCast | SafeCast makes sure the input object is of a class that can be cast into spImageData, and if this is the case, returns the object cast into spImageData. |
Methods details
AddColors
Adds the Colors field.
Syntax
Parameters
Type | Name | Min | Max | Description |
EBaseTypes | valuetype | | | The type used to store the tuples. Use TYPES_ID_UCHAR base type for 8-bit per channel data, and TYPES_ID_USHORT base type for 16-bit per channel data. |
const char * | format | | | A string that describes the format of the color field. Each character in format represents a color channel in the color tuple. All characters in the format string must be unique and uppercase. Normal values for format are: RGB, RGBA, YUV, HLS, CMYK, L and R. In these examples the tuplesize of the formats will be 3,4,3,3,4,1 and 1, respectively. The format string must be at least one character long. Use the SG_IMAGEDATA_FORMAT_[] defines to define the standard types. |
Syntax
Parameters
Type | Name | Min | Max | Description |
EBaseTypes | valuetype | | | The type used to store the tuples. Use TYPES_ID_UCHAR base type for 8-bit per channel data, and TYPES_ID_USHORT base type for 16-bit per channel data. |
string | format | | | A string that describes the format of the color field. Each character in format represents a color channel in the color tuple. All characters in the format string must be unique and uppercase. Normal values for format are: RGB, RGBA, YUV, HLS, CMYK, L and R. In these examples the tuplesize of the formats will be 3,4,3,3,4,1 and 1, respectively. The format string must be at least one character long. Use the SG_IMAGEDATA_FORMAT_[] defines to define the standard types. |
Syntax
Parameters
Name | Type | Min | Max | Description |
valuetype | EBaseTypes | | | The type used to store the tuples. Use TYPES_ID_UCHAR base type for 8-bit per channel data, and TYPES_ID_USHORT base type for 16-bit per channel data. |
format | str | | | A string that describes the format of the color field. Each character in format represents a color channel in the color tuple. All characters in the format string must be unique and uppercase. Normal values for format are: RGB, RGBA, YUV, HLS, CMYK, L and R. In these examples the tuplesize of the formats will be 3,4,3,3,4,1 and 1, respectively. The format string must be at least one character long. Use the SG_IMAGEDATA_FORMAT_[] defines to define the standard types. |
AddField
Adds a field. The field must have a name that does not conflict with any of the existing field names. The field is referenced by the image after the call to AddField()
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | name | | | The name of the field to add. |
EBaseTypes | valuetype | | | The type of the field, types listed in BaseTypes. |
unsigned int | tuplesize | | | The size of tuples in the new field. |
Syntax
Parameters
Type | Name | Min | Max | Description |
string | name | | | The name of the field to add. |
EBaseTypes | valuetype | | | The type of the field, types listed in BaseTypes. |
uint | tuplesize | | | The size of tuples in the new field. |
Syntax
Parameters
Name | Type | Min | Max | Description |
name | str | | | The name of the field to add. |
valuetype | EBaseTypes | | | The type of the field, types listed in BaseTypes. |
tuplesize | int | | | The size of tuples in the new field. |
DeepCopy
Copies the field setup and data from another object. To only copy the setup, set copy_data to false.
Syntax
Parameters
Type | Name | Min | Max | Description |
ImageData | source | | | The IImageData object to copy from. |
bool | copy_data | | | True if the data should be copied along with the image data properties. |
Syntax
Parameters
Type | Name | Min | Max | Description |
ImageData | source | | | The IImageData object to copy from. |
bool | copy_data | | | True if the data should be copied along with the image data properties. |
Syntax
Parameters
Name | Type | Min | Max | Description |
source | ImageData | | | The IImageData object to copy from. |
copy_data | bool | | | True if the data should be copied along with the image data properties. |
GetClass
Get the name of the ImageData class.
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: spString
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: string
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: str
GetColors
The Colors field.
Syntax
Parameters
GetColors takes no parameters.
Return value
Type: ValueArray
Syntax
Parameters
GetColors takes no parameters.
Return value
Type: ValueArray
Syntax
Parameters
GetColors takes no parameters.
Return value
Type: ValueArray
The color field format specification.
Syntax
Parameters
GetColorsFormat takes no parameters.
Return value
Type: spString
Syntax
Parameters
GetColorsFormat takes no parameters.
Return value
Type: string
Syntax
Parameters
GetColorsFormat takes no parameters.
Return value
Type: str
GetColorsValueType
The base type used by the colors field.
Syntax
Parameters
GetColorsValueType takes no parameters.
Return value
Type: EBaseTypes
Key | Value | Comment |
TYPES_ID_VOID | 0 | |
TYPES_ID_BOOL | 1 | |
TYPES_ID_CHAR | 2 | |
TYPES_ID_UCHAR | 3 | |
TYPES_ID_SHORT | 4 | |
TYPES_ID_USHORT | 5 | |
TYPES_ID_INT | 6 | |
TYPES_ID_UINT | 7 | |
TYPES_ID_LONG | 8 | |
TYPES_ID_ULONG | 9 | |
TYPES_ID_FLOAT | 10 | |
TYPES_ID_DOUBLE | 11 | |
TYPES_ID_REAL | 12 | |
TYPES_ID_RID | 13 | |
TYPES_ID_RCHAR | 14 | |
TYPES_ID_RHANDLE | 15 | |
TYPES_ID_STRING | 16 | |
TYPES_ID_OBJECT | 17 | |
Syntax
Parameters
GetColorsValueType takes no parameters.
Return value
Type: ``````
Key | Value | Comment |
TYPES_ID_VOID | 0 | |
TYPES_ID_BOOL | 1 | |
TYPES_ID_CHAR | 2 | |
TYPES_ID_UCHAR | 3 | |
TYPES_ID_SHORT | 4 | |
TYPES_ID_USHORT | 5 | |
TYPES_ID_INT | 6 | |
TYPES_ID_UINT | 7 | |
TYPES_ID_LONG | 8 | |
TYPES_ID_ULONG | 9 | |
TYPES_ID_FLOAT | 10 | |
TYPES_ID_DOUBLE | 11 | |
TYPES_ID_REAL | 12 | |
TYPES_ID_RID | 13 | |
TYPES_ID_RCHAR | 14 | |
TYPES_ID_RHANDLE | 15 | |
TYPES_ID_STRING | 16 | |
TYPES_ID_OBJECT | 17 | |
Syntax
Parameters
GetColorsValueType takes no parameters.
Return value
Type: EBaseTypes
Key | Value | Comment |
EBaseTypes_TYPES_ID_VOID | 0 | |
EBaseTypes_TYPES_ID_BOOL | 1 | |
EBaseTypes_TYPES_ID_CHAR | 2 | |
EBaseTypes_TYPES_ID_UCHAR | 3 | |
EBaseTypes_TYPES_ID_SHORT | 4 | |
EBaseTypes_TYPES_ID_USHORT | 5 | |
EBaseTypes_TYPES_ID_INT | 6 | |
EBaseTypes_TYPES_ID_UINT | 7 | |
EBaseTypes_TYPES_ID_LONG | 8 | |
EBaseTypes_TYPES_ID_ULONG | 9 | |
EBaseTypes_TYPES_ID_FLOAT | 10 | |
EBaseTypes_TYPES_ID_DOUBLE | 11 | |
EBaseTypes_TYPES_ID_REAL | 12 | |
EBaseTypes_TYPES_ID_RID | 13 | |
EBaseTypes_TYPES_ID_RCHAR | 14 | |
EBaseTypes_TYPES_ID_RHANDLE | 15 | |
EBaseTypes_TYPES_ID_STRING | 16 | |
EBaseTypes_TYPES_ID_OBJECT | 17 | |
GetField
Gets a field.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | name | | | The name of the field to get. |
Return value
Type: ValueArray
Syntax
Parameters
Type | Name | Min | Max | Description |
string | name | | | The name of the field to get. |
Return value
Type: ValueArray
Syntax
Parameters
Name | Type | Min | Max | Description |
name | str | | | The name of the field to get. |
Return value
Type: ValueArray
GetFieldValueType
Gets the value type of a field.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | name | | | The name of the field whose type to get, types listed in BaseTypes. |
Return value
Type: EBaseTypes
Key | Value | Comment |
TYPES_ID_VOID | 0 | |
TYPES_ID_BOOL | 1 | |
TYPES_ID_CHAR | 2 | |
TYPES_ID_UCHAR | 3 | |
TYPES_ID_SHORT | 4 | |
TYPES_ID_USHORT | 5 | |
TYPES_ID_INT | 6 | |
TYPES_ID_UINT | 7 | |
TYPES_ID_LONG | 8 | |
TYPES_ID_ULONG | 9 | |
TYPES_ID_FLOAT | 10 | |
TYPES_ID_DOUBLE | 11 | |
TYPES_ID_REAL | 12 | |
TYPES_ID_RID | 13 | |
TYPES_ID_RCHAR | 14 | |
TYPES_ID_RHANDLE | 15 | |
TYPES_ID_STRING | 16 | |
TYPES_ID_OBJECT | 17 | |
Syntax
Parameters
Type | Name | Min | Max | Description |
string | name | | | The name of the field whose type to get, types listed in BaseTypes. |
Return value
Type: ``````
Key | Value | Comment |
TYPES_ID_VOID | 0 | |
TYPES_ID_BOOL | 1 | |
TYPES_ID_CHAR | 2 | |
TYPES_ID_UCHAR | 3 | |
TYPES_ID_SHORT | 4 | |
TYPES_ID_USHORT | 5 | |
TYPES_ID_INT | 6 | |
TYPES_ID_UINT | 7 | |
TYPES_ID_LONG | 8 | |
TYPES_ID_ULONG | 9 | |
TYPES_ID_FLOAT | 10 | |
TYPES_ID_DOUBLE | 11 | |
TYPES_ID_REAL | 12 | |
TYPES_ID_RID | 13 | |
TYPES_ID_RCHAR | 14 | |
TYPES_ID_RHANDLE | 15 | |
TYPES_ID_STRING | 16 | |
TYPES_ID_OBJECT | 17 | |
Syntax
Parameters
Name | Type | Min | Max | Description |
name | str | | | The name of the field whose type to get, types listed in BaseTypes. |
Return value
Type: EBaseTypes
Key | Value | Comment |
EBaseTypes_TYPES_ID_VOID | 0 | |
EBaseTypes_TYPES_ID_BOOL | 1 | |
EBaseTypes_TYPES_ID_CHAR | 2 | |
EBaseTypes_TYPES_ID_UCHAR | 3 | |
EBaseTypes_TYPES_ID_SHORT | 4 | |
EBaseTypes_TYPES_ID_USHORT | 5 | |
EBaseTypes_TYPES_ID_INT | 6 | |
EBaseTypes_TYPES_ID_UINT | 7 | |
EBaseTypes_TYPES_ID_LONG | 8 | |
EBaseTypes_TYPES_ID_ULONG | 9 | |
EBaseTypes_TYPES_ID_FLOAT | 10 | |
EBaseTypes_TYPES_ID_DOUBLE | 11 | |
EBaseTypes_TYPES_ID_REAL | 12 | |
EBaseTypes_TYPES_ID_RID | 13 | |
EBaseTypes_TYPES_ID_RCHAR | 14 | |
EBaseTypes_TYPES_ID_RHANDLE | 15 | |
EBaseTypes_TYPES_ID_STRING | 16 | |
EBaseTypes_TYPES_ID_OBJECT | 17 | |
GetImageFields
The ImageFields field data object, that holds all fields within the image.
Syntax
Parameters
GetImageFields takes no parameters.
Return value
Type: FieldData
Syntax
Parameters
GetImageFields takes no parameters.
Return value
Type: FieldData
Syntax
Parameters
GetImageFields takes no parameters.
Return value
Type: FieldData
GetType
The type of this image data.
Syntax
Parameters
GetType takes no parameters.
Return value
Type: unsigned int
Syntax
Parameters
GetType takes no parameters.
Return value
Type: uint
Syntax
Parameters
GetType takes no parameters.
Return value
Type: int
GetXSize
The X dimension size of this image data.
Syntax
Parameters
GetXSize takes no parameters.
Return value
Type: unsigned int
Syntax
Parameters
GetXSize takes no parameters.
Return value
Type: uint
Syntax
Parameters
GetXSize takes no parameters.
Return value
Type: int
GetYSize
The Y dimension size of this image data.
Syntax
Parameters
GetYSize takes no parameters.
Return value
Type: unsigned int
Syntax
Parameters
GetYSize takes no parameters.
Return value
Type: uint
Syntax
Parameters
GetYSize takes no parameters.
Return value
Type: int
GetZSize
The Z dimension size of this image data.
Syntax
Parameters
GetZSize takes no parameters.
Return value
Type: unsigned int
Syntax
Parameters
GetZSize takes no parameters.
Return value
Type: uint
Syntax
Parameters
GetZSize takes no parameters.
Return value
Type: int
HasColors
Checks if the image has a color field.
Syntax
Parameters
HasColors takes no parameters.
Return value
Type: bool
Syntax
Parameters
HasColors takes no parameters.
Return value
Type: bool
Syntax
Parameters
HasColors takes no parameters.
Return value
Type: bool
HasField
Check if a field exists in the IImageData object.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | name | | | The name of the field to check for. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
string | name | | | The name of the field to check for. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
name | str | | | The name of the field to check for. |
Return value
Type: bool
IsA
Returns true if ImageData is a or is a descendant of the class named as the type parameter.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | type | | | Name of the class to check if ImageData is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
string | type | | | Name of the class to check if ImageData is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
type | str | | | Name of the class to check if ImageData is, or is a descendant of. |
Return value
Type: bool
IsNull
Returns true if the ImageData object is invalid.
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
NewCopy
Creates another image data object with the same field setup. To also copy the data to the new object, set copy_data to true.
Syntax
Parameters
Type | Name | Min | Max | Description |
bool | copy_data | | | If true, all data is copied. |
Return value
Type: ImageData
Syntax
Parameters
Type | Name | Min | Max | Description |
bool | copy_data | | | If true, all data is copied. |
Return value
Type: ImageData
Syntax
Parameters
Name | Type | Min | Max | Description |
copy_data | bool | | | If true, all data is copied. |
Return value
Type: ImageData
RemoveColors
Removes the Colors field.
Syntax
Parameters
RemoveColors takes no parameters.
Syntax
Parameters
RemoveColors takes no parameters.
Syntax
Parameters
RemoveColors takes no parameters.
RemoveField
Removes a field.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | name | | | The name of the field to remove. |
Syntax
Parameters
Type | Name | Min | Max | Description |
string | name | | | The name of the field to remove. |
Syntax
Parameters
Name | Type | Min | Max | Description |
name | str | | | The name of the field to remove. |
Reset
Clears all data from the image, and removes all data fields. The type is reset to 2D.
Syntax
Parameters
Reset takes no parameters.
Syntax
Parameters
Reset takes no parameters.
Syntax
Parameters
Reset takes no parameters.
Set1DSize
The X dimension size of this image data.
Syntax
Parameters
Type | Name | Min | Max | Description |
unsigned int | _xs | | | The desired X dimension size of this image data. |
Syntax
Parameters
Type | Name | Min | Max | Description |
uint | _xs | | | The desired X dimension size of this image data. |
Syntax
Parameters
Name | Type | Min | Max | Description |
_xs | int | | | The desired X dimension size of this image data. |
Set2DSize
The X and Y dimension size of this image data.
Syntax
Parameters
Type | Name | Min | Max | Description |
unsigned int | _xs | | | The desired X dimension size of this image data. |
unsigned int | _ys | | | The desired Y dimension size of this image data. |
Syntax
Parameters
Type | Name | Min | Max | Description |
uint | _xs | | | The desired X dimension size of this image data. |
uint | _ys | | | The desired Y dimension size of this image data. |
Syntax
Parameters
Name | Type | Min | Max | Description |
_xs | int | | | The desired X dimension size of this image data. |
_ys | int | | | The desired Y dimension size of this image data. |
Set3DSize
The X, Y and Z dimension size of this image data.
Syntax
Parameters
Type | Name | Min | Max | Description |
unsigned int | _xs | | | The desired X dimension size of this image data. |
unsigned int | _ys | | | The desired Y dimension size of this image data. |
unsigned int | _zs | | | The desired Z dimension size of this image data. |
Syntax
Parameters
Type | Name | Min | Max | Description |
uint | _xs | | | The desired X dimension size of this image data. |
uint | _ys | | | The desired Y dimension size of this image data. |
uint | _zs | | | The desired Z dimension size of this image data. |
Syntax
Parameters
Name | Type | Min | Max | Description |
_xs | int | | | The desired X dimension size of this image data. |
_ys | int | | | The desired Y dimension size of this image data. |
_zs | int | | | The desired Z dimension size of this image data. |
SetCubeSize
The 6 uniform cube side dimensions of this image data.
Syntax
Parameters
Type | Name | Min | Max | Description |
unsigned int | _xs | | | The desired X dimension size of each cube side in this image data. |
unsigned int | _ys | | | The desired Y dimension size of each cube side in this image data. |
Syntax
Parameters
Type | Name | Min | Max | Description |
uint | _xs | | | The desired X dimension size of each cube side in this image data. |
uint | _ys | | | The desired Y dimension size of each cube side in this image data. |
Syntax
Parameters
Name | Type | Min | Max | Description |
_xs | int | | | The desired X dimension size of each cube side in this image data. |
_ys | int | | | The desired Y dimension size of each cube side in this image data. |
Static methods details
IsClassA
Returns true if the class is a or is a descendant of the class named as the type parameter.
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | type | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
string | type | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
type | str | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
SafeCast
SafeCast makes sure the input object is of a class that can be cast into spImageData, and if this is the case, returns the object cast into spImageData.
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to cast. |
Return value
Type: ImageData
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to cast. |
Return value
Type: ImageData
Syntax
Parameters
Name | Type | Min | Max | Description |
object | Object | | | Object to cast. |
Return value
Type: ImageData