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 | List of all members
Burger::RendererSoftware8 Class Reference

8 bit paletted software renderer More...

Inheritance diagram for Burger::RendererSoftware8:
Inheritance graph
[legend]
Collaboration diagram for Burger::RendererSoftware8:
Collaboration graph
[legend]

Public Member Functions

 RendererSoftware8 (void) noexcept
 Default constructor.
 
virtual void Draw8BitPixels (int iX, int iY, uint_t uWidth, uint_t uHeight, uintptr_t uStride, const uint8_t *pPixels) noexcept final
 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) noexcept final
 Draw 8 bit data onto the software buffer.
 
virtual void DrawPixel (int iX, int iY, uint_t uColorIndex) noexcept final
 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) noexcept final
 Draw 8 bit color rectangle.
 
- Public Member Functions inherited from Burger::Renderer
 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 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.
 
voidGetFrameBuffer (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.
 

Additional Inherited Members

- Static Public Attributes inherited from Burger::Renderer
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 inherited from Burger::Renderer
virtual void UpdateClip (void)
 Update the clip rect to the operating system API.
 
- Protected Attributes inherited from Burger::Renderer
Rect_t m_Clip
 Bounds rectangle for clipping.
 
Displaym_pDisplay
 Attached display.
 
voidm_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

8 bit paletted software renderer


This class contains functions to draw pixels in an 8 bit paletted buffer. It is 100% software driven, no hardware assist is performed at all

See also
Renderer, RendererOpenGL and RendererSoftware16

Constructor & Destructor Documentation

◆ RendererSoftware8()

Burger::RendererSoftware8::RendererSoftware8 ( void )
noexcept

Default constructor.


Initializes all of the shared variables

Member Function Documentation

◆ Draw8BitPixels()

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

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 from Burger::Renderer.

◆ Draw8BitPixelsMasked()

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

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 from Burger::Renderer.

◆ DrawPixel()

void Burger::RendererSoftware8::DrawPixel ( int iX,
int iY,
uint_t uColorIndex )
finalvirtualnoexcept

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 from Burger::Renderer.

◆ DrawRect()

void Burger::RendererSoftware8::DrawRect ( int iX,
int iY,
uint_t uWidth,
uint_t uHeight,
uint_t uColorIndex )
finalvirtualnoexcept

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 from Burger::Renderer.