Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
bmptk::graphics::inline_bw_photo Class Reference

a black-and-wite photo stored as inline constant data (in ROM) More...

#include <graphics.h>

Inheritance diagram for bmptk::graphics::inline_bw_photo:
bmptk::graphics::image_pixels bmptk::graphics::image bmptk::graphics::inline_font

Public Member Functions

bool bool_read (const vector p) const
 read one pixel, return bool
 
 inline_bw_photo (const vector size, const unsigned char *data)
 create an inline_bw_photo object
 
- Public Member Functions inherited from bmptk::graphics::image_pixels
 image_pixels (vector size)
 constructor, specify the size
 
vector size_get () const
 get the size of the picture
 
bool is_valid (const vector p) const
 report whether p is within the image
 
virtual void draw (frame &frame, const vector position=vector::origin()) const
 
color read (const vector p) const
 read one pixel, address specified by vector
 
- Public Member Functions inherited from bmptk::graphics::image
 image ()
 default constructor
 

Additional Inherited Members

- Protected Attributes inherited from bmptk::graphics::image_pixels
vector size
 the size of the (rectangular) block occupied by the objecy
 

Detailed Description

a black-and-wite photo stored as inline constant data (in ROM)

The class inline_bw_photo is a concrete child of the photo class. It stores the colors of the pixels in an array of constant data. Inline_wb_photo uses 1 bit per pixel (inline_rgb_photo uses 3 bytes per pixel). The inline.py tool can be used to convert a .jpg or .bmp file into the .h and .cpp file for an inline_bw_photo. This is likely to be the only way you will instantiate this class.

Each pixel can either be on or off. An 'on' pixel returns the fg colcor (default: color::black), an off pixel returns the bg colcor (deafult: color::white).

The inline_bw_photo class can be used instead of inline_rgb_photo to store a picture in a more compact form. It is also used by the library to store fonts.

Definition at line 1600 of file graphics.h.

Constructor & Destructor Documentation

bmptk::graphics::inline_bw_photo::inline_bw_photo ( const vector  size,
const unsigned char *  data 
)
inline

create an inline_bw_photo object

Parameters
sizethe size of the photo
datathe pixel data The data contains one bit per pixel, x address varies fastest. No filling except (when needed) the last byte. The bits within a byte are stored LSB first.

Definition at line 1614 of file graphics.h.


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