openTRI 0.1
|
Data Structures | |
struct | triImageFileHeader |
Image File Header. More... | |
struct | triImageChunkHeader |
struct | triImageChunk |
struct | triMipLevel |
struct | triImage |
Image struct. More... | |
struct | triImageSlice |
Image slice struct. More... | |
struct | triImageLarge |
Large Image struct. More... | |
struct | triImageAnimation |
ImageAnimation struct. More... | |
Functions | |
struct triImageFileHeader | __attribute__ ((packed)) triImageFileHeader |
Image File Header. More... | |
triVoid | triImagePaletteGet (triImage *img, triU32 col, triU32 *r, triU32 *g, triU32 *b, triU32 *a) |
Get a palette entry from image. More... | |
triVoid | triImagePaletteSet (triImage *img, triU32 col, triU32 r, triU32 g, triU32 b, triU32 a) |
Set a palette entry in image. More... | |
triVoid | triImageSwizzleToVRAM (triImage *img) |
Swizzle and upload an image to VRAM for faster drawing. More... | |
triVoid | triImageSwizzle (triImage *img) |
Swizzle an image for faster drawing. More... | |
triVoid | triImageUnswizzle (triImage *img) |
Unswizzle an image. More... | |
triVoid | triImageToVRAM (triImage *img) |
Upload an image to VRAM for faster drawing. More... | |
triVoid | triImageToRAM (triImage *img) |
Download an image to RAM. More... | |
triVoid | triImageFree (triImage *img) |
Free an image. More... | |
triVoid | triImageAnimationFree (triImageAnimation *img) |
Free an image animation. More... | |
triImage * | triImageGet (triS32 x, triS32 y, triS32 width, triS32 height) |
Capture part of framebuffer to image. More... | |
triImage * | triImageSet (triS32 width, triS32 height, triS32 stride, triS32 bits, triS32 psm, triVoid *data) |
Create an image from a memory buffer. More... | |
triImage * | triImageLoadRaw (triChar *name) |
Load image from a .raw file. More... | |
triImage * | triImageLoadRawStream (stream *s) |
Load RAW image from a stream. More... | |
triImage * | triImageLoadTga (triChar *name) |
Load image from a .tga file. More... | |
triImage * | triImageLoadTgaStream (stream *s) |
Load TGA image from a stream. More... | |
triImage * | triImageLoadTri (triChar *name, triU32 frame) |
Load image from a .tri file. More... | |
triImage * | triImageLoadTriStream (stream *s, triU32 frame) |
Load TRI image from a stream. More... | |
triImage * | triImageLoad (triChar *name, triU32 flags) |
Generic file loader. More... | |
triImage * | triImageLoadStream (stream *s, triU32 flags) |
Generic stream file loader. More... | |
triVoid | triImageSaveTga (triChar *name, triImage *img, triS32 saveAlpha, triS32 rle) |
Save image to a .tga file. More... | |
triVoid | triImageSaveTri (triChar *name, triImage *img, triU32 flags) |
Save image to a .tri file. More... | |
triImageAnimation * | triImageAnimationCreate () |
Create a new blank triImageAnimation structure. More... | |
triImageAnimation * | triImageAnimationFromSheet (triImage *img, triS32 fwidth, triS32 fheight, triS32 hframes, triS32 vframes, triU32 delay) |
Create an animation from an imagesheet in order left-right, top-down. More... | |
triImageAnimation * | triImageAnimationFromSheet2 (triImage *img, triS32 xoffs, triS32 yoffs, triS32 fwidth, triS32 fheight, triS32 hframes, triS32 vframes, triU32 delay) |
Create an animation from an imagesheet in order left-right, top-down. More... | |
triImageAnimation * | triImageAnimationFromSheetTga (triChar *name, triS32 fwidth, triS32 fheight, triS32 hframes, triS32 vframes, triU32 delay) |
Create an animation from an imagesheet in a Tga file, in order left-right, top-down. More... | |
triImageAnimation * | triImageAnimationFromSheetFile (triChar *name, triS32 fwidth, triS32 fheight, triS32 hframes, triS32 vframes, triU32 delay) |
Create an animation from an imagesheet in a file, in order left-right, top-down. More... | |
triImageAnimation * | triImageAnimationFromSheetFile2 (triChar *name, triS32 xoffs, triS32 yoffs, triS32 fwidth, triS32 fheight, triS32 hframes, triS32 vframes, triU32 delay) |
Create an animation from an imagesheet in a file, in order left-right, top-down. More... | |
triVoid | triImageAnimationAppend (triImageAnimation *ani, triImage *img, triS32 sx, triS32 sy, triS32 sw, triS32 sh, triS32 x_offs, triS32 y_offs, triU32 delay) |
Append a loaded triImage as last frame to an animation. More... | |
triVoid | triImageAnimationAppend2 (triImageAnimation *ani, triImage *img, triU32 delay) |
Append a loaded triImage as last frame to an animation. More... | |
triVoid | triImageAnimationAppend3 (triImageAnimation *ani, triImage *img, triS32 xOffs, triS32 yOffs, triU32 delay) |
Append a loaded triImage as last frame to an animation. More... | |
triImageAnimation * | triImageAnimationLoadGif (triChar *name) |
triImageAnimation * | triImageAnimationLoadGifStream (stream *s) |
triImageAnimation * | triImageAnimationLoadTri (triChar *name) |
Load image animation from a .tri file. More... | |
triImageAnimation * | triImageAnimationLoadTriStream (stream *s) |
Load image animation from a stream. More... | |
void | triImageAnimationSaveTri (triChar *name, triImageAnimation *ani, triS32 flags) |
Save image animation to a .tri file. More... | |
triVoid | triImageAnimationStart (triImageAnimation *ani) |
Start animation. More... | |
triVoid | triImageAnimationPause (triImageAnimation *ani) |
Pause animation. More... | |
triVoid | triImageAnimationReset (triImageAnimation *ani) |
Reset animation (Stop+Rewind). More... | |
triS32 | triImageAnimationUpdate (triImageAnimation *ani) |
Update animation. More... | |
triVoid | triImageAnimationSetSpeed (triImageAnimation *ani, triFloat factor) |
Set animation speed. More... | |
triBool | triImageAnimationIsDone (triImageAnimation *ani) |
Return if animation is finished. More... | |
triImage * | triImageAnimationGetFrame (triImageAnimation *ani, triS32 nFrame) |
Return one frame from animation. More... | |
struct triImageFileHeader __attribute__ | ( | (packed) | ) |
Image File Header.
ImageAnimation struct.
Large Image struct.
Image slice struct.
Image struct.
Max 1024xN.
Contains an image region of max 512x512 pixels.
Used to load and draw large images.
triVoid triImagePaletteGet | ( | triImage * | img, |
triU32 | col, | ||
triU32 * | r, | ||
triU32 * | g, | ||
triU32 * | b, | ||
triU32 * | a | ||
) |
Get a palette entry from image.
*img | - Pointer to image containing the palette |
col | - Palette entry index |
*r | - Pointer to U32 to contain the red component (0-255) |
*g | - Pointer to U32 to contain the green component (0-255) |
*b | - Pointer to U32 to contain the blue component (0-255) |
triVoid triImagePaletteSet | ( | triImage * | img, |
triU32 | col, | ||
triU32 | r, | ||
triU32 | g, | ||
triU32 | b, | ||
triU32 | a | ||
) |
Set a palette entry in image.
*img | - Pointer to image containing the palette |
col | - Palette entry index |
r | - Red component (0-255) |
g | - Green component (0-255) |
b | - Blue component (0-255) |
triVoid triImageSwizzleToVRAM | ( | triImage * | img | ) |
Swizzle and upload an image to VRAM for faster drawing.
*img | - Pointer to image |
triVoid triImageSwizzle | ( | triImage * | img | ) |
Swizzle an image for faster drawing.
*img | - Pointer to image |
triVoid triImageUnswizzle | ( | triImage * | img | ) |
Unswizzle an image.
*img | - Pointer to image |
triVoid triImageToVRAM | ( | triImage * | img | ) |
Upload an image to VRAM for faster drawing.
*img | - Pointer to image |
triVoid triImageToRAM | ( | triImage * | img | ) |
Download an image to RAM.
*img | - Pointer to image |
triVoid triImageFree | ( | triImage * | img | ) |
Free an image.
*img | - Pointer to image |
triVoid triImageAnimationFree | ( | triImageAnimation * | img | ) |
Free an image animation.
*img | - Pointer to image animation |
triImage * triImageGet | ( | triS32 | x, |
triS32 | y, | ||
triS32 | width, | ||
triS32 | height | ||
) |
Capture part of framebuffer to image.
x | - X-coordinate of rect to capture |
y | - Y-coordinate of rect to capture |
width | - Width of rect to capture |
height | - Height of rect to capture |
triImage * triImageSet | ( | triS32 | width, |
triS32 | height, | ||
triS32 | stride, | ||
triS32 | bits, | ||
triS32 | psm, | ||
triVoid * | data | ||
) |
Create an image from a memory buffer.
width | - Width of image |
height | - Height of image |
stride | - Allocated width of image (buffer width) |
bits | - Bits of image |
psm | - Format of image - one of IMG_FORMAT_* |
data | - Pointer to memory containing the image data |
triImage * triImageLoadRaw | ( | triChar * | name | ) |
Load image from a .raw file.
name | - Filename of file to load |
Load RAW image from a stream.
s | - Opened stream to read from |
triImage * triImageLoadTga | ( | triChar * | name | ) |
Load image from a .tga file.
name | - Filename of file to load |
Load TGA image from a stream.
s | - Opened stream to read from |
triImage * triImageLoadTri | ( | triChar * | name, |
triU32 | frame | ||
) |
Load image from a .tri file.
name | - Filename of file to load |
frame | - Frame number of file to load |
level | - Sublevel to load (0-7) |
Load TRI image from a stream.
s | - Opened stream to read from |
frame | - Frame number of file to load |
level | - Sublevel to load (0-7) |
triImage * triImageLoad | ( | triChar * | name, |
triU32 | flags | ||
) |
Generic file loader.
Loads .tga, .tri and .png.
name | - Filename of file to load |
flags | - flags to apply to the image (one of TRI_RAM/TRI_VRAM/TRI_SWIZZLE) |
Generic stream file loader.
Loads .tga, .tri and .png.
s | - Stream to load from |
flags | - flags to apply to the image (one of TRI_RAM/TRI_VRAM/TRI_SWIZZLE) |
triVoid triImageSaveTga | ( | triChar * | name, |
triImage * | img, | ||
triS32 | saveAlpha, | ||
triS32 | rle | ||
) |
Save image to a .tga file.
name | - Filename of file to save |
img | - Pointer to image to save |
saveAlpha | - Whether to save the alpha channel with the image |
rle | - Whether to RLE compress image |
triVoid triImageSaveTri | ( | triChar * | name, |
triImage * | img, | ||
triU32 | flags | ||
) |
Save image to a .tri file.
name | - Filename of file to save |
img | - Pointer to image to save |
flags | - any combination of TRI_IMG_FLAGS_* |
triImageAnimation * triImageAnimationCreate | ( | ) |
Create a new blank triImageAnimation structure.
triImageAnimation * triImageAnimationFromSheet | ( | triImage * | img, |
triS32 | fwidth, | ||
triS32 | fheight, | ||
triS32 | hframes, | ||
triS32 | vframes, | ||
triU32 | delay | ||
) |
Create an animation from an imagesheet in order left-right, top-down.
img | - Pointer to triImage containing spritesheet |
fwidth | - Width of one frame in sheet |
fheight | - Height of one frame in sheet |
hframes | - Number of horizontal frames |
vframes | - Number of vertical frames |
delay | - Delay to apply per frame, given in ms |
triImageAnimation * triImageAnimationFromSheet2 | ( | triImage * | img, |
triS32 | xoffs, | ||
triS32 | yoffs, | ||
triS32 | fwidth, | ||
triS32 | fheight, | ||
triS32 | hframes, | ||
triS32 | vframes, | ||
triU32 | delay | ||
) |
Create an animation from an imagesheet in order left-right, top-down.
img | - Pointer to triImage containing spritesheet |
xoffs | - X offset where the frames should start |
yoffs | - Y offset where the frames should start |
fwidth | - Width of one frame in sheet |
fheight | - Height of one frame in sheet |
hframes | - Number of horizontal frames |
vframes | - Number of vertical frames |
delay | - Delay to apply per frame, given in ms |
triImageAnimation * triImageAnimationFromSheetTga | ( | triChar * | name, |
triS32 | fwidth, | ||
triS32 | fheight, | ||
triS32 | hframes, | ||
triS32 | vframes, | ||
triU32 | delay | ||
) |
Create an animation from an imagesheet in a Tga file, in order left-right, top-down.
name | - Filename of Tga image to load from. |
fwidth | - Width of one frame in sheet |
fheight | - Height of one frame in sheet |
hframes | - Number of horizontal frames |
vframes | - Number of vertical frames |
delay | - Delay to apply per frame, given in ms |
triImageAnimation * triImageAnimationFromSheetFile | ( | triChar * | name, |
triS32 | fwidth, | ||
triS32 | fheight, | ||
triS32 | hframes, | ||
triS32 | vframes, | ||
triU32 | delay | ||
) |
Create an animation from an imagesheet in a file, in order left-right, top-down.
name | - Filename of image to load from. |
fwidth | - Width of one frame in sheet |
fheight | - Height of one frame in sheet |
hframes | - Number of horizontal frames |
vframes | - Number of vertical frames |
delay | - Delay to apply per frame, given in ms |
triImageAnimation * triImageAnimationFromSheetFile2 | ( | triChar * | name, |
triS32 | xoffs, | ||
triS32 | yoffs, | ||
triS32 | fwidth, | ||
triS32 | fheight, | ||
triS32 | hframes, | ||
triS32 | vframes, | ||
triU32 | delay | ||
) |
Create an animation from an imagesheet in a file, in order left-right, top-down.
name | - Filename of image to load from. |
xoffs | - X offset where the frames should start |
yoffs | - Y offset where the frames should start |
fwidth | - Width of one frame in sheet |
fheight | - Height of one frame in sheet |
hframes | - Number of horizontal frames |
vframes | - Number of vertical frames |
delay | - Delay to apply per frame, given in ms |
triVoid triImageAnimationAppend | ( | triImageAnimation * | ani, |
triImage * | img, | ||
triS32 | sx, | ||
triS32 | sy, | ||
triS32 | sw, | ||
triS32 | sh, | ||
triS32 | x_offs, | ||
triS32 | y_offs, | ||
triU32 | delay | ||
) |
Append a loaded triImage as last frame to an animation.
ani | - Pointer to triAnimationImage to append the image to |
img | - Pointer to triImage to append |
sx | - X-coordinate of source image rect |
sy | - Y-coordinate of source image rect |
sw | - Width of source image rect |
sh | - Height of source image rect |
x_offs | - Offset in X-coordinate to draw the image |
y_offs | - Offset in Y-coordinate to draw the image |
delay | - Delay to apply per frame, given in ms |
triVoid triImageAnimationAppend2 | ( | triImageAnimation * | ani, |
triImage * | img, | ||
triU32 | delay | ||
) |
triVoid triImageAnimationAppend3 | ( | triImageAnimation * | ani, |
triImage * | img, | ||
triS32 | xOffs, | ||
triS32 | yOffs, | ||
triU32 | delay | ||
) |
Append a loaded triImage as last frame to an animation.
ani | - Pointer to triAnimationImage to append the image to |
img | - Pointer to triImage to append |
x_offs | - Offset in X-coordinate to draw the image |
y_offs | - Offset in Y-coordinate to draw the image |
delay | - Delay to apply per frame, given in ms |
triImageAnimation * triImageAnimationLoadTri | ( | triChar * | name | ) |
Load image animation from a .tri file.
name | - Filename of file to load |
triImageAnimation * triImageAnimationLoadTriStream | ( | stream * | s | ) |
Load image animation from a stream.
s | - Opened stream to read from |
void triImageAnimationSaveTri | ( | triChar * | name, |
triImageAnimation * | ani, | ||
triS32 | flags | ||
) |
Save image animation to a .tri file.
name | - Filename of file to save |
ani | - Pointer to triImageAnimation structure to save |
flags | - any combination of TRI_IMG_FLAGS_* |
triVoid triImageAnimationStart | ( | triImageAnimation * | ani | ) |
Start animation.
ani | - Pointer to triAnimationImage |
triVoid triImageAnimationPause | ( | triImageAnimation * | ani | ) |
Pause animation.
ani | - Pointer to triAnimationImage |
triVoid triImageAnimationReset | ( | triImageAnimation * | ani | ) |
Reset animation (Stop+Rewind).
ani | - Pointer to triAnimationImage |
triS32 triImageAnimationUpdate | ( | triImageAnimation * | ani | ) |
Update animation.
ani | - Pointer to triAnimationImage |
triVoid triImageAnimationSetSpeed | ( | triImageAnimation * | ani, |
triFloat | factor | ||
) |
Set animation speed.
ani | - Pointer to triAnimationImage |
factor | - Float specifying the speed - 1.0 = normal speed, 2.0 = double speed |
triBool triImageAnimationIsDone | ( | triImageAnimation * | ani | ) |
Return if animation is finished.
ani | - Pointer to triAnimationImage |
triImage * triImageAnimationGetFrame | ( | triImageAnimation * | ani, |
triS32 | nFrame | ||
) |
Return one frame from animation.
ani | - Pointer to triAnimationImage |
nFrame | - Number of Frame to return (starting at 0) |