Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
Burger::FileAPF Class Reference

Reads files. More...

Collaboration diagram for Burger::FileAPF:
Collaboration graph
[legend]

Public Member Functions

 FileAPF ()
 Default constructor.
 
ImageLoad (InputMemoryStream *pInput)
 Parses an Apple Preferred File (Apple IIgs)
 
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 Attributes

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

Private Attributes

RGBAWord8_t m_Palette [256]
 Palette found in the image.
 

Detailed Description

Reads files.


This class will read Apple IIgs Apple Preferred Graphic files and use Burger::Image class instances as data transporters

Constructor & Destructor Documentation

◆ FileAPF()

Burger::FileAPF::FileAPF ( )

Default constructor.


Initializes all extra file data to defaults

Member Function Documentation

◆ GetPalette() [1/2]

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

Get the file image's palette.


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

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

◆ GetPalette() [2/2]

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

Get the file image's palette.


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

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

◆ Load()

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

Parses an Apple Preferred File (Apple IIgs)


Read in an Apple Preferred File made for an Apple IIgs and set the extra variables

Will parse 4 bit compressed files only.

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

◆ SetPalette() [1/2]

void Burger::FileAPF::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 APF 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::FileAPF::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 APF 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)

Member Data Documentation

◆ AUXTYPE

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

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

◆ FILETYPE

const uint32_t Burger::FileAPF::FILETYPE = 0x41504620
static

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

◆ m_Palette

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

Palette found in the image.