class::fmt::Bmp

class fmt::Bmp
  : public fs::File

Summary

Bmp(

const arg::SourceFilePath name
)

Bmp()

u16 bits_per_pixel() const

unsigned int calc_row_size() const

int create(

const arg::DestinationFilePath name,
const arg::Width width,
const arg::Height height,
const arg::PlaneCount planes,
const arg::BitsPerPixel bits_per_pixel
)

s32 height() const

int open(

const arg::FilePath name,
const fs::OpenFlags & flags
)

int open_readonly(

const arg::SourceFilePath name
)

int open_readwrite(

const arg::SourceFilePath name
)

u16 planes() const

int read_pixel(

u8 * pixel,
u32 pixel_size,
bool mono,
u8 thres
)

void rewind()

int seek_row(

s32 y
) const

s32 width() const

static int create_appfs(

const var::ConstString & name,
s32 width,
s32 height,
u16 planes,
u16 bits_per_pixel,
char * img,
u32 nbyte
)

Members

Bmp(

const arg::SourceFilePath name
)

Constructs a new bitmap object and opens the bitmap as a read-only file.


Bmp()

Constructs an empty bitmap object.


u16 bits_per_pixel() const

Returns the bitmap bits per pixel (after bitmap has been opened).


unsigned int calc_row_size() const

Calculates the bytes needed to store one row of data (after bitmap has been opened).


int create(

const arg::DestinationFilePath name,
const arg::Width width,
const arg::Height height,
const arg::PlaneCount planes,
const arg::BitsPerPixel bits_per_pixel
)

Creates a new bitmap using the specified parameters.


s32 height() const

Returns the bitmap height (after bitmap has been opened).


int open(

const arg::FilePath name,
const fs::OpenFlags & flags
)

Opens the specified bitmap with the specified access (e.g., Bmp::READONLY).


int open_readonly(

const arg::SourceFilePath name
)

Opens the specified bitmap as readonly.


int open_readwrite(

const arg::SourceFilePath name
)

Opens the specified bitmap as read write.


u16 planes() const

Returns the bitmap planes (after bitmap has been opened).


int read_pixel(

u8 * pixel,
u32 pixel_size,
bool mono,
u8 thres
)

Reads a pixel from the bitmap (optionally convert to a mono value).

Parameters

  • pixel Data pointing to destination

  • pixel_size in bytes

  • mono true to convert to a mono pixel

  • thres threshold brightness for a mono pixel to be on


void rewind()

Moves file pointer to the start of the bitmap data.


int seek_row(

s32 y
) const

Seeks the file to the data at the specified row.


s32 width() const

Returns the bitmap width (after bitmap has been opened).


static int create_appfs(

const var::ConstString & name,
s32 width,
s32 height,
u16 planes,
u16 bits_per_pixel,
char * img,
u32 nbyte
)

Creates a new bitmap and save it to the /app filesystem (flash memory).


X

Thanks for Coming!

Subscribe to news and updates