TSgImageInfo Class Reference

class TSgImageInfo

This class is used to create images and to return information about them.

An image is created as constant if the requested CPU access is ESgCpuAccessNone or ESgCpuAccessReadOnly and the requested usage does not include any usage as target. Otherwise it is created as mutable.

For an instance of TSgImageInfo to be valid, the following conditions must be true:
  • The width and height must both be greater than zero.

  • The screen identifier must be greater than or equal to -1 (-1 is reserved to mean screen-agnostic).

  • If the usage includes ESgUsageScreenSource then the screen identifier must not be -1.

  • The number of user-defined attributes must be greater than or equal to zero.

  • If the number of user-defined attributes is greater than zero then the pointer to the array of user-defined attributes must not be null.

For an image creation request to succeed, the following conditions must be true:
  • The instance of TSgImageInfo passed in as a parameter must be valid.

  • If the screen identifier is not -1 then it must refer to an existing screen.

  • If the usage includes ESgUsageScreenSource then the width and height must be compatible with the specified screen.

  • The pixel format must be compatible with the shareability, CPU access, usage and screen identifier. Compatibility is device-dependent, with the exception that to allow generic applications to exist, some level of compatibility must be guaranteed across all systems. To allow efficient implementation on the widest range of hardware, the number of compatibility guarantees is limited. See Image Compatibility Guarantees for more information.

RSgImage::GetPixelFormats() RSgImage::Create()

Constructor & Destructor Documentation

TSgImageInfo()

IMPORT_C TSgImageInfo ( )

Member Data Documentation

TSgCpuAccess iCpuAccess

TSgCpuAccess iCpuAccess

Defines whether and how the image is mappable for CPU access. An image that is not mappable for CPU access is likely to give higher performance than a mappable image.

TUidPixelFormat iPixelFormat

TUidPixelFormat iPixelFormat

The pixel format of the image. Note that this value is only guaranteed to be the actual pixel format if the image is mappable. Otherwise it is acceptable for the image to be stored internally in a different format so long as there is no loss of information. In all cases, if the user passes in some initial data to populate the image during creation, this value is assumed to be the exact pixel format of the data passed in.

TInt iScreenId

TInt iScreenId

Defines whether the image is usable on all screens or just on a specific screen. A value of -1 is interpreted as meaning that the image is usable on all screens. Zero and positive values are interpreted as meaning that the image is only valid for use on the specified screen. A screen-specific image is likely to give higher performance than a screen-agnostic image.

TBool iShareable

TBool iShareable

Defines whether the image is shareable between processes. A non-shareable image is likely to give higher performance than a shareable image.

TSize iSizeInPixels

TSize iSizeInPixels

The size of the image in pixels.

TUint32 iUsage

TUint32 iUsage

Defines the possible usage of the image in terms of the rendering pipelines, and purposes within those pipelines, that it will be used for. It is interpreted as a combination of the bit flags defined in TSgUsageFlags. An image with limited usage is likely to give higher performance than an image with more general usage.

TInt iUserAttributeCount

TInt iUserAttributeCount

In image creation requests, the number of user-defined attributes to be attached to the image.

In information queries, the number of user-defined attributes to be retrieved from the image.

TSgUserAttribute * iUserAttributes

TSgUserAttribute * iUserAttributes

In image creation requests, a pointer to an array with the user-defined attributes to be attached to the image or null if the image is to have no user-defined attributes.

In information queries, a pointer to an array that on input contains the globally unique identifiers of the user-defined attributes to be retrieved from the image and on return will contain the values of the selected user-defined attributes. If null then the information query will not retrieve any user-defined attributes.