DUDS
Distributed Update of Data from Something
duds::ui::graphics Namespace Reference

General graphics related code. More...

Classes

class  BppFont
 Renders strings using a font made of BppImage objects for glyphs. More...
 
class  BppFontPool
 Handles a pool of fonts and their associated string caches to make it easier to use fonts across various parts of an application. More...
 
class  BppImage
 An image that uses a single bit to represent the state of each pixel; a black or white picture. More...
 
class  BppImageArchive
 An archive of BppImage objects keyed by a string name. More...
 
class  BppImageArchiveFile
 Provides an input iterator to a sequence of named bit-per-pixel images read from an archive file. More...
 
class  BppImageArchiveSequence
 Provides an input iterator to a sequence of named bit-per-pixel images read from an input stream. More...
 
class  BppPositionIndicator
 A generalized position indicator that can be used to render a simple scroll bar, progress bar, and other similar things. More...
 
struct  BppPositionIndicatorDimensionTooSmall
 An attempt was made to set the dimensions to a size that is too small to fit the position mark with enough room to allow it to move. More...
 
struct  BppPositionIndicatorError
 The base class for errors from the BppPositionIndicator. More...
 
struct  BppPositionIndicatorMarkerSizeError
 An attempt was made to set a minimum marker size that is less than one, or that is too large to fit within the current dimensions. More...
 
struct  BppPositionIndicatorRangeTooSmall
 An attempt was made to set the range to zero. More...
 
class  BppStringCache
 Maintains a cache for rendered strings that helps avoid re-rendering strings that may need to be shown many times. More...
 
class  EmptyPanel
 An empty panel; useful for taking up space according to a layout configuration. More...
 
struct  FontNotFoundError
 A specified font is not present in the font pool. More...
 
struct  FontStringCacheMismatchError
 A given string cache does not correspond to the given font. More...
 
struct  GlyphNotFoundError
 A glyph required to render a string is not availble in the font. More...
 
struct  GridLayoutConfig
 Informs a PriorityGridLayout object where to place and how large to make Panel objects. More...
 
struct  GridLocation
 The location of a panel in a PriorityGridLayout. More...
 
struct  GridSizeStep
 A single size-step used by a PriorityGridLayout to place a Panel. More...
 
struct  ImageArchiveError
 The base class for errors related to the use of image archives. More...
 
struct  ImageArchivePastEndError
 An attempt was made to advance past the end of a archive stream. More...
 
struct  ImageArchiveStreamError
 The base class for errors resulting from the attempt to read an image archive stream or file. More...
 
struct  ImageArchiveStreamTruncatedError
 The stream appears to end early. More...
 
struct  ImageArchiveUnsupportedVersionError
 The archive is in an unsupported version of the format. More...
 
struct  ImageBoundsError
 A problem with image bounds, such as the use of a location beyond the image's dimensions. More...
 
struct  ImageDimensions
 Stores the dimensions of an image. More...
 
struct  ImageError
 The base class for errors related to the use of images. More...
 
struct  ImageIteratorEndError
 The Pixel or ConstPixel iterator object was dereferenced when in at the end. More...
 
struct  ImageLocation
 Stores a location within an image. More...
 
struct  ImageNotArchiveStreamError
 The stream appears to not be an image archive. More...
 
struct  ImageNotFoundError
 An image was requested that the archive does not contain. More...
 
struct  ImageTruncatedError
 Data with an image to parse was too short to hold the image. More...
 
struct  ImageZeroSizeError
 Indicates the image has zero size when an operation requires some image data. More...
 
struct  LayoutError
 The base class for errors from layout managers. More...
 
struct  LayoutPriorityInvalidError
 An attempt was made to add a panel using an invalid priority value. More...
 
struct  LineDimensions
 Information on a line. More...
 
class  Panel
 Represents something being drawn in a rectangular region defined by a PriorityGridLayout object. More...
 
struct  PanelAlreadyAddedError
 A panel that can only be used in one layout was added to another layout. More...
 
struct  PanelImageTooLargeError
 Thrown by Panels during rendering if the panel discovers the size required for its image will not fit into the layout. More...
 
struct  PanelMargins
 Defines the size of a margin bordering a panel; the size of the margin is included in computations for centering and edge justifications. More...
 
struct  PanelNotAddedError
 An operation that requires a panel to be added to a layout was attempted on a panel that is not in any layout. More...
 
struct  PanelNotFoundError
 A panel identified by priority key could not be found. More...
 
class  PriorityGridLayout
 A way to place Panel objects dynamically with a priority mechanism to allow panels to be resized and moved more automatically to support panels changing in importance on a user interface. More...
 
class  SingleLayoutPanel
 A variation of a Panel that can only be added to one layout at a time, and that keeps track of its own priority and the layout object. More...
 
struct  StringCacheZeroSize
 The maximum size of a BppStringCache is zero. More...
 

Typedefs

typedef std::shared_ptr< BppFontBppFontSptr
 
typedef std::shared_ptr< BppImageArchiveBppImageArchiveSptr
 
typedef std::weak_ptr< BppImageArchiveBppImageArchiveWptr
 
typedef std::shared_ptr< BppImageBppImageSptr
 
typedef std::weak_ptr< BppImageBppImageWptr
 
typedef std::shared_ptr< BppStringCacheBppStringCacheSptr
 A std::shared_ptr to a BppStringCache object. More...
 
typedef boost::error_info< struct Info_Character, char32_t > Character
 A character, like one requested for rendering in a specific font. More...
 
typedef std::shared_ptr< const BppImageConstBppImageSptr
 
typedef std::weak_ptr< const BppImageConstBppImageWptr
 
typedef std::vector< LineDimensionsDimVec
 Information on each line of text to render. More...
 
typedef boost::error_info< struct Info_FontName, std::string > FontName
 The name of the font and is not present in the font pool. More...
 
typedef std::vector< GridSizeStepGridSizeSteps
 A vector of size-step information for a Panel in a PriorityGridLayout. More...
 
typedef boost::error_info< struct Info_ImageArcFileName, std::string > ImageArchiveFileName
 The name of the image archive file involved in an ImageArchiveStreamError. More...
 
typedef boost::error_info< struct Info_ArchiveImageName, std::string > ImageArchiveImageName
 The name of the image involved in an ImageArchiveError. More...
 
typedef boost::error_info< struct Info_ImageArcName, std::uint32_t > ImageArchiveVersion
 The name of the image involved in an ImageArchiveError. More...
 
typedef boost::error_info< struct Info_ImageDimensions, ImageDimensionsImageErrorDimensions
 Image dimensions relevant to the error. More...
 
typedef boost::error_info< struct Info_ImageLocation, ImageLocationImageErrorLocation
 An image location relevant to the error. More...
 
typedef boost::error_info< struct Info_ImageDimensions, ImageDimensionsImageErrorSourceDimensions
 Image dimensions for a source image relevant to the error. More...
 
typedef boost::error_info< struct Info_FrameDimensions, ImageDimensionsImageErrorTargetDimensions
 Image dimensions for a target image relevant to the error. More...
 
typedef std::vector< const BppImage * > ImageVec
 Used to hold all the glyphs needed to render a string. More...
 
typedef boost::error_info< struct Info_IndicatorRange, std::uint16_t > IndicatorRange
 Error attribute with the range of positions for a position indicator. More...
 
typedef boost::error_info< struct Info_PanelPriority, int > PanelPriority
 Identifies a Panel object's layout priority in errors. More...
 
typedef boost::error_info< struct Info_PanelSizeStep, int > PanelSizeStep
 Identifies a Panel's selected size-step in errors. More...
 
typedef std::shared_ptr< PanelPanelSptr
 A shared pointer to a Panel. More...
 
typedef boost::error_info< struct Info_IndicatorMinimumSize, std::uint16_t > PositionMarkMinimumSize
 Error attribute with the length of the position mark in pixels. More...
 
typedef boost::error_info< struct Info_String, std::string > String
 A string, like one requested for rendering in a specific font. More...
 

Functions

ImageDimensions MaxExtent (const BppImage *i0, const BppImage *i1)
 Returns the maximum extent of the dimensions of two bit-per-pixel images. More...
 
ImageDimensions MaxExtent (const BppImage &i0, const BppImage &i1)
 Returns the maximum extent of the dimensions of two bit-per-pixel images. More...
 
ImageDimensions MaxExtent (const ConstBppImageSptr &i0, const ConstBppImageSptr &i1)
 Returns the maximum extent of the dimensions of two bit-per-pixel images. More...
 
static void opand (BppImage::PixelBlock *dest, const BppImage::PixelBlock &src, const BppImage::PixelBlock &mask)
 
static bool opandbit (bool dest, bool src)
 
std::ostream & operator<< (std::ostream &os, const ImageLocation &il)
 Writes an ImageLocation object to a stream in human readable form. More...
 
std::ostream & operator<< (std::ostream &os, const ImageDimensions &id)
 Writes an ImageDimensions object to a stream in human readable form. More...
 
static void opnot (BppImage::PixelBlock *dest, const BppImage::PixelBlock &src, const BppImage::PixelBlock &mask)
 
static bool opnotbit (bool dest, bool src)
 
static void opor (BppImage::PixelBlock *dest, const BppImage::PixelBlock &src, const BppImage::PixelBlock &mask)
 
static bool oporbit (bool dest, bool src)
 
static void opset (BppImage::PixelBlock *dest, const BppImage::PixelBlock &src, const BppImage::PixelBlock &mask)
 
static bool opsetbit (bool dest, bool src)
 
static void opxor (BppImage::PixelBlock *dest, const BppImage::PixelBlock &src, const BppImage::PixelBlock &mask)
 
static bool opxorbit (bool dest, bool src)
 
void swap (ImageLocation &l0, ImageLocation &l1)
 Swaps the values of two ImageLocation objects. More...
 
void swap (ImageDimensions &d0, ImageDimensions &d1)
 Swaps the values of two ImageDimensions objects. More...
 
void swap (BppImage &bi0, BppImage &bi1)
 Support swap operations with the C++ standard library and BppImage objects. More...
 

Variables

static std::wstring_convert< std::codecvt_utf8< char32_t >, char32_t > conv
 String converter; UTF-8 to/from UTF-32. More...
 

Detailed Description

General graphics related code.

The graphics support is in the user interface namespace because the purpose of the graphics is for use on user interfaces.

Typedef Documentation

◆ BppFontSptr

typedef std::shared_ptr<BppFont> duds::ui::graphics::BppFontSptr

Definition at line 263 of file BppFont.hpp.

◆ BppImageArchiveSptr

Definition at line 160 of file BppImageArchive.hpp.

◆ BppImageArchiveWptr

Definition at line 161 of file BppImageArchive.hpp.

◆ BppImageSptr

typedef std::shared_ptr<BppImage> duds::ui::graphics::BppImageSptr

Definition at line 1777 of file BppImage.hpp.

◆ BppImageWptr

Definition at line 1779 of file BppImage.hpp.

◆ BppStringCacheSptr

A std::shared_ptr to a BppStringCache object.

Definition at line 328 of file BppStringCache.hpp.

◆ Character

typedef boost::error_info<struct Info_Character, char32_t> duds::ui::graphics::Character

A character, like one requested for rendering in a specific font.

Definition at line 117 of file BppImageErrors.hpp.

◆ ConstBppImageSptr

typedef std::shared_ptr<const BppImage> duds::ui::graphics::ConstBppImageSptr

Definition at line 1778 of file BppImage.hpp.

◆ ConstBppImageWptr

typedef std::weak_ptr<const BppImage> duds::ui::graphics::ConstBppImageWptr

Definition at line 1780 of file BppImage.hpp.

◆ DimVec

Information on each line of text to render.

Definition at line 160 of file BppFont.cpp.

◆ FontName

typedef boost::error_info<struct Info_FontName, std::string> duds::ui::graphics::FontName

The name of the font and is not present in the font pool.

Definition at line 138 of file BppImageErrors.hpp.

◆ GridSizeSteps

A vector of size-step information for a Panel in a PriorityGridLayout.

Definition at line 18 of file GridLayoutConfig.hpp.

◆ ImageArchiveFileName

typedef boost::error_info<struct Info_ImageArcFileName, std::string> duds::ui::graphics::ImageArchiveFileName

The name of the image archive file involved in an ImageArchiveStreamError.

This is only added if a file name is known; it is not added if a std::istream is used.

Definition at line 96 of file BppImageErrors.hpp.

◆ ImageArchiveImageName

typedef boost::error_info<struct Info_ArchiveImageName, std::string> duds::ui::graphics::ImageArchiveImageName

The name of the image involved in an ImageArchiveError.

Definition at line 88 of file BppImageErrors.hpp.

◆ ImageArchiveVersion

typedef boost::error_info<struct Info_ImageArcName, std::uint32_t> duds::ui::graphics::ImageArchiveVersion

The name of the image involved in an ImageArchiveError.

Definition at line 102 of file BppImageErrors.hpp.

◆ ImageErrorDimensions

typedef boost::error_info<struct Info_ImageDimensions, ImageDimensions> duds::ui::graphics::ImageErrorDimensions

Image dimensions relevant to the error.

Definition at line 293 of file BppImage.hpp.

◆ ImageErrorLocation

typedef boost::error_info<struct Info_ImageLocation, ImageLocation> duds::ui::graphics::ImageErrorLocation

An image location relevant to the error.

Definition at line 288 of file BppImage.hpp.

◆ ImageErrorSourceDimensions

typedef boost::error_info<struct Info_ImageDimensions, ImageDimensions> duds::ui::graphics::ImageErrorSourceDimensions

Image dimensions for a source image relevant to the error.

Definition at line 298 of file BppImage.hpp.

◆ ImageErrorTargetDimensions

typedef boost::error_info<struct Info_FrameDimensions, ImageDimensions> duds::ui::graphics::ImageErrorTargetDimensions

Image dimensions for a target image relevant to the error.

Definition at line 303 of file BppImage.hpp.

◆ ImageVec

typedef std::vector<const BppImage *> duds::ui::graphics::ImageVec

Used to hold all the glyphs needed to render a string.

Definition at line 137 of file BppFont.cpp.

◆ IndicatorRange

typedef boost::error_info<struct Info_IndicatorRange, std::uint16_t> duds::ui::graphics::IndicatorRange

Error attribute with the range of positions for a position indicator.

Definition at line 50 of file BppPositionIndicator.hpp.

◆ PanelPriority

typedef boost::error_info<struct Info_PanelPriority, int> duds::ui::graphics::PanelPriority

Identifies a Panel object's layout priority in errors.

Definition at line 54 of file LayoutErrors.hpp.

◆ PanelSizeStep

typedef boost::error_info<struct Info_PanelSizeStep, int> duds::ui::graphics::PanelSizeStep

Identifies a Panel's selected size-step in errors.

Definition at line 59 of file LayoutErrors.hpp.

◆ PanelSptr

typedef std::shared_ptr<Panel> duds::ui::graphics::PanelSptr

A shared pointer to a Panel.

Definition at line 107 of file Panel.hpp.

◆ PositionMarkMinimumSize

typedef boost::error_info<struct Info_IndicatorMinimumSize, std::uint16_t> duds::ui::graphics::PositionMarkMinimumSize

Error attribute with the length of the position mark in pixels.

Definition at line 44 of file BppPositionIndicator.hpp.

◆ String

typedef boost::error_info<struct Info_String, std::string> duds::ui::graphics::String

A string, like one requested for rendering in a specific font.

Definition at line 112 of file BppImageErrors.hpp.

Function Documentation

◆ MaxExtent() [1/3]

ImageDimensions duds::ui::graphics::MaxExtent ( const BppImage i0,
const BppImage i1 
)

Returns the maximum extent of the dimensions of two bit-per-pixel images.

The images do not have to exist; non-existant images are handled as having zero size.

Parameters
i0A bit-per-pixel image object. A nullptr indicates the image does not exist.
i1A bit-per-pixel image object. A nullptr indicates the image does not exist.

Definition at line 797 of file BppImage.cpp.

Referenced by MaxExtent(), and duds::ui::menu::renderers::BppMenuRenderer::recalculateDimensions().

◆ MaxExtent() [2/3]

ImageDimensions duds::ui::graphics::MaxExtent ( const BppImage i0,
const BppImage i1 
)
inline

Returns the maximum extent of the dimensions of two bit-per-pixel images.

Parameters
i0A bit-per-pixel image object.
i1A bit-per-pixel image object.

Definition at line 1798 of file BppImage.hpp.

◆ MaxExtent() [3/3]

ImageDimensions duds::ui::graphics::MaxExtent ( const ConstBppImageSptr i0,
const ConstBppImageSptr i1 
)
inline

Returns the maximum extent of the dimensions of two bit-per-pixel images.

The images do not have to exist; non-existant images are handled as having zero size.

Parameters
i0A shared pointer to a bit-per-pixel image object.
i1A shared pointer to a bit-per-pixel image object.

Definition at line 1812 of file BppImage.hpp.

◆ opand()

static void duds::ui::graphics::opand ( BppImage::PixelBlock dest,
const BppImage::PixelBlock src,
const BppImage::PixelBlock mask 
)
static

Definition at line 397 of file BppImage.cpp.

Referenced by opxor().

◆ opandbit()

static bool duds::ui::graphics::opandbit ( bool  dest,
bool  src 
)
static

Definition at line 361 of file BppImage.cpp.

Referenced by opxorbit().

◆ operator<<() [1/2]

std::ostream & duds::ui::graphics::operator<< ( std::ostream &  os,
const ImageLocation il 
)

Writes an ImageLocation object to a stream in human readable form.

Definition at line 17 of file BppImage.cpp.

Referenced by duds::ui::graphics::ImageDimensions::clip(), and duds::ui::graphics::ImageLocation::swappedAxes().

◆ operator<<() [2/2]

std::ostream & duds::ui::graphics::operator<< ( std::ostream &  os,
const ImageDimensions id 
)

Writes an ImageDimensions object to a stream in human readable form.

Definition at line 22 of file BppImage.cpp.

◆ opnot()

static void duds::ui::graphics::opnot ( BppImage::PixelBlock dest,
const BppImage::PixelBlock src,
const BppImage::PixelBlock mask 
)
static

Definition at line 389 of file BppImage.cpp.

Referenced by opxor().

◆ opnotbit()

static bool duds::ui::graphics::opnotbit ( bool  dest,
bool  src 
)
static

Definition at line 357 of file BppImage.cpp.

Referenced by opxorbit().

◆ opor()

static void duds::ui::graphics::opor ( BppImage::PixelBlock dest,
const BppImage::PixelBlock src,
const BppImage::PixelBlock mask 
)
static

Definition at line 405 of file BppImage.cpp.

Referenced by opxor().

◆ oporbit()

static bool duds::ui::graphics::oporbit ( bool  dest,
bool  src 
)
static

Definition at line 365 of file BppImage.cpp.

Referenced by opxorbit().

◆ opset()

static void duds::ui::graphics::opset ( BppImage::PixelBlock dest,
const BppImage::PixelBlock src,
const BppImage::PixelBlock mask 
)
static

Definition at line 381 of file BppImage.cpp.

Referenced by opxor().

◆ opsetbit()

static bool duds::ui::graphics::opsetbit ( bool  dest,
bool  src 
)
static

Definition at line 353 of file BppImage.cpp.

Referenced by opxorbit().

◆ opxor()

static void duds::ui::graphics::opxor ( BppImage::PixelBlock dest,
const BppImage::PixelBlock src,
const BppImage::PixelBlock mask 
)
static

Definition at line 413 of file BppImage.cpp.

◆ opxorbit()

static bool duds::ui::graphics::opxorbit ( bool  dest,
bool  src 
)
static

Definition at line 369 of file BppImage.cpp.

◆ swap() [1/3]

void duds::ui::graphics::swap ( ImageLocation l0,
ImageLocation l1 
)
inline

Swaps the values of two ImageLocation objects.

Definition at line 116 of file BppImage.hpp.

Referenced by duds::ui::graphics::BppImage::make().

◆ swap() [2/3]

void duds::ui::graphics::swap ( ImageDimensions d0,
ImageDimensions d1 
)
inline

Swaps the values of two ImageDimensions objects.

Definition at line 259 of file BppImage.hpp.

◆ swap() [3/3]

void duds::ui::graphics::swap ( BppImage bi0,
BppImage bi1 
)
inline

Support swap operations with the C++ standard library and BppImage objects.

Definition at line 1773 of file BppImage.hpp.

Referenced by swap(), duds::ui::graphics::ImageLocation::swapAxes(), and duds::ui::graphics::ImageDimensions::swapAxes().

Variable Documentation

◆ conv