Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::FileLBM Class Reference

Reads and writes LBM files. More...

Collaboration diagram for Burger::FileLBM:

Public Member Functions

 FileLBM ()
 Default constructor.
 
ImageLoad (InputMemoryStream *pInput)
 Parses a LBM file.
 
const RGBAWord8_tGetPalette (void) const
 Get the file image's palette.
 
RGBAWord8_tGetPalette (void)
 Get the file image's palette.
 
void SetPalette (const RGBWord8_t *pInput, uint_t uStartIndex=0, uint_t uPaletteSize=256)
 Set the file image's palette (RGB)
 
void SetPalette (const RGBAWord8_t *pInput, uint_t uStartIndex=0, uint_t uPaletteSize=256)
 Set the file image's palette (RGBA)
 

Static Public Member Functions

static const char * UnpackILBMData (uint8_t *pOutput, uintptr_t uOutputLength, InputMemoryStream *pInput)
 Unpack data using ILBM compression.
 
static const char * UnpackILBM (uint8_t *pOutput, uint_t uWidth, uint_t uHeight, uint_t uDepth, InputMemoryStream *pInput)
 Unpack bit planed data.
 
static const char * SeekIffChunk (InputMemoryStream *pInput, uint32_t uID, uintptr_t uStartOffset)
 Scan an AIFF file in memory and return pointer to a chunk.
 

Static Public Attributes

static const uint32_t FILETYPE = 0x494C424D
 'ILBM' Mac File type for LBM files (Byte swapped on little endian machines)
 
static const uint32_t AUXTYPE = 0x6F676C65
 'ogle' Mac creator code for LBM files (Byte swapped on little endian machines)
 

Private Attributes

RGBAWord8_t m_Palette [256]
 Palette found in the image.
 

Detailed Description

Reads and writes LBM files.


This class will read and write out LBM files and use Burger::Image class instances as data transporters

Constructor & Destructor Documentation

◆ FileLBM()

Burger::FileLBM::FileLBM ( )

Default constructor.


Initializes all extra file data to defaults

Member Function Documentation

◆ GetPalette() [1/2]

RGBAWord8_t * Burger::FileLBM::GetPalette ( void )
inline

Get the file image's palette.


Obtain a pointer to the 256 entry RGBA color palette found in the LBM file

Returns
Pointer to the 256 entry RGBAWord8_t palette
See also
Burger::FileLBM::GetPalette(void) const

◆ GetPalette() [2/2]

const RGBAWord8_t * Burger::FileLBM::GetPalette ( void ) const
inline

Get the file image's palette.


Obtain a constant pointer to the 256 entry RGBA color palette found in the LBM file

Returns
Constant pointer to the 256 entry RGBAWord8_t palette
See also
Burger::FileLBM::GetPalette(void)

◆ Load()

Burger::Image * Burger::FileLBM::Load ( InputMemoryStream * pInput)

Parses a LBM file.


Read in a LBM file and set the extra variables

Will parse 24 bit uncompressed and 8 bit compressed and uncompressed LBM files only. Other formats are not supported

Note
A descriptive error message is passed to Debug::Warning()
Parameters
pInputPointer to a memory stream that has a LBM file image
Returns
A pointer to a valid Image on success or NULL on failure

◆ SeekIffChunk()

const char *BURGER_API Burger::FileLBM::SeekIffChunk ( InputMemoryStream * pInput,
uint32_t uID,
uintptr_t uStartOffset )
static

Scan an AIFF file in memory and return pointer to a chunk.


Parameters
pInputData stream to read compressed data from
uIDIFF token to scan for
uStartOffsetOffset into the stream where the IFF file begins
Returns
NULL if success or a pointer to a string describing the error

◆ SetPalette() [1/2]

void Burger::FileLBM::SetPalette ( const RGBAWord8_t * pInput,
uint_t uStartIndex = 0,
uint_t uPaletteSize = 256 )
inline

Set the file image's palette (RGBA)


Given a pointer to a palette, copy the colors into this class for writing to an 8 bit LBM file.

If the starting index is greater than 255, this function does nothing. If the color entry count exceeds 256 colors, the remaining colors are ignored to prevent buffer overruns

Parameters
pInputPointer to the palette to copy
uStartIndexColor index of the 256 color internal palette to start modification
uPaletteSizeNumber of color entries in the palette (Maximum 256)
See also
SetPalette(const RGBWord8_t *,uint_t,uint_t)

◆ SetPalette() [2/2]

void Burger::FileLBM::SetPalette ( const RGBWord8_t * pInput,
uint_t uStartIndex = 0,
uint_t uPaletteSize = 256 )
inline

Set the file image's palette (RGB)


Given a pointer to a palette, copy the colors into this class for writing to an 8 bit LBM file. Since the Alpha is missing from the input, each entry set will have the alpha set to zero.

If the starting index is greater than 255, this function does nothing. If the color entry count exceeds 256 colors, the remaining colors are ignored to prevent buffer overruns

Parameters
pInputPointer to the palette to copy
uStartIndexColor index of the 256 color internal palette to start modification
uPaletteSizeNumber of color entries in the palette (Maximum 256)
See also
SetPalette(const RGBAWord8_t *,uint_t,uint_t)

◆ UnpackILBM()

const char *BURGER_API Burger::FileLBM::UnpackILBM ( uint8_t * pOutput,
uint_t uWidth,
uint_t uHeight,
uint_t uDepth,
InputMemoryStream * pInput )
static

Unpack bit planed data.


Supports 8 and 24 bit data

Parameters
pOutputBuffer to accept the decompressed data
uWidthWidth of the image in pixels
uHeightHeight of the image in pixels
uDepthDepth of the image in bits
pInputData stream to read compressed data from
Returns
NULL if success or a pointer to a string describing the error

◆ UnpackILBMData()

const char *BURGER_API Burger::FileLBM::UnpackILBMData ( uint8_t * pOutput,
uintptr_t uOutputLength,
InputMemoryStream * pInput )
static

Unpack data using ILBM compression.


Parameters
pOutputBuffer to accept the decompressed data
uOutputLengthLength of the buffer for decompressed data
pInputData stream to read compressed data from
Returns
NULL if success or a pointer to a string describing the error

Member Data Documentation

◆ AUXTYPE

const uint32_t Burger::FileLBM::AUXTYPE = 0x6F676C65
static

'ogle' Mac creator code for LBM files (Byte swapped on little endian machines)

◆ FILETYPE

const uint32_t Burger::FileLBM::FILETYPE = 0x494C424D
static

'ILBM' Mac File type for LBM files (Byte swapped on little endian machines)

◆ m_Palette

RGBAWord8_t Burger::FileLBM::m_Palette[256]
private

Palette found in the image.