34 # include <sifteo/math.h>
35 # include <sifteo/macros.h>
36 # include <sifteo/asset/group.h>
39 #include <sifteo/abi.h>
70 #ifndef NOT_USERSPACE // Begin userspace-only members
82 Int2 pixelSize()
const {
return vec<int>(sys.width << 3, sys.height << 3); }
87 #endif // End userspace-only members
111 operator const _SYSAssetImage& ()
const {
return sys; }
112 operator _SYSAssetImage& () {
return sys; }
113 operator const _SYSAssetImage* ()
const {
return &sys; }
114 operator _SYSAssetImage* () {
return &sys; }
137 #ifndef NOT_USERSPACE // Begin userspace-only members
149 Int2 pixelSize()
const {
return vec<int>(sys.width << 3, sys.height << 3); }
160 uint16_t
tile(
unsigned i)
const {
162 return sys.pData + i;
171 uint16_t
tile(
Int2 pos,
unsigned frame = 0)
const {
182 uint16_t
tile(_SYSCubeID cube,
unsigned i)
const {
193 uint16_t
tile(_SYSCubeID cube,
Int2 pos,
unsigned frame = 0)
const {
199 #endif // End userspace-only members
225 operator const AssetImage* ()
const {
return reinterpret_cast<const AssetImage*
>(
this); }
226 operator AssetImage* () {
return reinterpret_cast<AssetImage*
>(
this); }
229 operator const _SYSAssetImage& ()
const {
return sys; }
230 operator _SYSAssetImage& () {
return sys; }
231 operator const _SYSAssetImage* ()
const {
return &sys; }
232 operator _SYSAssetImage* () {
return &sys; }
250 #ifndef NOT_USERSPACE // Begin userspace-only members
262 Int2 pixelSize()
const {
return vec<int>(sys.width << 3, sys.height << 3); }
274 return reinterpret_cast<const uint16_t *
>(sys.pData);
283 uint16_t
tile(
unsigned i)
const {
294 uint16_t
tile(
Int2 pos,
unsigned frame = 0)
const {
305 uint16_t
tile(_SYSCubeID cube,
unsigned i)
const {
316 uint16_t
tile(_SYSCubeID cube,
Int2 pos,
unsigned frame = 0)
const {
322 #endif // End userspace-only members
348 operator const AssetImage* ()
const {
return reinterpret_cast<const AssetImage*
>(
this); }
349 operator AssetImage* () {
return reinterpret_cast<AssetImage*
>(
this); }
352 operator const _SYSAssetImage& ()
const {
return sys; }
353 operator _SYSAssetImage& () {
return sys; }
354 operator const _SYSAssetImage* ()
const {
return &sys; }
355 operator _SYSAssetImage* () {
return &sys; }
uint16_t tile(Int2 pos, unsigned frame=0) const
Return the index of the tile at the specified (x, y) tile coordinates.
Definition: image.h:171
uint16_t tile(_SYSCubeID cube, unsigned i) const
Returns the index of the tile at linear position 'i' in the image.
Definition: image.h:182
A bundle of compressed tile data, for use by AssetImages.
Definition: group.h:54
Int2 pixelExtent() const
Half the size of this image, in pixels.
Definition: image.h:265
Generalized two-element cartesian coordinate vector.
Definition: math.h:488
AssetGroup & assetGroup() const
Access the AssetGroup instance associated with this AssetImage.
Definition: image.h:73
#define ASSERT(_x)
Runtime debug assertion.
Definition: macros.h:205
int pixelHeight() const
The height of this image, in pixels.
Definition: image.h:99
Int2 pixelSize() const
The (width, height) vector of this image, in pixels.
Definition: image.h:149
int numFrames() const
Access the number of 'frames' in this image.
Definition: image.h:214
int tileWidth() const
The width of this image, in tiles.
Definition: image.h:90
int pixelHeight() const
The height of this image, in pixels.
Definition: image.h:211
int numTiles() const
Compute the total number of tiles in the image.
Definition: image.h:343
An AssetImage in which all tiles are stored sequentially in memory.
Definition: image.h:134
AssetGroup & assetGroup() const
Access the AssetGroup instance associated with this AssetImage.
Definition: image.h:140
uint16_t tile(_SYSCubeID cube, Int2 pos, unsigned frame=0) const
Return the index of the tile at the specified (x, y) tile coordinates.
Definition: image.h:316
int pixelWidth() const
The width of this image, in pixels.
Definition: image.h:208
int numTiles() const
Compute the total number of tiles in the image.
Definition: image.h:108
int tileWidth() const
The width of this image, in tiles.
Definition: image.h:202
int tileHeight() const
The height of this image, in tiles.
Definition: image.h:205
const uint16_t * tileArray() const
Get a pointer to the raw tile data.
Definition: image.h:273
T x
Vector component X.
Definition: math.h:489
int pixelWidth() const
The width of this image, in pixels.
Definition: image.h:96
uint16_t baseAddress(_SYSCubeID cube) const
Return the base address of this asset group, as loaded onto the specified cube.
Definition: group.h:114
int numFrames() const
Access the number of 'frames' in this image.
Definition: image.h:102
uint16_t tile(_SYSCubeID cube, unsigned i) const
Returns the index of the tile at linear position 'i' in the image.
Definition: image.h:305
int tileHeight() const
The height of this image, in tiles.
Definition: image.h:93
Int2 tileExtent() const
Half the size of this image, in tiles.
Definition: image.h:146
int tileWidth() const
The width of this image, in tiles.
Definition: image.h:325
Int2 pixelSize() const
The (width, height) vector of this image, in pixels.
Definition: image.h:262
int numTilesPerFrame() const
Compute the total number of tiles per frame (tileWidth * tileHeight)
Definition: image.h:105
uint16_t tile(unsigned i) const
Returns the index of the tile at linear position 'i' in the image.
Definition: image.h:160
Any kind of asset image, as defined in your stir script.
Definition: image.h:67
int pixelWidth() const
The width of this image, in pixels.
Definition: image.h:331
Int2 tileSize() const
The (width, height) vector of this image, in tiles.
Definition: image.h:143
int numTilesPerFrame() const
Compute the total number of tiles per frame (tileWidth * tileHeight)
Definition: image.h:217
Int2 tileSize() const
The (width, height) vector of this image, in tiles.
Definition: image.h:256
uint16_t tile(unsigned i) const
Returns the index of the tile at linear position 'i' in the image.
Definition: image.h:283
int numTilesPerFrame() const
Compute the total number of tiles per frame (tileWidth * tileHeight)
Definition: image.h:340
T y
Vector component Y.
Definition: math.h:490
uint16_t tile(_SYSCubeID cube, Int2 pos, unsigned frame=0) const
Return the index of the tile at the specified (x, y) tile coordinates.
Definition: image.h:193
Int2 tileExtent() const
Half the size of this image, in tiles.
Definition: image.h:259
int numFrames() const
Access the number of 'frames' in this image.
Definition: image.h:337
Int2 pixelExtent() const
Half the size of this image, in pixels.
Definition: image.h:85
Int2 pixelExtent() const
Half the size of this image, in pixels.
Definition: image.h:152
An AssetImage in which all tile indices are stored in a flat array, without any additional compressio...
Definition: image.h:247
Int2 tileExtent() const
Half the size of this image, in tiles.
Definition: image.h:79
int tileHeight() const
The height of this image, in tiles.
Definition: image.h:328
Int2 tileSize() const
The (width, height) vector of this image, in tiles.
Definition: image.h:76
Int2 pixelSize() const
The (width, height) vector of this image, in pixels.
Definition: image.h:82
int numTiles() const
Compute the total number of tiles in the image.
Definition: image.h:220
int pixelHeight() const
The height of this image, in pixels.
Definition: image.h:334
uint16_t tile(Int2 pos, unsigned frame=0) const
Return the index of the tile at the specified (x, y) tile coordinates.
Definition: image.h:294
AssetGroup & assetGroup() const
Access the AssetGroup instance associated with this AssetImage.
Definition: image.h:253