TinyGPU
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
BMPExporter< RGB_T > Class Template Reference

Writes TinyGPU surfaces as uncompressed 24-bit BMP data. More...

#include <BMPExporter.h>

Collaboration diagram for BMPExporter< RGB_T >:
Collaboration graph
[legend]

Public Member Functions

 BMPExporter (const ISurface< RGB_T > &surface)
 
bool save (Print &out) const
 Writes the target surface as BMP data to the provided Print output.
 

Static Protected Member Functions

static uint32_t bmpRowStride (size_t width)
 
static bool writeFileHeader (Print &out, uint32_t fileSize, uint32_t pixelOffset)
 
static bool writeInfoHeader (Print &out, size_t width, size_t height, uint32_t imageSize)
 
static bool writeU16 (Print &out, uint16_t value)
 
static bool writeU32 (Print &out, uint32_t value)
 
static bool writeBytes (Print &out, const uint8_t *data, size_t length)
 

Protected Attributes

const ISurface< RGB_T > & surface_
 

Detailed Description

template<typename RGB_T = RGB565>
class tinygpu::BMPExporter< RGB_T >

Writes TinyGPU surfaces as uncompressed 24-bit BMP data.

The exporter serializes any ISurface-compatible surface to a standard BMP stream using bottom-up BGR pixel rows padded to 4-byte boundaries.

Constructor & Destructor Documentation

◆ BMPExporter()

BMPExporter ( const ISurface< RGB_T > &  surface)
inline

Member Function Documentation

◆ bmpRowStride()

static uint32_t bmpRowStride ( size_t  width)
inlinestaticprotected

◆ save()

bool save ( Print &  out) const
inline

Writes the target surface as BMP data to the provided Print output.

◆ writeBytes()

static bool writeBytes ( Print &  out,
const uint8_t *  data,
size_t  length 
)
inlinestaticprotected

◆ writeFileHeader()

static bool writeFileHeader ( Print &  out,
uint32_t  fileSize,
uint32_t  pixelOffset 
)
inlinestaticprotected

◆ writeInfoHeader()

static bool writeInfoHeader ( Print &  out,
size_t  width,
size_t  height,
uint32_t  imageSize 
)
inlinestaticprotected

◆ writeU16()

static bool writeU16 ( Print &  out,
uint16_t  value 
)
inlinestaticprotected

◆ writeU32()

static bool writeU32 ( Print &  out,
uint32_t  value 
)
inlinestaticprotected

Member Data Documentation

◆ surface_

const ISurface<RGB_T>& surface_
protected

The documentation for this class was generated from the following file: