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

a photo of a single char from a font More...

#include <graphics.h>

Inheritance diagram for bmptk::graphics::char_photo:
bmptk::graphics::image_pixels bmptk::graphics::image

Public Member Functions

 char_photo (const font &f, char c, const color fg=color::black(), const color bg=color::transparent())
 instantiate a char_photo, specfy font, char, forgeground and background
 
color checked_read (const vector p) const
 read one pixel, return color
 
- 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
 

Public Attributes

const fontf
 the font
 
const char c
 the character
 
const color fg
 the foreground colcor (default: black)
 
const color bg
 the background colcor (default: transparent)
 

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 photo of a single char from a font

A char photo is the photo of one character from a font. It is a photo, so it can be drawn. Temporary char_photo objects are used by text to draw a text in a specified front.

Unless you want to drawn characters in a way that is not provided by text it is unlikely that you will ever use this class.

A char_photo contains a reference to its font object. Using a char_photo object when the font object is no longer available will cause unpredictable results. When used with an inline_font, which is a global const (readonly) object, so it can not become unavailable

Definition at line 1712 of file graphics.h.


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