Functions
Bitmap

Bitmap management. More...

Description

Functions

TLNAPI TLN_Bitmap TLN_CreateBitmap (int width, int height, int bpp)
 Creates a memory bitmap. More...
 
TLNAPI TLN_Bitmap TLN_LoadBitmap (const char *filename)
 Load image file (8-bit BMP or PNG) More...
 
TLNAPI TLN_Bitmap TLN_CloneBitmap (TLN_Bitmap src)
 Creates a copy of a bitmap. More...
 
TLNAPI uint8_t * TLN_GetBitmapPtr (TLN_Bitmap bitmap, int x, int y)
 Gets memory access for direct pixel manipulation. More...
 
TLNAPI int TLN_GetBitmapWidth (TLN_Bitmap bitmap)
 Returns the width in pixels. More...
 
TLNAPI int TLN_GetBitmapHeight (TLN_Bitmap bitmap)
 Returns the height in pixels. More...
 
TLNAPI int TLN_GetBitmapDepth (TLN_Bitmap bitmap)
 Returns the bits per pixel. More...
 
TLNAPI int TLN_GetBitmapPitch (TLN_Bitmap bitmap)
 Returns the number of bytes per scaline (also known a stride) More...
 
TLNAPI TLN_Palette TLN_GetBitmapPalette (TLN_Bitmap bitmap)
 Gets the associated palete of a bitmap. More...
 
TLNAPI bool TLN_SetBitmapPalette (TLN_Bitmap bitmap, TLN_Palette palette)
 Assigns a new palette to the bitmap. More...
 
TLNAPI bool TLN_DeleteBitmap (TLN_Bitmap bitmap)
 Deletes bitmap and frees resources. More...
 

Function Documentation

TLNAPI TLN_Bitmap TLN_CreateBitmap ( int  width,
int  height,
int  bpp 
)
Parameters
widthWidth in pixels
heightHeight in pixels
bppBits per pixel
Returns
Reference to the created bitmap, or NULL if error
See also
TLN_SetBGBitmap()
TLNAPI TLN_Bitmap TLN_LoadBitmap ( const char *  filename)
Parameters
filenameFile name with the image
Returns
Handler to the loaded image or NULL if error
See also
TLN_DeleteBitmap()
TLNAPI TLN_Bitmap TLN_CloneBitmap ( TLN_Bitmap  src)
Parameters
srcReference to the original bitmap
Returns
Reference to the created bitmap, or NULL if error
See also
TLN_SetBGBitmap()
TLNAPI uint8_t* TLN_GetBitmapPtr ( TLN_Bitmap  bitmap,
int  x,
int  y 
)
Parameters
bitmapReference to bitmap
xStarting x position [0, width - 1]
yStarting y position [0, height - 1]
Returns
Pointer to pixel data starting at x,y
Remarks
Care must be taken in manipulating memory directly as it can crash the application
TLNAPI int TLN_GetBitmapWidth ( TLN_Bitmap  bitmap)
Parameters
bitmapReference to the bitmap
TLNAPI int TLN_GetBitmapHeight ( TLN_Bitmap  bitmap)
Parameters
bitmapReference to the bitmap
TLNAPI int TLN_GetBitmapDepth ( TLN_Bitmap  bitmap)
Parameters
bitmapReference to the bitmap
TLNAPI int TLN_GetBitmapPitch ( TLN_Bitmap  bitmap)
Parameters
bitmapReference to the bitmap
TLNAPI TLN_Palette TLN_GetBitmapPalette ( TLN_Bitmap  bitmap)
Parameters
bitmapReference to bitmap
Returns
Reference to the bitmap palette
See also
TLN_SetBitmapPalette()
TLNAPI bool TLN_SetBitmapPalette ( TLN_Bitmap  bitmap,
TLN_Palette  palette 
)
Parameters
bitmapReference to the bitmap
paletteReference to the palette to assign
See also
TLN_GetBitmapPalette()
TLNAPI bool TLN_DeleteBitmap ( TLN_Bitmap  bitmap)
Parameters
bitmapReference to bitmap to delete
See also
TLN_CreateBitmap89, TLN_CloneBitmap()