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::Renderer Class Reference

Base graphics renderer class. More...

Inheritance diagram for Burger::Renderer:
Collaboration diagram for Burger::Renderer:

Public Member Functions

 Renderer (void)
 Default constructor.
 
virtual ~Renderer ()
 Default destructor.
 
virtual uint_t Init (uint_t uWidth, uint_t uHeight, uint_t uDepth, uint_t uFlags)
 Initialize a renderer.
 
virtual void Shutdown (void)
 Shut down a renderer.
 
virtual void BeginScene (void)
 Start up a renderer for a frame.
 
virtual void EndScene (void)
 Wrap up frame rendering.
 
virtual void Draw8BitPixels (int iX, int iY, uint_t uWidth, uint_t uHeight, uintptr_t uStride, const uint8_t *pPixels)
 Draw 8 bit data onto the software buffer.
 
virtual void Draw8BitPixelsMasked (int iX, int iY, uint_t uWidth, uint_t uHeight, uintptr_t uStride, const uint8_t *pPixels)
 Draw 8 bit data onto the software buffer.
 
virtual void DrawPixel (int iX, int iY, uint_t uColorIndex)
 Draw an 8 bit pixel onto the software buffer.
 
virtual void DrawRect (int iX, int iY, uint_t uWidth, uint_t uHeight, uint_t uColorIndex)
 Draw 8 bit color rectangle.
 
virtual void Clear (uint_t uColorIndex)
 Clear the entire screen to a solid color.
 
DisplayGetDisplay (void) const noexcept
 Get the pointer to the attached video display.
 
void SetDisplay (Display *pDisplay) noexcept
 Set the pointer to the attached display.
 
void * GetFrameBuffer (void) const noexcept
 Get the base pointer to the frame buffer.
 
void SetFrameBuffer (void *pFrameBuffer) noexcept
 Set the base pointer to the frame buffer.
 
uintptr_t GetStride (void) const noexcept
 Get the width in bytes of the display buffer scan line.
 
void SetStride (uintptr_t uStride) noexcept
 Set the width in bytes of the display buffer scan line.
 
uint_t GetWidth (void) const noexcept
 Get the width in pixels for the rendering context.
 
uint_t GetHeight (void) const noexcept
 Get the height in pixels for the rendering context.
 
uint_t GetDepth (void) const noexcept
 Get the depth in bits for this renderer.
 
uint_t GetFlags (void) const noexcept
 Get the state flags for the renderer.
 
const Rect_tGetClip (void) const noexcept
 Return the current clip rectangle.
 
void GetClip (Rect_t *pOutput) const
 Return the current clip rectangle.
 
void SetClip (const Rect_t *pInput)
 Set the current clip rectangle.
 
void SetClip (int iLeft, int iTop, int iRight, int iBottom)
 Set the current clip rectangle.
 
void DrawShape8Bit (int iX, int iY, RezFile *pRezFile, uint_t uRezNum)
 Draw a Shape8Bit_t image from a resource file.
 
void DrawShape8BitCentered (RezFile *pRezFile, uint_t uRezNum)
 Draw a Shape8Bit_t image from a resource file centered on the screen.
 
void DrawShape8BitMasked (int iX, int iY, RezFile *pRezFile, uint_t uRezNum)
 Draw a masked Shape8Bit_t image from a resource file.
 
void DrawShape8BitMaskedCentered (RezFile *pRezFile, uint_t uRezNum)
 Draw a masked Shape8Bit_t image from a resource file centered on the screen.
 

Static Public Attributes

static const uint_t ByteSquareTable [255+256]
 Table of squares from -255 to 255.
 
static const uint8_t RGB2ToRGB3Table [4] = {0x00, 0x02, 0x05, 0x07}
 Table to convert 2 bit color to 3 bit color.
 
static const uint8_t RGB2ToRGB4Table [4] = {0x00,0x05,0x0A,0x0F}
 Table to convert 2 bit color to 4 bit color.
 
static const uint8_t RGB2ToRGB5Table [4] = {0x00,0x0A,0x15,0x1F}
 Table to convert 2 bit color to 5 bit color.
 
static const uint8_t RGB2ToRGB6Table [4] = {0x00,0x15,0x2A,0x3F}
 Table to convert 2 bit color to 6 bit color.
 
static const uint8_t RGB2ToRGB8Table [4] = {0x00,0x55,0xAA,0xFF}
 Table to convert 2 bit color to 8 bit color.
 
static const uint8_t RGB3ToRGB4Table [8] = {0x00,0x02,0x04,0x06,0x09,0x0B,0x0D,0x0F}
 Table to convert 3 bit color to 4 bit color.
 
static const uint8_t RGB3ToRGB5Table [8] = {0x00,0x04,0x09,0x0D,0x12,0x16,0x1B,0x1F}
 Table to convert 3 bit color to 5 bit color.
 
static const uint8_t RGB3ToRGB6Table [8] = {0x00,0x09,0x12,0x1B,0x24,0x2D,0x36,0x3F}
 Table to convert 3 bit color to 6 bit color.
 
static const uint8_t RGB3ToRGB8Table [8] = {0x00,0x24,0x49,0x6D,0x92,0xB6,0xDB,0xFF}
 Table to convert 3 bit color to 8 bit color.
 
static const uint8_t RGB4ToRGB5Table [16]
 Table to convert 4 bit color to 5 bit color.
 
static const uint8_t RGB4ToRGB6Table [16]
 Table to convert 4 bit color to 6 bit color.
 
static const uint8_t RGB4ToRGB8Table [16]
 Table to convert 4 bit color to 8 bit color.
 
static const uint8_t RGB5ToRGB6Table [32]
 Table to convert 5 bit color to 6 bit color.
 
static const uint8_t RGB5ToRGB8Table [32]
 Table to convert 5 bit color to 8 bit color.
 
static const uint8_t RGB6ToRGB8Table [64]
 Table to convert 6 bit color to 8 bit color.
 

Protected Member Functions

virtual void UpdateClip (void)
 Update the clip rect to the operating system API.
 

Protected Attributes

Rect_t m_Clip
 Bounds rectangle for clipping.
 
Displaym_pDisplay
 Attached display.
 
void * m_pFrameBuffer
 Pointer to the software frame buffer (If supported)
 
uintptr_t m_uStride
 Width in BYTES of the display buffer (For software rendering)
 
uint_t m_uWidth
 Width in pixels of the display buffer.
 
uint_t m_uHeight
 Height in pixels of the display buffer.
 
uint_t m_uDepth
 Depth in bits of the display buffer.
 
uint_t m_uFlags
 Flags for describing available features.
 

Detailed Description

Base graphics renderer class.


The Display class manages a video display, however, the actual method of rendering graphics is handled by the Renderer class. This disconnect was needed since Display classes are tied to the underlying API and software rendering is not.

Renderer classes are directly tied to the API they use to inform the operating system (if any) on how to draw the requested graphics. Some examples are DirectX 9, DirectX 10, OpenGL and software rendering. APIs can be chained where a software rendering context sits on top of an OpenGL context so the final result is drawn using OpenGL while the application renders exclusively in software.

See also
Display, DisplayOpenGL, RendererOpenGL, DisplayOpenGLSoftware8 and RendererSoftware8

Constructor & Destructor Documentation

◆ Renderer()

Burger::Renderer::Renderer ( void )

Default constructor.


Initializes all of the shared variables

◆ ~Renderer()

Burger::Renderer::~Renderer ( )
virtual

Default destructor.


Clears out the shared variables and calls the chained function Renderer::Shutdown() to release all resources.

See also
Renderer::Shutdown()

Member Function Documentation

◆ BeginScene()

void Burger::Renderer::BeginScene ( void )
virtual

Start up a renderer for a frame.


Before a frame is started, the renderer may need to initialize internal states for the underlying API or hardware. This function will perform these actions

◆ Clear()

void Burger::Renderer::Clear ( uint_t uColorIndex)
virtual

Clear the entire screen to a solid color.


Using a color lookup index, get the color from the current palette and fill the screen with this color.

Parameters
uColorIndexColor to draw (Assumed to be an index to the active palette)

◆ Draw8BitPixels()

void Burger::Renderer::Draw8BitPixels ( int iX,
int iY,
uint_t uWidth,
uint_t uHeight,
uintptr_t uStride,
const uint8_t * pPixels )
virtual

Draw 8 bit data onto the software buffer.


Draw an 8 bit per pixel image to the screen clipped to the current clip rect.

Parameters
iXX coordinate to draw the image
iYY coordinate to draw the image
uWidthWidth of the image in bytes
uHeightHeight of the image in bytes
uStrideBytes per scan line of the image
pPixelsBase pointer to the bit map to draw
See also
Renderer::Draw8BitPixelsMasked()

Reimplemented in Burger::RendererSoftware8.

◆ Draw8BitPixelsMasked()

void Burger::Renderer::Draw8BitPixelsMasked ( int iX,
int iY,
uint_t uWidth,
uint_t uHeight,
uintptr_t uStride,
const uint8_t * pPixels )
virtual

Draw 8 bit data onto the software buffer.


Draw an 8 bit per pixel image to the screen without drawing any pixels whose value are zero. The image is clipped to the current clip rect.

Parameters
iXX coordinate to draw the image
iYY coordinate to draw the image
uWidthWidth of the image in bytes
uHeightHeight of the image in bytes
uStrideBytes per scan line of the image
pPixelsBase pointer to the bit map to draw
See also
Renderer::Draw8BitPixels()

Reimplemented in Burger::RendererSoftware8.

◆ DrawPixel()

void Burger::Renderer::DrawPixel ( int iX,
int iY,
uint_t uColorIndex )
virtual

Draw an 8 bit pixel onto the software buffer.


Draw an 8 bit pixel to the screen by taking the 8 bit index and looking it up in the current palette.

The pixel is clipped to the current clip rect.

Parameters
iXX coordinate to draw the pixel
iYY coordinate to draw the pixel
uColorIndexColor to draw (Assumed to be an index to the active palette)

Reimplemented in Burger::RendererSoftware8.

◆ DrawRect()

void Burger::Renderer::DrawRect ( int iX,
int iY,
uint_t uWidth,
uint_t uHeight,
uint_t uColorIndex )
virtual

Draw 8 bit color rectangle.


Draw a solid 8 bit colored rectangle to the screen. The pixel is clipped to the current clip rect.

Parameters
iXX coordinate of the leftmost line
iYY coordinate of the topmost line
uWidthWidth of the rectangle in pixels
uHeightHeight of the rectangle in pixels
uColorIndexColor to draw (Assumed to be an index to the active palette)

Reimplemented in Burger::RendererSoftware8.

◆ DrawShape8Bit()

void Burger::Renderer::DrawShape8Bit ( int iX,
int iY,
RezFile * pRezFile,
uint_t uRezNum )

Draw a Shape8Bit_t image from a resource file.


Given a Shape8Bit_t data image stored in a resource file, draw it to the screen

Parameters
iXX coordinate of the leftmost line
iYY coordinate of the topmost line
pRezFilePointer to a valid rez file
uRezNumResource number to the data chunk in the rez file

◆ DrawShape8BitCentered()

void Burger::Renderer::DrawShape8BitCentered ( RezFile * pRezFile,
uint_t uRezNum )

Draw a Shape8Bit_t image from a resource file centered on the screen.


Given a Shape8Bit_t data image stored in a resource file, draw it to the center of the screen

Parameters
pRezFilePointer to a valid rez file
uRezNumResource number to the data chunk in the rez file

◆ DrawShape8BitMasked()

void Burger::Renderer::DrawShape8BitMasked ( int iX,
int iY,
RezFile * pRezFile,
uint_t uRezNum )

Draw a masked Shape8Bit_t image from a resource file.


Given a masked Shape8Bit_t data image stored in a resource file, draw it to the screen

Parameters
iXX coordinate of the leftmost line
iYY coordinate of the topmost line
pRezFilePointer to a valid rez file
uRezNumResource number to the data chunk in the rez file

◆ DrawShape8BitMaskedCentered()

void Burger::Renderer::DrawShape8BitMaskedCentered ( RezFile * pRezFile,
uint_t uRezNum )

Draw a masked Shape8Bit_t image from a resource file centered on the screen.


Given a masked Shape8Bit_t data image stored in a resource file, draw it to the center of the screen

Parameters
pRezFilePointer to a valid rez file
uRezNumResource number to the data chunk in the rez file

◆ EndScene()

void Burger::Renderer::EndScene ( void )
virtual

Wrap up frame rendering.


After a frame is started, the renderer may need to wrap up some internal states and present cache or queued render events to the hardware. This function will perform these actions.

◆ GetClip() [1/2]

void Burger::Renderer::GetClip ( Rect_t * pOutput) const

Return the current clip rectangle.


Drawing is clipped to this bounds rectangle. On screen initialization, it's set to the bounds of the entire screen. At runtime, the bounds rectangle can be changed to all draw functions that allow clipping will draw to whatever rectangle is used at the time.

Do not modify the rectangle directly. Call SetClip() so that internal variables can be updated if needed when changing the clip rectangle.

Parameters
pOutputPointer to the Rect_t to store a copy of the current clip rectangle.
See also
SetClip(const Rect_t *) or SetClip(int,int,int,int)

◆ GetClip() [2/2]

const Rect_t * Burger::Renderer::GetClip ( void ) const
inlinenoexcept

Return the current clip rectangle.


Drawing is clipped to this bounds rectangle. On screen initialization, it's set to the bounds of the entire screen. At runtime, the bounds rectangle can be changed to all draw functions that allow clipping will draw to whatever rectangle is used at the time.

Do not modify the rectangle directly. Call SetClip() so that internal variables can be updated if needed when changing the clip rectangle.

Returns
Pointer to the read-only current clip rectangle.
See also
SetClip(const Rect_t *) or SetClip(int,int,int,int)

◆ GetDepth()

uint_t Burger::Renderer::GetDepth ( void ) const
inlinenoexcept

Get the depth in bits for this renderer.


Returns
Depth in bits for the renderer, usually 8, 15, 16, 24 or 32
See also
GetWidth(), GetHeight(), GetFlags() or GetStride()

◆ GetDisplay()

Display * Burger::Renderer::GetDisplay ( void ) const
inlinenoexcept

Get the pointer to the attached video display.


A renderer needs a connection to a video display to obtain context information of the display for some graphics APIs.

Note
This value can be NULL on if a Display was never attached
Returns
Pointer to the attached Display
See also
SetDisplay()

◆ GetFlags()

uint_t Burger::Renderer::GetFlags ( void ) const
inlinenoexcept

Get the state flags for the renderer.


Returns
Bit flags from the Display class determining modes available for rendering
See also
GetWidth(), GetHeight(), GetDepth() or GetStride()

◆ GetFrameBuffer()

void * Burger::Renderer::GetFrameBuffer ( void ) const
inlinenoexcept

Get the base pointer to the frame buffer.


When software rendering is requested, a frame buffer is allocated/created and a pointer and stride are created to allow software rendering functions to manipulate the buffer to update the game screen.

Note
This value can be NULL on renderers that don't use a frame buffer like OpenGL
Returns
Base pointer to a buffer that is Renderer::m_uStride * Renderer::m_uHeight in bytes
See also
SetFrameBuffer()

◆ GetHeight()

uint_t Burger::Renderer::GetHeight ( void ) const
inlinenoexcept

Get the height in pixels for the rendering context.


Note
This is not used for clipping, see SetClip(const Rect_t *) for clipping
Returns
Height in pixels of a single display buffer
See also
SetClip(const Rect_t *), GetWidth(), GetDepth(), GetFlags() or GetStride()

◆ GetStride()

uintptr_t Burger::Renderer::GetStride ( void ) const
inlinenoexcept

Get the width in bytes of the display buffer scan line.


Note
This value can be zero on renderers that don't use a frame buffer like OpenGL
Returns
Width in bytes of a single display buffer scan line
See also
SetStride()

◆ GetWidth()

uint_t Burger::Renderer::GetWidth ( void ) const
inlinenoexcept

Get the width in pixels for the rendering context.


Note
This is not used for clipping, see SetClip(const Rect_t *) for clipping
Returns
Width in pixels of a single display buffer scan line
See also
GetHeight(), GetDepth(), GetFlags() or GetStride()

◆ Init()

uint_t Burger::Renderer::Init ( uint_t uWidth,
uint_t uHeight,
uint_t uDepth,
uint_t uFlags )
virtual

Initialize a renderer.


This is called when a Display is given a Renderer class to set up internal variables describing the parameters of the current display

Parameters
uWidthWidth in pixels of the display to render to
uHeightHeight in pixels of the display to render to
uDepthDepth in bits of the display to render to
uFlagsBit flags to describe specific display features
Returns
Zero if no error occurred, non-zero if the renderer could not initialize

◆ SetClip() [1/2]

void Burger::Renderer::SetClip ( const Rect_t * pInput)

Set the current clip rectangle.


Drawing is clipped to this bounds rectangle. On screen initialization, it's set to the bounds of the entire screen. At runtime, the bounds rectangle can be changed to all draw functions that allow clipping will draw to whatever rectangle is used at the time.

Parameters
pInputPointer to the new clip rectangle
See also
GetClip() or SetClip(int,int,int,int)

◆ SetClip() [2/2]

void Burger::Renderer::SetClip ( int iLeft,
int iTop,
int iRight,
int iBottom )

Set the current clip rectangle.


Drawing is clipped to this bounds rectangle. On screen initialization, it's set to the bounds of the entire screen. At runtime, the bounds rectangle can be changed to all draw functions that allow clipping will draw to whatever rectangle is used at the time.

Parameters
iLeftLeft most point of the clip rectangle
iTopTop most point of the clip rectangle
iRightRight most point of the clip rectangle
iBottomBottom most point of the clip rectangle
See also
GetClip() or SetClip(const Rect_t *)

◆ SetDisplay()

void Burger::Renderer::SetDisplay ( Display * pDisplay)
inlinenoexcept

Set the pointer to the attached display.


A renderer needs a connection to a video display to obtain context information of the display for some graphics APIs.

Parameters
pDisplayPointer to a Display to attach to this Renderer or NULL to disconnect
See also
GetDisplay()

◆ SetFrameBuffer()

void Burger::Renderer::SetFrameBuffer ( void * pFrameBuffer)
inlinenoexcept

Set the base pointer to the frame buffer.


When software rendering is requested, a frame buffer is allocated/created and a pointer and stride are created to allow software rendering functions to manipulate the buffer to update the game screen.

Parameters
pFrameBufferBase pointer to a buffer that is Renderer::m_uStride * Renderer::m_uHeight in bytes
See also
GetFrameBuffer()

◆ SetStride()

void Burger::Renderer::SetStride ( uintptr_t uStride)
inlinenoexcept

Set the width in bytes of the display buffer scan line.


Note
This value is only used in software renderers
Parameters
uStrideWidth in bytes of a single display buffer scan line
See also
GetStride()

◆ Shutdown()

void Burger::Renderer::Shutdown ( void )
virtual

Shut down a renderer.


Release all resources allocated by the renderer

◆ UpdateClip()

void Burger::Renderer::UpdateClip ( void )
protectedvirtual

Update the clip rect to the operating system API.


Some render targets need to have the local clip rect passed to the operating system API, this function will perform this update.

Note
This is an internal function that is called whenever the clip rect is updated.
See also
SetClip(const Rect_t *) or SetClip(int,int,int,int)

Member Data Documentation

◆ ByteSquareTable

const uint_t Burger::Renderer::ByteSquareTable
static

Table of squares from -255 to 255.


Used for some routines to create a square to quickly generate a color match. Can be used by other routines for their own purposes. Only used for CPUs where integer multiplies are slow such as the PowerPC.

int Color = 0; // Value from -255 to 255
uint_t uSquare = Renderer::ByteSquareTable[Color+255]; // Square
unsigned int uint_t
Unsigned integer.
Definition burger.h:1524
static const uint_t ByteSquareTable[255+256]
Table of squares from -255 to 255.
Definition burger.h:57
See also
Burger::Palette::FindColorIndex()

◆ m_Clip

Rect_t Burger::Renderer::m_Clip
protected

Bounds rectangle for clipping.

◆ m_pDisplay

Display* Burger::Renderer::m_pDisplay
protected

Attached display.

◆ m_pFrameBuffer

void* Burger::Renderer::m_pFrameBuffer
protected

Pointer to the software frame buffer (If supported)

◆ m_uDepth

uint_t Burger::Renderer::m_uDepth
protected

Depth in bits of the display buffer.

◆ m_uFlags

uint_t Burger::Renderer::m_uFlags
protected

Flags for describing available features.

◆ m_uHeight

uint_t Burger::Renderer::m_uHeight
protected

Height in pixels of the display buffer.

◆ m_uStride

uintptr_t Burger::Renderer::m_uStride
protected

Width in BYTES of the display buffer (For software rendering)

◆ m_uWidth

uint_t Burger::Renderer::m_uWidth
protected

Width in pixels of the display buffer.

◆ RGB2ToRGB3Table

const uint8_t Burger::Renderer::RGB2ToRGB3Table = {0x00, 0x02, 0x05, 0x07}
static

Table to convert 2 bit color to 3 bit color.

◆ RGB2ToRGB4Table

const uint8_t Burger::Renderer::RGB2ToRGB4Table = {0x00,0x05,0x0A,0x0F}
static

Table to convert 2 bit color to 4 bit color.

◆ RGB2ToRGB5Table

const uint8_t Burger::Renderer::RGB2ToRGB5Table = {0x00,0x0A,0x15,0x1F}
static

Table to convert 2 bit color to 5 bit color.

◆ RGB2ToRGB6Table

const uint8_t Burger::Renderer::RGB2ToRGB6Table = {0x00,0x15,0x2A,0x3F}
static

Table to convert 2 bit color to 6 bit color.

◆ RGB2ToRGB8Table

const uint8_t Burger::Renderer::RGB2ToRGB8Table = {0x00,0x55,0xAA,0xFF}
static

Table to convert 2 bit color to 8 bit color.

◆ RGB3ToRGB4Table

const uint8_t Burger::Renderer::RGB3ToRGB4Table = {0x00,0x02,0x04,0x06,0x09,0x0B,0x0D,0x0F}
static

Table to convert 3 bit color to 4 bit color.

◆ RGB3ToRGB5Table

const uint8_t Burger::Renderer::RGB3ToRGB5Table = {0x00,0x04,0x09,0x0D,0x12,0x16,0x1B,0x1F}
static

Table to convert 3 bit color to 5 bit color.

◆ RGB3ToRGB6Table

const uint8_t Burger::Renderer::RGB3ToRGB6Table = {0x00,0x09,0x12,0x1B,0x24,0x2D,0x36,0x3F}
static

Table to convert 3 bit color to 6 bit color.

◆ RGB3ToRGB8Table

const uint8_t Burger::Renderer::RGB3ToRGB8Table = {0x00,0x24,0x49,0x6D,0x92,0xB6,0xDB,0xFF}
static

Table to convert 3 bit color to 8 bit color.

◆ RGB4ToRGB5Table

const uint8_t Burger::Renderer::RGB4ToRGB5Table
static
Initial value:
= {
0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,
0x11,0x13,0x15,0x17,0x19,0x1B,0x1D,0x1F}

Table to convert 4 bit color to 5 bit color.

◆ RGB4ToRGB6Table

const uint8_t Burger::Renderer::RGB4ToRGB6Table
static
Initial value:
= {
0x00,0x04,0x08,0x0D,0x11,0x15,0x19,0x1D,
0x22,0x26,0x2A,0x2E,0x32,0x37,0x3B,0x3F}

Table to convert 4 bit color to 6 bit color.

◆ RGB4ToRGB8Table

const uint8_t Burger::Renderer::RGB4ToRGB8Table
static
Initial value:
= {
0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,
0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF}

Table to convert 4 bit color to 8 bit color.

◆ RGB5ToRGB6Table

const uint8_t Burger::Renderer::RGB5ToRGB6Table
static
Initial value:
= {
0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,
0x10,0x12,0x14,0x16,0x18,0x1A,0x1C,0x1E,
0x21,0x23,0x25,0x27,0x29,0x2B,0x2D,0x2F,
0x31,0x33,0x35,0x37,0x39,0x3B,0x3D,0x3F}

Table to convert 5 bit color to 6 bit color.

◆ RGB5ToRGB8Table

const uint8_t Burger::Renderer::RGB5ToRGB8Table
static
Initial value:
= {
0x00,0x08,0x10,0x18,0x21,0x29,0x31,0x39,
0x42,0x4A,0x52,0x5A,0x63,0x6B,0x73,0x7B,
0x84,0x8C,0x94,0x9C,0xA5,0xAD,0xB5,0xBD,
0xC6,0xCE,0xD6,0xDE,0xE7,0xEF,0xF7,0xFF}

Table to convert 5 bit color to 8 bit color.


Scale 0-31 into 0-255 in a linear fashion. The formula is Result = ((i*0xFFFF)/31)>>8

See also
Burger::Palette::FromRGB15()

◆ RGB6ToRGB8Table

const uint8_t Burger::Renderer::RGB6ToRGB8Table
static
Initial value:
= {
0x00,0x04,0x08,0x0C,0x10,0x14,0x18,0x1C,
0x20,0x24,0x28,0x2C,0x30,0x34,0x38,0x3C,
0x41,0x45,0x49,0x4D,0x51,0x55,0x59,0x5D,
0x61,0x65,0x69,0x6D,0x71,0x75,0x79,0x7D,
0x82,0x86,0x8A,0x8E,0x92,0x96,0x9A,0x9E,
0xA2,0xA6,0xAA,0xAE,0xB2,0xB6,0xBA,0xBE,
0xC3,0xC7,0xCB,0xCF,0xD3,0xD7,0xDB,0xDF,
0xE3,0xE7,0xEB,0xEF,0xF3,0xF7,0xFB,0xFF}

Table to convert 6 bit color to 8 bit color.


Scale 0-63 into 0-255 in a linear fashion. The formula is Result = ((i*0xFFFF)/63)>>8

See also
Burger::Palette::RGB16ToRGB24()