The ZX Ecosystem v5.1.0;_GUI_v3.1.0
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions | Variables
Coordinate systems for the screen

Description

Using 2 bytes for every type provides:

0..32766 for unsigned coordinates.
0..32767 for unsigned distances.
-32768..32767 for signed distances.

This is way enough for any ZX need, even in large ZX screens.

Checking that the values are within those ranges is left to the user of the library. This library only asserts that these types are integral/signed/ unsigned appropriately.

The verbosity of the Coordinate/Distances system in this module is due to these facts: i) to enable type differentiation of the diverse coordinates and distances even when their numerical types may coincide ; ii) it is not more work for the user, but to the programmer of this library; iii) it prevents common errors in the use of diverse coordinate/distances types (pixels and chars), that are usually used at the same time on the same screen.

There are three coordinate systems supported in this module:

-PixelCoord/PixelDist/IntDist: pixel coordinates in the drawable part of
the ZX screen. (0,0) are assumed to be in the top-left and grow downward
from left to right, thus they are always positive.

-CharCoord/CharDist/IntDist: char coordinates in the drawable part of 
the ZX screen. (0,0) are assumed to be in the top-left and grow downward
from left to right, thus they are always positive.

-BorderCoord/BorderDist/IntDist: pixel coordinates in the border of the
ZX screen that are of the same pixel size as those on the drawable.
(0,0) are at the (0,0) pixel coordinates of the drawable part
of the screen, thus the top border section gets negative y-coordinates,
the left border section gets negative x-coordinates, the right border
section gets positive, beyond drawable pixel x-coordinates, and the 
bottom section gets positive, beyond drawable pixel y-coordinates.
Collaboration diagram for Coordinate systems for the screen:

Typedefs

using zxeco::PixelCoord = uint16_t
 Represent both x and y screen pix coordinates. More...
 
using zxeco::CharCoord = uint16_t
 Represent both x and y screen char coordinates. More...
 
using zxeco::PixelDist = uint16_t
 A distance measured in screen pixels. More...
 
using zxeco::CharDist = uint16_t
 A distance meadured in screen chars. More...
 
using zxeco::IntDist = int16_t
 Positive and negative distances on screen. More...
 
using zxeco::BorderCoord = int16_t
 Represent both x and y pix coords in border. More...
 
using zxeco::BorderDist = uint16_t
 A distance measured in pixels in the border. More...
 
using zxeco::CharCoordT::type = CharCoord
 Numerical type corresponding to this class. More...
 
using zxeco::PixelCoordT::type = PixelCoord
 Numerical type corresponding to this class. More...
 
using zxeco::CharDistT::type = CharDist
 Numerical type corresponding to this class. More...
 
using zxeco::CharDistT::coord_typeT = CharCoordT
 Corresponding coord type trait. More...
 
using zxeco::PixelDistT::type = PixelDist
 Numerical type corresponding to this class. More...
 
using zxeco::PixelDistT::coord_typeT = PixelCoordT
 Corresponding coord type trait. More...
 
using zxeco::IntDistT::type = IntDist
 Numerical type corresponding to this class. More...
 
using zxeco::BorderCoordT::type = BorderCoord
 Numerical type corresponding to this class. More...
 
using zxeco::BorderDistT::type = BorderDist
 Numerical type corresponding to this class. More...
 
using zxeco::BorderDistT::coord_typeT = BorderCoordT
 Corresponding coord type trait. More...
 
using zxeco::Cursor< WRES, HRES >::WidthType = WRES
 Type used for the width dimension. More...
 
using zxeco::Cursor< WRES, HRES >::HeightType = HRES
 Type used for the height dimension. More...
 
using zxeco::CharCursor = Cursor< CharCoordT, CharCoordT >
 Shortcut for this kind of cursor. More...
 
using zxeco::PixCursor = Cursor< PixelCoordT, PixelCoordT >
 Shortcut for this kind of cursor. More...
 
using zxeco::CharPixCursor = Cursor< CharCoordT, PixelCoordT >
 Shortcut for this kind of cursor. More...
 
using zxeco::BorderCursor = Cursor< BorderCoordT, BorderCoordT >
 Shortcut for this kind of cursor. More...
 
using zxeco::Area< WRES, HRES >::WidthType = WRES
 Type used for the width dimension. More...
 
using zxeco::Area< WRES, HRES >::HeightType = HRES
 Type used for the height dimension. More...
 
using zxeco::Area< WRES, HRES >::CursorType = Cursor< typename WRES::coord_typeT, typename HRES::coord_typeT >
 Cursor. More...
 
using zxeco::CharArea = Area< CharDistT, CharDistT >
 Shortcut for this kind of area. More...
 
using zxeco::PixArea = Area< PixelDistT, PixelDistT >
 Shortcut for this kind of area. More...
 
using zxeco::CharPixArea = Area< CharDistT, PixelDistT >
 Shortcut for this kind of area. More...
 
using zxeco::BorderArea = Area< BorderDistT, BorderDistT >
 Shortcut for this kind of area. More...
 
using zxeco::Rect< WRES, HRES >::cursor_type = Cursor< typename WRES::coord_typeT, typename HRES::coord_typeT >
 
using zxeco::Rect< WRES, HRES >::area_type = Area< WRES, HRES >
 
using zxeco::CharRect = Rect< CharDistT, CharDistT >
 Shortcut for this kind of rectangle. More...
 
using zxeco::PixRect = Rect< PixelDistT, PixelDistT >
 Shortcut for this kind of rectangle. More...
 
using zxeco::CharPixRect = Rect< CharDistT, PixelDistT >
 Shortcut for this kind of rectangle. More...
 
using zxeco::BorderRect = Rect< BorderDistT, BorderDistT >
 Shortcut for this kind of rectangle. More...
 
using zxeco::DimsGraphic< HEIGHTRESOL >::CursorType = Cursor< CharCoordT, typename HEIGHTRESOL::coord_typeT >
 
using zxeco::DimsGraphic< HEIGHTRESOL >::AreaType = Area< CharDistT, HEIGHTRESOL >
 
using zxeco::DimsGraphic< HEIGHTRESOL >::RectType = Rect< CharDistT, HEIGHTRESOL >
 
using zxeco::Bitmap::BaseGr = DimsGraphic< PixelDistT >
 
using zxeco::Attrmap::BaseGr = DimsGraphic< CharDistT >
 
using zxeco::DoubleGraphic::NumDithLevels = uint8_t
 Type for storing number of dithering levels. More...
 
using zxeco::DoubleGraphic::DitheringSystem::DitherLevel = NumDithLevels
 

Enumerations

enum class  zxeco::LinearGraphic::GraphOp : unsigned char {
  zxeco::LinearGraphic::GraphOp::COPY , zxeco::LinearGraphic::GraphOp::INV , zxeco::LinearGraphic::GraphOp::OR , zxeco::LinearGraphic::GraphOp::INVOR ,
  zxeco::LinearGraphic::GraphOp::AND , zxeco::LinearGraphic::GraphOp::INVAND , zxeco::LinearGraphic::GraphOp::XOR , zxeco::LinearGraphic::GraphOp::INVXOR
}
 Possible operations on Graphics. More...
 
enum class  zxeco::DoubleGraphic::PNGConversionMode { zxeco::DoubleGraphic::PNGConversionMode::ToNearestPlain , zxeco::DoubleGraphic::PNGConversionMode::Dither }
 Modes of conversion of PNG images into DoubleGraphic. More...
 
enum class  zxeco::DoubleGraphic::PNGConversionSubmode { zxeco::DoubleGraphic::PNGConversionSubmode::None , zxeco::DoubleGraphic::PNGConversionSubmode::FixedPattern , zxeco::DoubleGraphic::PNGConversionSubmode::Noise }
 Submode of conversion of PNG images into DoubleGraphic. More...
 

Functions

constexpr CharCoord zxeco::charOfPixelX (PixelCoord pc) noexcept
 Conversion from an x-PixelCoord to CharCoord. More...
 
constexpr CharCoord zxeco::charOfPixelY (PixelCoord pc) noexcept
 Conversion from an y-PixelCoord to CharCoord. More...
 
constexpr PixelCoord zxeco::firstPixelInCharX (PixelCoord pc) noexcept
 Get the PixelCoord of 1st pixel in the character of this x-PixelCoord. More...
 
constexpr PixelCoord zxeco::firstPixelInCharY (PixelCoord pc) noexcept
 Get the PixelCoord of 1st pixel in the character of this y-PixelCoord. More...
 
constexpr unsigned char zxeco::bitOfPixelX (PixelCoord pc) noexcept
 Get the bit position of the pixel of this x-PixelCoord. More...
 
constexpr PixelCoord zxeco::pixelOfCharX (CharCoord cc) noexcept
 Conversion from an x-CharCoord to PixelCoord. More...
 
constexpr PixelCoord zxeco::pixelOfCharY (CharCoord cc) noexcept
 Conversion from a y-CharCoord to PixelCoord. More...
 
constexpr PixelDist zxeco::charDistToPixelDist (CharDist pc) noexcept
 Conversion from CharDist to PixelDist. More...
 
constexpr CharDist zxeco::pixelDistToCharDist (PixelDist cc, bool toceil=true) noexcept
 Conversion from PixelDist to CharDist. More...
 
static const Cursorzxeco::Cursor< WRES, HRES >::theZero (void) noexcept
 < Return a reference to an inmutable zero cursorof this type. More...
 
static Cursor zxeco::Cursor< WRES, HRES >::max (const Cursor &c0, const Cursor &c1) noexcept
 < Return a copy of the one of C0, C1 that is more to the right and below. More...
 
 zxeco::Cursor< WRES, HRES >::Cursor (typename WidthType::type xc, typename HeightType::type yc)
 Constructor, from the numerical coord types. More...
 
 zxeco::Cursor< WRES, HRES >::Cursor (WidthType xc, HeightType yc)
 Constructor from the trait coord types. More...
 
void zxeco::Cursor< WRES, HRES >::newRow (void) noexcept
 Go down one row resetting x (y <- y + 1 & x <- 0). More...
 
void zxeco::Cursor< WRES, HRES >::newCol (void) noexcept
 Go right one column (x <- x + 1). More...
 
void zxeco::Cursor< WRES, HRES >::incRow (void) noexcept
 Go down one row without resetting x. More...
 
bool zxeco::Cursor< WRES, HRES >::zero (void) const noexcept
 Return TRUE if the cursor is placed at (0,0). *‍/. More...
 
bool zxeco::Cursor< WRES, HRES >::before (const Cursor &oth) const noexcept
 < Return TRUE if THIS is placed before OTH in the plane (linearly). More...
 
bool zxeco::Cursor< WRES, HRES >::rightBelow (const Cursor &oth) const noexcept
 < Return TRUE if THIS is placed to the right and below of OTH. More...
 
IntDist zxeco::Cursor< WRES, HRES >::xDiff (const Cursor &oth) const noexcept
 < Return the signed distance in X from OTH to THIS. More...
 
IntDist zxeco::Cursor< WRES, HRES >::yDiff (const Cursor &oth) const noexcept
 < Return the signed distance in Y from OTH to THIS. More...
 
void zxeco::Cursor< WRES, HRES >::addDiff (IntDist xdiff, IntDist ydiff) noexcept
 < Add the given signed distances to both coordinates. More...
 
bool zxeco::Cursor< WRES, HRES >::operator== (const Cursor &oth) const noexcept
 < Return TRUE if both cursors are placed at the same place. More...
 
bool zxeco::Cursor< WRES, HRES >::operator!= (const Cursor &oth) const noexcept
 < Unequality. More...
 
Cursor zxeco::Cursor< WRES, HRES >::operator+ (const Cursor &oth) const
 < Return the sum of both cursors. More...
 
Cursorzxeco::Cursor< WRES, HRES >::operator+= (const Cursor &oth)
 Make the sum and return the result. More...
 
Cursor zxeco::Cursor< WRES, HRES >::operator- (const Cursor &oth) const
 < Return the cursor THIS relative to OTH, or throw if result is negative. More...
 
Cursorzxeco::Cursor< WRES, HRES >::operator-= (const Cursor &oth)
 Make the substraction and return the result. More...
 
std::string zxeco::Cursor< WRES, HRES >::to_string (bool withtype=true) const
 < Return a string with the textual information of the area. More...
 
PixCursor zxeco::getPixCursor (const CharCursor &cc)
 Convert a char cursor to a pix cursor placed at the top-left of the former. More...
 
PixCursor zxeco::getPixCursor (const CharPixCursor &cc)
 Convert a char-pix cursor to a pix cursor placed at the top-left of former. More...
 
CharPixCursor zxeco::getCharPixCursor (const CharCursor &cc)
 Convert a char cursor to a char-pix cursor placed at the top of the former. More...
 
static const Areazxeco::Area< WRES, HRES >::theEmpty (void) noexcept
 Return a reference to an inmutable empty area of this type. More...
 
 zxeco::Area< WRES, HRES >::Area (typename WidthType::type w, typename HeightType::type h)
 Default constructor, from the numerical dist types. More...
 
 zxeco::Area< WRES, HRES >::Area (WidthType w, HeightType h)
 Constructor from the trait dist types. More...
 
 zxeco::Area< WRES, HRES >::Area (const CursorType &c0, const CursorType &c1)
 Constructor of the area within C0 (top-left) and C1 (bottom-right). More...
 
bool zxeco::Area< WRES, HRES >::empty (void) const noexcept
 Return TRUE if the area is empty. More...
 
size_t zxeco::Area< WRES, HRES >::area (void) const noexcept
 < Return the number of cells in the area. More...
 
bool zxeco::Area< WRES, HRES >::containedInto (const Area &oth) const noexcept
 < Return TRUE if this area can be contained into OTH or if they are equal More...
 
Area zxeco::Area< WRES, HRES >::operator+ (const Area &oth) const noexcept
 < Add width and height of OTH to THIS. More...
 
Areazxeco::Area< WRES, HRES >::operator+= (const Area &oth) noexcept
 < Add to THIS the width and height of OTH. More...
 
Area zxeco::Area< WRES, HRES >::operator- (const Area &oth) const
 < Substract OTH dimensions from THIS dims and return the result, or throw More...
 
Areazxeco::Area< WRES, HRES >::operator-= (const Area &oth)
 Substract OTH from THIS and return THIS. Throw if error. More...
 
Area zxeco::Area< WRES, HRES >::operator* (const Area &oth) const
 < Intersect OTH dimensions to THIS dims and return the result. More...
 
Areazxeco::Area< WRES, HRES >::operator*= (const Area &oth)
 Intersect OTH to THIS and return THIS. More...
 
bool zxeco::Area< WRES, HRES >::operator== (const Area &oth) const noexcept
 < Equality. More...
 
bool zxeco::Area< WRES, HRES >::operator!= (const Area &oth) const noexcept
 < Unequality. More...
 
std::string zxeco::Area< WRES, HRES >::to_string (bool withtype=true) const
 < Return a string with the textual information of the area. More...
 
PixArea zxeco::getPixArea (const CharArea &cc)
 Convert a char area to a pix area covering the same region on screen. More...
 
PixArea zxeco::getPixArea (const CharPixArea &cc)
 Convert a char-pix area to a pix area covering the same region on screen. More...
 
CharPixArea zxeco::getCharPixArea (const CharArea &cc)
 Convert a char area to a char-pix area covering the same region on screen. More...
 
static const Rectzxeco::Rect< WRES, HRES >::theEmpty (void) noexcept
 Return a reference to an inmutable empty rectangle of this type. More...
 
 zxeco::Rect< WRES, HRES >::Rect (const cursor_type &c=cursor_type{0, 0}, const area_type &a=area_type{0, 0})
 Default constructor: empty rectangle. More...
 
bool zxeco::Rect< WRES, HRES >::empty (void) const noexcept
 Return TRUE if the rectangle area is empty. More...
 
bool zxeco::Rect< WRES, HRES >::contains (const cursor_type &cur) const noexcept
 Return TRUE if CUR is inside the rectangle. More...
 
cursor_type zxeco::Rect< WRES, HRES >::bottomRight (void) const noexcept
 < Return the coordinates of the bottom-right extreme within the rectangle More...
 
bool zxeco::Rect< WRES, HRES >::applyConstrainedDiffs (IntDist &xdiff, IntDist &ydiff, const Rect &oth) noexcept
 Apply the given increments to the corner of THIS, keeping it within OTH. More...
 
Rect zxeco::Rect< WRES, HRES >::compose (const Rect &reloth) const
 < Return the RELOTH region of THIS as a rectangle. More...
 
Rect zxeco::Rect< WRES, HRES >::subRect (const cursor_type &reltopleft) const
 < Return the absolute sub-rectangle that starts at RELTOPLEFT within this More...
 
Rect zxeco::Rect< WRES, HRES >::intersect (const Rect &oth) const noexcept
 Return the rectangle resulting from the intersection of this and OTH. More...
 
Rect zxeco::Rect< WRES, HRES >::align_area (const area_type &areaneeded, char horalign, char vertalign) const
 Return the portion of this rectangle that contains AREANEEDED aligned. More...
 
bool zxeco::Rect< WRES, HRES >::operator== (const Rect &oth) const noexcept
 < Equality. More...
 
bool zxeco::Rect< WRES, HRES >::operator!= (const Rect &oth) const noexcept
 < Unequality. More...
 
std::string zxeco::Rect< WRES, HRES >::to_string (bool withtype=true) const
 < Return a string with the textual information of the rectangle. More...
 
PixRect zxeco::getPixRect (const CharRect &cc)
 Convert a char rect to a pix rect representing the same region on screen. More...
 
PixRect zxeco::getPixRect (const CharPixRect &cc)
 Convert a char-pix rect to a pix rect representing the same region. More...
 
CharPixRect zxeco::getCharPixRect (const CharRect &cc)
 Convert a char rect to a char-pix rect representing the same region. More...
 
std::string zxeco::DoubleArea::to_string (void) const
 
std::string zxeco::DoubleRect::to_string (void) const
 
template<LinearGraphic::GraphOp op>
static constexpr uint8_t zxeco::LinearGraphic::doGraphOp (uint8_t b0, uint8_t b1) noexcept
 Return the result of doing operation OP on byte B0 with byte B1.
 
 zxeco::LinearGraphic::LinearGraphic (void)
 Default constructor: empty graphic.
 
 zxeco::LinearGraphic::LinearGraphic (size_t s)
 Construct an empty graphic of the given size, yet to be filled. More...
 
 zxeco::LinearGraphic::LinearGraphic (size_t s, uint8_t b)
 Construct a graphic of the given size filled with 1 byte (B).
 
 zxeco::LinearGraphic::LinearGraphic (uint8_t *bs, size_t s)
 Construct a graphic that is held externally (NO OWNERSHIP to this). More...
 
 zxeco::LinearGraphic::LinearGraphic (LinearGraphic &oth, size_t firstoff, size_t chunksize, size_t gap, size_t numchunks)
 Construct a graphic referring to part of another one (no ownership). More...
 
 zxeco::LinearGraphic::LinearGraphic (const LinearGraphic &)=delete
 
LinearGraphiczxeco::LinearGraphic::operator= (const LinearGraphic &)=delete
 
 zxeco::LinearGraphic::LinearGraphic (LinearGraphic &&og)
 
LinearGraphiczxeco::LinearGraphic::operator= (LinearGraphic &&og)
 
bool zxeco::LinearGraphic::external (void) const noexcept
 Whether the object refers to part of another linear graphic. More...
 
bool zxeco::LinearGraphic::owner (void) const noexcept
 Whether the object owns the graphical data. More...
 
size_t zxeco::LinearGraphic::size (void) const noexcept
 Size in memory, in bytes. More...
 
bool zxeco::LinearGraphic::oneByte (void) const noexcept
 Return TRUE if the graphic content is compressed into one byte. More...
 
uint8_t zxeco::LinearGraphic::getByte (size_t offset) const
 Get the byte at the given offset, throwing if it is out of range.
 
uint8_t zxeco::LinearGraphic::getByteUnsafe (size_t offset) const noexcept
 Get the byte at the given offset without checking out of range.
 
uint8_t * zxeco::LinearGraphic::getAllBytes (void)
 Return a pointer to the data or throw if it is onebyte or external.
 
void zxeco::LinearGraphic::setByte (size_t offset, uint8_t b)
 Change the byte at the given offset inside the data. More...
 
void zxeco::LinearGraphic::setByteUnsafe (size_t offset, uint8_t b) noexcept
 Change the byte at the given offset without checking anything. More...
 
void zxeco::LinearGraphic::setAllBytes (uint8_t b) noexcept
 Set all bytes of the graphic to the given value. More...
 
void zxeco::LinearGraphic::merge (size_t destoffset, const LinearGraphic &oth, size_t origoffset, size_t howmany, GraphOp op=GraphOp::COPY)
 Merge HOWMANY bytes from OTH (at ORIGOFFSET) into this (at DESTOFFSET). More...
 
void zxeco::LinearGraphic::mergeUnsafe (size_t destoffset, const LinearGraphic &oth, size_t origoffset, size_t howmany, GraphOp op=GraphOp::COPY)
 Merge HOWMANY bytes from OTH (at ORIGOFFSET) into this (at DESTOFFSET). More...
 
int zxeco::LinearGraphic::compare (const LinearGraphic &oth, bool withinv=false) const noexcept
 Compare this graphic to OTH and return 1 if both are equal. More...
 
size_t zxeco::LinearGraphic::similarity (const LinearGraphic &oth) const noexcept
 Return a measure of the bitmap similarity (bit by bit) between both. More...
 
std::string zxeco::LinearGraphic::to_string (void) const
 Return a text with the info of the graphic.
 
void zxeco::LinearGraphic::clear (void)
 
void zxeco::LinearGraphic::reset (void)
 
void zxeco::LinearGraphic::moveFrom (LinearGraphic &&og)
 
 zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic (void)
 Default constructor: empty graphic. More...
 
 zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic (const AreaType &a)
 Construct an undefined graphic of the given dimensions, to be filled. More...
 
 zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic (const AreaType &a, uint8_t b)
 Construct a graphic of the given dimensions filled with one byte (B). More...
 
 zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic (uint8_t *bs, const AreaType &a)
 Construct a graphic that is held externally (NO OWNERSHIP to this). More...
 
 zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic (DimsGraphic &g, const RectType &region, bool copy=true)
 Construct a graphic that refers to a region within another one. More...
 
 zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic (DimsGraphic &&oth)
 Move constructor. More...
 
DimsGraphiczxeco::DimsGraphic< HEIGHTRESOL >::operator= (DimsGraphic &&oth)
 Move assignment. More...
 
size_t zxeco::DimsGraphic< HEIGHTRESOL >::offset (const CursorType &pos) const
 Get the offset corresponding to the given coordinates in the graphic. More...
 
CursorType zxeco::DimsGraphic< HEIGHTRESOL >::coords (size_t offset) const
 Get the coordinates of the given offset, if it is valid, or throws. More...
 
uint8_t zxeco::DimsGraphic< HEIGHTRESOL >::getByte (const CursorType &pos) const
 < Unhide the linear getByte() method hidden by the new getByte(). More...
 
void zxeco::DimsGraphic< HEIGHTRESOL >::setByte (const CursorType &pos, uint8_t b)
 < Unhide the linear setByte() method hidden by the new setByte(). More...
 
void zxeco::DimsGraphic< HEIGHTRESOL >::merge (const DimsGraphic &oth, const CursorType &pos, GraphOp mode=GraphOp::COPY)
 Merge OTH at the given coordinates of this object with the given mode. More...
 
HEIGHTRESOL::type zxeco::DimsGraphic< HEIGHTRESOL >::scrollUp (typename HEIGHTRESOL::type howmany, typename HEIGHTRESOL::type upperrow, uint8_t fillb)
 Scroll HOWMANY rows of the graphic up, beginning at y-coord UPPERROW. More...
 
std::string zxeco::DimsGraphic< HEIGHTRESOL >::to_string (void) const
 Return a text with the info of the graphic. More...
 
template<typename WIDTHRESOL , typename HEIGHTRESOL >
bool zxeco::graphicDimensionsTooLarge (unsigned sx, unsigned sy) noexcept
 < Return TRUE if SX,SY are too large to fit in WITHRESOL,HEIGHTRESOL. More...
 
 zxeco::Bitmap::Bitmap (DesktopInterface &desktop, const std::string &pngfile)
 < Reuse all constructor from Gr<PixelDistT>. More...
 
 zxeco::Bitmap::Bitmap (uint8_t ascii, uint8_t *chartable=nullptr)
 Construct a bitmap for a ZX ascii char (including block-graphic ones).
 
void zxeco::Bitmap::merge (const Bitmap &oth, const PixCursor &pos, GraphOp mode=GraphOp::COPY)
 < Unhide the base merge() method hidden by the new merge(). More...
 
std::string zxeco::Bitmap::to_string (void) const
 Return a text with the info of the graphic. More...
 
void zxeco::Attrmap::swapPaperInk (void)
 < Reuse all constructor from Gr<CharDistT>. More...
 
std::string zxeco::Attrmap::to_string (void) const
 Return a text with the info of the graphic. More...
 
 zxeco::DoubleGraphic::DoubleGraphic (const CharArea &dims)
 Constructor for a given size in characters. More...
 
 zxeco::DoubleGraphic::DoubleGraphic (uint8_t *bs, uint8_t *as, const CharArea &a)
 Construct a graphic that is held externally (NO OWNERSHIP to this). More...
 
 zxeco::DoubleGraphic::DoubleGraphic (DoubleGraphic &g, const CharRect &region, bool copy=true)
 Construct a graphic that refers to the same region within a bit/attrmap. More...
 
 zxeco::DoubleGraphic::DoubleGraphic (DesktopInterface &desktop, const std::string &pngfile, const PNGConversionParms &parms={PNGConversionMode::ToNearestPlain, PNGConversionSubmode::None})
 Constructor from a .png file. More...
 
 zxeco::DoubleGraphic::DoubleGraphic (const DoubleGraphic &)=delete
 
DoubleGraphiczxeco::DoubleGraphic::operator= (const DoubleGraphic &)=delete
 
 zxeco::DoubleGraphic::DoubleGraphic (DoubleGraphic &&oth)
 
DoubleGraphiczxeco::DoubleGraphic::operator= (DoubleGraphic &&oth)
 
void zxeco::DoubleGraphic::merge (const DoubleGraphic &oth, const CharCursor &pos, LinearGraphic::GraphOp mode=LinearGraphic::GraphOp::COPY)
 Merge both bitmap and attrmap of OTH at the given coordinates in MODE. More...
 
void zxeco::DoubleGraphic::savePNG (DesktopInterface &desktop, const std::string &pngfile)
 Save the double graphic into a PNG file. More...
 
std::string zxeco::DoubleGraphic::to_string (void) const
 Return a text with the info of the graphic. More...
 
RGBPalette::Index zxeco::DoubleGraphic::DitheringSystem::Color::indexInPal (void) const noexcept
 
RGBColor zxeco::DoubleGraphic::DitheringSystem::Color::rgbColor (void) const
 
RGBPalette::Index zxeco::DoubleGraphic::DitheringSystem::Color::firstExtreme (void) const noexcept
 
RGBPalette::Index zxeco::DoubleGraphic::DitheringSystem::Color::secondExtreme (void) const noexcept
 
DitherLevel zxeco::DoubleGraphic::DitheringSystem::Color::ditherLevel (void) const noexcept
 
bool zxeco::DoubleGraphic::DitheringSystem::Color::notDithered (void) const noexcept
 
bool zxeco::DoubleGraphic::DitheringSystem::Color::equalExtremesOrder (const Color &oc) const noexcept
 
bool zxeco::DoubleGraphic::DitheringSystem::Color::equalExtremesNotOrder (const Color &oc) const noexcept
 
bool zxeco::DoubleGraphic::DitheringSystem::Color::equalExtremes (const Color &oc) const noexcept
 
Color zxeco::DoubleGraphic::DitheringSystem::Color::makeCompatibleWith (const Color &oc) const noexcept
 
std::string zxeco::DoubleGraphic::DitheringSystem::Color::to_string (void) const
 
 zxeco::DoubleGraphic::DitheringSystem::DitheringSystem (NumDithLevels nlvs)
 
 zxeco::DoubleGraphic::DitheringSystem::DitheringSystem (const DitheringSystem &)=delete
 
 zxeco::DoubleGraphic::DitheringSystem::DitheringSystem (DitheringSystem &&)=delete
 
DitheringSystem & zxeco::DoubleGraphic::DitheringSystem::operator= (const DitheringSystem &)=delete
 
DitheringSystem & zxeco::DoubleGraphic::DitheringSystem::operator= (DitheringSystem &&)=delete
 
constexpr NumDithLevels zxeco::DoubleGraphic::DitheringSystem::numDithLevels (void) const noexcept
 
constexpr NumDithLevels zxeco::DoubleGraphic::DitheringSystem::maxDithLevel (void) const noexcept
 
constexpr DitherLevel zxeco::DoubleGraphic::DitheringSystem::inverseDithLevel (DitherLevel dl) const noexcept
 
constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::numClusters (void) const noexcept
 
constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::totalColors (void) const noexcept
 
double zxeco::DoubleGraphic::DitheringSystem::dithLevDegree (DitherLevel dl) const
 
const RGBPalettezxeco::DoubleGraphic::DitheringSystem::ditheredPalette (void) const noexcept
 
Color zxeco::DoubleGraphic::DitheringSystem::deployColor (const RGBColor &rgb) const
 
Color zxeco::DoubleGraphic::DitheringSystem::deployColor (RGBPalette::Index palind) const
 
template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INV > (uint8_t b0, uint8_t b1) noexcept
 
template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::OR > (uint8_t b0, uint8_t b1) noexcept
 
template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INVOR > (uint8_t b0, uint8_t b1) noexcept
 
template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::AND > (uint8_t b0, uint8_t b1) noexcept
 
template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INVAND > (uint8_t b0, uint8_t b1) noexcept
 
template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::XOR > (uint8_t b0, uint8_t b1) noexcept
 
template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INVXOR > (uint8_t b0, uint8_t b1) noexcept
 

Variables

constexpr PixelCoord zxeco::kMaxPixelCoord = std::numeric_limits<PixelCoord>::max()
 Maximum value of a pixel coordinate. More...
 
constexpr CharCoord zxeco::kMaxCharCoord = std::numeric_limits<CharCoord>::max()
 Maximum value of a char coordinate. More...
 
constexpr PixelDist zxeco::kMaxPixelDist = std::numeric_limits<PixelDist>::max()
 Maximum value of a pixel distance. More...
 
constexpr CharDist zxeco::kMaxCharDist = std::numeric_limits<CharDist>::max()
 Maximum value of a char distance. More...
 
constexpr IntDist zxeco::kMinIntDist = std::numeric_limits<IntDist>::min()
 Minimum value of an int distance. More...
 
constexpr IntDist zxeco::kMaxIntDist = std::numeric_limits<IntDist>::max()
 Maximum value of an int distance. More...
 
constexpr BorderCoord zxeco::kMaxBorderCoord = std::numeric_limits<BorderCoord>::max()
 Maximum value of a border pixel coordinate. More...
 
constexpr BorderDist zxeco::kMaxBorderDist = std::numeric_limits<BorderDist>::max()
 Maximum value of a border pixel distance. More...
 
static constexpr const char * zxeco::CharCoordT::name = "CharC"
 Name of numeric type. More...
 
type zxeco::CharCoordT::value
 To hold values of that type. More...
 
static constexpr const char * zxeco::PixelCoordT::name = "PixC"
 Name of numeric type. More...
 
type zxeco::PixelCoordT::value
 To hold values of that type. More...
 
static constexpr const char * zxeco::CharDistT::name = "CharD"
 Name of numeric type. More...
 
type zxeco::CharDistT::value
 To hold values of that type. More...
 
static constexpr const char * zxeco::PixelDistT::name = "PixD"
 Name of numeric type. More...
 
type zxeco::PixelDistT::value
 To hold values of that type. More...
 
static constexpr const char * zxeco::IntDistT::name = "IntD"
 Name of numeric type. More...
 
type zxeco::IntDistT::value
 To hold values of that type. More...
 
static constexpr const char * zxeco::BorderCoordT::name = "BorderC"
 Name of numeric type. More...
 
type zxeco::BorderCoordT::value
 To hold values of that type. More...
 
static constexpr const char * zxeco::BorderDistT::name = "BorderD"
 Name of numeric type. More...
 
type zxeco::BorderDistT::value
 To hold values of that type. More...
 
WidthType::type zxeco::Cursor< WRES, HRES >::x
 Coordinate in width (horizontally). More...
 
HeightType::type zxeco::Cursor< WRES, HRES >::y
 Coordinates in height (vertically). More...
 
WidthType::type zxeco::Area< WRES, HRES >::width
 width of the area. More...
 
HeightType::type zxeco::Area< WRES, HRES >::height
 height of the area. More...
 
cursor_type zxeco::Rect< WRES, HRES >::corner
 Top-left corner. More...
 
area_type zxeco::Rect< WRES, HRES >::area
 Width and height. More...
 
CharArea zxeco::DoubleArea::chararea
 Char resolution. More...
 
PixArea zxeco::DoubleArea::pixarea
 Pixel resolution. More...
 
CharRect zxeco::DoubleRect::charrect
 Char resolution. More...
 
PixRect zxeco::DoubleRect::pixrect
 Pixel resolution. More...
 
bool zxeco::LinearGraphic::owner_
 
size_t zxeco::LinearGraphic::s_
 
uint8_t   zxeco::LinearGraphic::thebyte
 
uint8_t *   zxeco::LinearGraphic::bytes
 
LinearGraphic *   zxeco::LinearGraphic::other
 
size_t   zxeco::LinearGraphic::firstoff
 
size_t   zxeco::LinearGraphic::chunksize
 
size_t   zxeco::LinearGraphic::gap
 
size_t   zxeco::LinearGraphic::numchunks
 
struct {
   LinearGraphic *   zxeco::LinearGraphic::other
 
   size_t   zxeco::LinearGraphic::firstoff
 
   size_t   zxeco::LinearGraphic::chunksize
 
   size_t   zxeco::LinearGraphic::gap
 
   size_t   zxeco::LinearGraphic::numchunks
 
}   zxeco::LinearGraphic::external
 
AreaType zxeco::DimsGraphic< HEIGHTRESOL >::dims
 Dimensions of the graphic. More...
 
PNGConversionMode zxeco::DoubleGraphic::PNGConversionParms::mode
 Mode for conversion. More...
 
PNGConversionSubmode zxeco::DoubleGraphic::PNGConversionParms::submode
 Submode. More...
 
struct {
zxeco::DoubleGraphic::PNGConversionParms::tonearestplain
 Parms for ToNearestPlain mode.
 
NumDithLevels   zxeco::DoubleGraphic::PNGConversionParms::numlevels
 Number of dithering levels. More...
 
struct {
   NumDithLevels   zxeco::DoubleGraphic::PNGConversionParms::numlevels
 Number of dithering levels. More...
 
zxeco::DoubleGraphic::PNGConversionParms::dither
 Parms for Dither and its submodes.
 
Bitmap zxeco::DoubleGraphic::bitmap
 
Attrmap zxeco::DoubleGraphic::attrmap
 
static constexpr NumDithLevels zxeco::DoubleGraphic::DitheringSystem::kMinDiths = 3
 
static constexpr NumDithLevels zxeco::DoubleGraphic::DitheringSystem::kMaxDiths = 101
 
static constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::kNumPureColors
 
static constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::kNumColorsButBright
 
static constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::kClusterSizeButBright
 
static constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::kClusterSize
 
friend zxeco::DoubleGraphic::DitheringSystem::Color::DitheringSystem
 

Screen size constants

Width and height of the original ZX Spectrum screen. Notice that in the ZX ecosystem the screen can be opened with different dimensions.

constexpr PixelDist zxeco::SCREENW = 256
 Width in pixels of the original zx screen. More...
 
constexpr PixelDist zxeco::SCREENH = 192
 Height in pixels of the original zx screen. More...
 
constexpr BorderDist zxeco::TOPBORDERH = 56
 Height in pixels of the original zx visible border in its top section. More...
 
constexpr BorderDist zxeco::BOTTOMBORDERH = 56
 Height in pixels of the original zx visible border in its bottom section. More...
 
constexpr BorderDist zxeco::LEFTBORDERW = 32
 Height in pixels of the original zx visible border in its left section. More...
 
constexpr BorderDist zxeco::RIGHTBORDERW = 64
 Height in pixels of the original zx visible border in its right section. More...
 
constexpr CharDist zxeco::SCREENCHARCOLS = 32
 Number of char columns in the screen. More...
 
constexpr CharDist zxeco::SCREENCHARROWS = 24
 Number of char rows in the screen. More...
 
constexpr size_t zxeco::BITMAPLEN = 6144
 Length in memory (bytes) of the original zx screen bitmap. More...
 
constexpr size_t zxeco::ATTRMAPLEN = 768
 Length in memory (bytes) of the original zx screen attrmap. More...
 
constexpr size_t zxeco::DISPLAYLEN = BITMAPLEN + ATTRMAPLEN
 Length in memory (bytes) of the original complete zx screen. More...
 
constexpr CharDist zxeco::SCREENROWS = pixelDistToCharDist(SCREENH)
 Number of rows in the screen of the original ZX. More...
 
constexpr CharDist zxeco::SCREENCOLS = pixelDistToCharDist(SCREENW)
 Number of columns in the screen of the original ZX. More...
 
 zxeco::DoubleArea::DoubleArea (const CharArea &area=CharArea::theEmpty())
 
 zxeco::DoubleArea::DoubleArea (const CharArea &carea, const PixArea &parea)
 
 zxeco::DoubleRect::DoubleRect (const CharRect &rect=CharRect::theEmpty())
 
 zxeco::DoubleRect::DoubleRect (const CharRect &crect, const PixRect &prect)
 

Typedef Documentation

◆ PixelCoord

using zxeco::PixelCoord = typedef uint16_t

#include <ZXGraphics.h>

Represent both x and y screen pix coordinates.

Definition at line 93 of file ZXGraphics.h.

◆ CharCoord

using zxeco::CharCoord = typedef uint16_t

#include <ZXGraphics.h>

Represent both x and y screen char coordinates.

Definition at line 94 of file ZXGraphics.h.

◆ PixelDist

using zxeco::PixelDist = typedef uint16_t

#include <ZXGraphics.h>

A distance measured in screen pixels.

Definition at line 96 of file ZXGraphics.h.

◆ CharDist

using zxeco::CharDist = typedef uint16_t

#include <ZXGraphics.h>

A distance meadured in screen chars.

Definition at line 97 of file ZXGraphics.h.

◆ IntDist

using zxeco::IntDist = typedef int16_t

#include <ZXGraphics.h>

Positive and negative distances on screen.

Definition at line 99 of file ZXGraphics.h.

◆ BorderCoord

using zxeco::BorderCoord = typedef int16_t

#include <ZXGraphics.h>

Represent both x and y pix coords in border.

Definition at line 101 of file ZXGraphics.h.

◆ BorderDist

using zxeco::BorderDist = typedef uint16_t

#include <ZXGraphics.h>

A distance measured in pixels in the border.

Definition at line 102 of file ZXGraphics.h.

◆ type [1/7]

Numerical type corresponding to this class.

Definition at line 269 of file ZXGraphics.h.

◆ type [2/7]

Numerical type corresponding to this class.

Definition at line 279 of file ZXGraphics.h.

◆ type [3/7]

Numerical type corresponding to this class.

Definition at line 289 of file ZXGraphics.h.

◆ coord_typeT [1/3]

Corresponding coord type trait.

Definition at line 291 of file ZXGraphics.h.

◆ type [4/7]

Numerical type corresponding to this class.

Definition at line 301 of file ZXGraphics.h.

◆ coord_typeT [2/3]

Corresponding coord type trait.

Definition at line 303 of file ZXGraphics.h.

◆ type [5/7]

Numerical type corresponding to this class.

Definition at line 314 of file ZXGraphics.h.

◆ type [6/7]

Numerical type corresponding to this class.

Definition at line 324 of file ZXGraphics.h.

◆ type [7/7]

Numerical type corresponding to this class.

Definition at line 334 of file ZXGraphics.h.

◆ coord_typeT [3/3]

Corresponding coord type trait.

Definition at line 336 of file ZXGraphics.h.

◆ WidthType [1/2]

template<typename WRES , typename HRES >
using zxeco::Cursor< WRES, HRES >::WidthType = WRES

Type used for the width dimension.

Definition at line 362 of file ZXGraphics.h.

◆ HeightType [1/2]

template<typename WRES , typename HRES >
using zxeco::Cursor< WRES, HRES >::HeightType = HRES

Type used for the height dimension.

Definition at line 363 of file ZXGraphics.h.

◆ CharCursor

#include <ZXGraphics.h>

Shortcut for this kind of cursor.

Definition at line 467 of file ZXGraphics.h.

◆ PixCursor

#include <ZXGraphics.h>

Shortcut for this kind of cursor.

Definition at line 470 of file ZXGraphics.h.

◆ CharPixCursor

#include <ZXGraphics.h>

Shortcut for this kind of cursor.

Definition at line 473 of file ZXGraphics.h.

◆ BorderCursor

#include <ZXGraphics.h>

Shortcut for this kind of cursor.

Definition at line 476 of file ZXGraphics.h.

◆ WidthType [2/2]

template<typename WRES , typename HRES >
using zxeco::Area< WRES, HRES >::WidthType = WRES

Type used for the width dimension.

Definition at line 507 of file ZXGraphics.h.

◆ HeightType [2/2]

template<typename WRES , typename HRES >
using zxeco::Area< WRES, HRES >::HeightType = HRES

Type used for the height dimension.

Definition at line 508 of file ZXGraphics.h.

◆ CursorType [1/2]

template<typename WRES , typename HRES >
using zxeco::Area< WRES, HRES >::CursorType = Cursor<typename WRES::coord_typeT, typename HRES::coord_typeT>

Cursor.

Definition at line 509 of file ZXGraphics.h.

◆ CharArea

#include <ZXGraphics.h>

Shortcut for this kind of area.

Definition at line 604 of file ZXGraphics.h.

◆ PixArea

#include <ZXGraphics.h>

Shortcut for this kind of area.

Definition at line 607 of file ZXGraphics.h.

◆ CharPixArea

#include <ZXGraphics.h>

Shortcut for this kind of area.

Definition at line 610 of file ZXGraphics.h.

◆ BorderArea

#include <ZXGraphics.h>

Shortcut for this kind of area.

Definition at line 613 of file ZXGraphics.h.

◆ cursor_type

template<typename WRES , typename HRES >
using zxeco::Rect< WRES, HRES >::cursor_type = Cursor<typename WRES::coord_typeT, typename HRES::coord_typeT>

Definition at line 645 of file ZXGraphics.h.

◆ area_type

template<typename WRES , typename HRES >
using zxeco::Rect< WRES, HRES >::area_type = Area<WRES,HRES>

Definition at line 647 of file ZXGraphics.h.

◆ CharRect

#include <ZXGraphics.h>

Shortcut for this kind of rectangle.

Definition at line 734 of file ZXGraphics.h.

◆ PixRect

#include <ZXGraphics.h>

Shortcut for this kind of rectangle.

Definition at line 737 of file ZXGraphics.h.

◆ CharPixRect

#include <ZXGraphics.h>

Shortcut for this kind of rectangle.

Definition at line 740 of file ZXGraphics.h.

◆ BorderRect

#include <ZXGraphics.h>

Shortcut for this kind of rectangle.

Definition at line 743 of file ZXGraphics.h.

◆ CursorType [2/2]

template<typename HEIGHTRESOL >
using zxeco::DimsGraphic< HEIGHTRESOL >::CursorType = Cursor<CharCoordT,typename HEIGHTRESOL::coord_typeT>

Definition at line 1012 of file ZXGraphics.h.

◆ AreaType

template<typename HEIGHTRESOL >
using zxeco::DimsGraphic< HEIGHTRESOL >::AreaType = Area<CharDistT,HEIGHTRESOL>

Definition at line 1013 of file ZXGraphics.h.

◆ RectType

template<typename HEIGHTRESOL >
using zxeco::DimsGraphic< HEIGHTRESOL >::RectType = Rect<CharDistT,HEIGHTRESOL>

Definition at line 1014 of file ZXGraphics.h.

◆ BaseGr [1/2]

Definition at line 1154 of file ZXGraphics.h.

◆ BaseGr [2/2]

Definition at line 1224 of file ZXGraphics.h.

◆ NumDithLevels

Type for storing number of dithering levels.

Definition at line 1271 of file ZXGraphics.h.

◆ DitherLevel

using zxeco::DoubleGraphic::DitheringSystem::DitherLevel = NumDithLevels

Definition at line 1383 of file ZXGraphics.h.

Enumeration Type Documentation

◆ GraphOp

enum class zxeco::LinearGraphic::GraphOp : unsigned char
strong

Possible operations on Graphics.

Enumerator
COPY 

put the graphic on the screen (substitution)

INV 

like COPY but with the graphic bits inverted first

OR 

OR the graphic and the screen content.

INVOR 

like OR but first invert the graphic bits

AND 

AND the graphic and the screen content.

INVAND 

like AND but first inverts the graphic bits

XOR 

XOR the graphic and the screen content.

INVXOR 

like XOR but with the graphic bits inverted first

Definition at line 841 of file ZXGraphics.h.

◆ PNGConversionMode

Modes of conversion of PNG images into DoubleGraphic.

Enumerator
ToNearestPlain 

The algorithm in http://jafma.net/software/zxscreen/

Dither 

Use more colours thrugh dithering.

Definition at line 1256 of file ZXGraphics.h.

◆ PNGConversionSubmode

Submode of conversion of PNG images into DoubleGraphic.

Enumerator
None 

No submode.

FixedPattern 

Fixed pattern dithr

Noise 

Noise dithering.

Definition at line 1264 of file ZXGraphics.h.

Function Documentation

◆ charOfPixelX()

constexpr CharCoord zxeco::charOfPixelX ( PixelCoord  pc)
constexprnoexcept

#include <ZXGraphics.h>

Conversion from an x-PixelCoord to CharCoord.

Return the x coord of the char where this pixel (x coordinate) is.

Definition at line 134 of file ZXGraphics.h.

◆ charOfPixelY()

constexpr CharCoord zxeco::charOfPixelY ( PixelCoord  pc)
constexprnoexcept

#include <ZXGraphics.h>

Conversion from an y-PixelCoord to CharCoord.

Return the y coord of the char where this pixel (y coordinate) is.

Definition at line 139 of file ZXGraphics.h.

◆ firstPixelInCharX()

constexpr PixelCoord zxeco::firstPixelInCharX ( PixelCoord  pc)
constexprnoexcept

#include <ZXGraphics.h>

Get the PixelCoord of 1st pixel in the character of this x-PixelCoord.

Return the x coord of the 1st pixel of the same char of this pixel (considered as an x coordinate).

Definition at line 145 of file ZXGraphics.h.

◆ firstPixelInCharY()

constexpr PixelCoord zxeco::firstPixelInCharY ( PixelCoord  pc)
constexprnoexcept

#include <ZXGraphics.h>

Get the PixelCoord of 1st pixel in the character of this y-PixelCoord.

Return the y coord of the 1st pixel of the same char of this pixel (considered as a y coordinate).

Definition at line 151 of file ZXGraphics.h.

◆ bitOfPixelX()

constexpr unsigned char zxeco::bitOfPixelX ( PixelCoord  pc)
constexprnoexcept

#include <ZXGraphics.h>

Get the bit position of the pixel of this x-PixelCoord.

Return the bit corresponding to this coord (x coordinate), being 7 for the left-most bit of the corresponding char coordinate and 0 for the right-most one.

Definition at line 158 of file ZXGraphics.h.

◆ pixelOfCharX()

constexpr PixelCoord zxeco::pixelOfCharX ( CharCoord  cc)
constexprnoexcept

#include <ZXGraphics.h>

Conversion from an x-CharCoord to PixelCoord.

Return the x coord of the 1st pixel of the char whose x coordinate is this.

Definition at line 167 of file ZXGraphics.h.

◆ pixelOfCharY()

constexpr PixelCoord zxeco::pixelOfCharY ( CharCoord  cc)
constexprnoexcept

#include <ZXGraphics.h>

Conversion from a y-CharCoord to PixelCoord.

Return the y coord of the 1st pixel of the char whose y coordinate is this.

Definition at line 173 of file ZXGraphics.h.

◆ charDistToPixelDist()

constexpr PixelDist zxeco::charDistToPixelDist ( CharDist  pc)
constexprnoexcept

#include <ZXGraphics.h>

Conversion from CharDist to PixelDist.

Count 8 pixels per character cell and thus the result is greater than the numeric value of PC.

Definition at line 215 of file ZXGraphics.h.

◆ pixelDistToCharDist()

constexpr CharDist zxeco::pixelDistToCharDist ( PixelDist  cc,
bool  toceil = true 
)
constexprnoexcept

#include <ZXGraphics.h>

Conversion from PixelDist to CharDist.

Count 8 pixels per character cell, and thus the result is smaller than the numerical value of CC. If TOCEIL, count one character at least even when there are less than 8 pixels.

Definition at line 224 of file ZXGraphics.h.

◆ theZero()

template<typename WRES , typename HRES >
static const Cursor & zxeco::Cursor< WRES, HRES >::theZero ( void  )
inlinestaticnoexcept

#include <ZXGraphics.h>

< Return a reference to an inmutable zero cursorof this type.

Definition at line 368 of file ZXGraphics.h.

◆ max()

template<typename WRES , typename HRES >
static Cursor zxeco::Cursor< WRES, HRES >::max ( const Cursor< WRES, HRES > &  c0,
const Cursor< WRES, HRES > &  c1 
)
inlinestaticnoexcept

#include <ZXGraphics.h>

< Return a copy of the one of C0, C1 that is more to the right and below.

Definition at line 372 of file ZXGraphics.h.

◆ Cursor() [1/2]

template<typename WRES , typename HRES >
zxeco::Cursor< WRES, HRES >::Cursor ( typename WidthType::type  xc,
typename HeightType::type  yc 
)
inline

#include <ZXGraphics.h>

Constructor, from the numerical coord types.

No default values for preventing common errors of promotion of numbers to this type (without being so strict as by defining it as explicit).

Definition at line 377 of file ZXGraphics.h.

◆ Cursor() [2/2]

template<typename WRES , typename HRES >
zxeco::Cursor< WRES, HRES >::Cursor ( WidthType  xc,
HeightType  yc 
)
inline

#include <ZXGraphics.h>

Constructor from the trait coord types.

Definition at line 382 of file ZXGraphics.h.

◆ newRow()

template<typename WRES , typename HRES >
void zxeco::Cursor< WRES, HRES >::newRow ( void  )
inlinenoexcept

#include <ZXGraphics.h>

Go down one row resetting x (y <- y + 1 & x <- 0).

Definition at line 386 of file ZXGraphics.h.

◆ newCol()

template<typename WRES , typename HRES >
void zxeco::Cursor< WRES, HRES >::newCol ( void  )
inlinenoexcept

#include <ZXGraphics.h>

Go right one column (x <- x + 1).

Definition at line 389 of file ZXGraphics.h.

◆ incRow()

template<typename WRES , typename HRES >
void zxeco::Cursor< WRES, HRES >::incRow ( void  )
inlinenoexcept

#include <ZXGraphics.h>

Go down one row without resetting x.

Definition at line 392 of file ZXGraphics.h.

◆ zero()

template<typename WRES , typename HRES >
bool zxeco::Cursor< WRES, HRES >::zero ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Return TRUE if the cursor is placed at (0,0). *‍/.

Definition at line 395 of file ZXGraphics.h.

◆ before()

template<typename WRES , typename HRES >
bool zxeco::Cursor< WRES, HRES >::before ( const Cursor< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Return TRUE if THIS is placed before OTH in the plane (linearly).

< If both are equal, return FALSE.

Definition at line 398 of file ZXGraphics.h.

◆ rightBelow()

template<typename WRES , typename HRES >
bool zxeco::Cursor< WRES, HRES >::rightBelow ( const Cursor< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Return TRUE if THIS is placed to the right and below of OTH.

< If it coincides in any of the coords, return TRUE.

Definition at line 403 of file ZXGraphics.h.

◆ xDiff()

template<typename WRES , typename HRES >
IntDist zxeco::Cursor< WRES, HRES >::xDiff ( const Cursor< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Return the signed distance in X from OTH to THIS.

Definition at line 408 of file ZXGraphics.h.

◆ yDiff()

template<typename WRES , typename HRES >
IntDist zxeco::Cursor< WRES, HRES >::yDiff ( const Cursor< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Return the signed distance in Y from OTH to THIS.

Definition at line 412 of file ZXGraphics.h.

◆ addDiff()

template<typename WRES , typename HRES >
void zxeco::Cursor< WRES, HRES >::addDiff ( IntDist  xdiff,
IntDist  ydiff 
)
inlinenoexcept

#include <ZXGraphics.h>

< Add the given signed distances to both coordinates.

Definition at line 416 of file ZXGraphics.h.

◆ operator==() [1/3]

template<typename WRES , typename HRES >
bool zxeco::Cursor< WRES, HRES >::operator== ( const Cursor< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Return TRUE if both cursors are placed at the same place.

Definition at line 423 of file ZXGraphics.h.

◆ operator!=() [1/3]

template<typename WRES , typename HRES >
bool zxeco::Cursor< WRES, HRES >::operator!= ( const Cursor< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Unequality.

Definition at line 427 of file ZXGraphics.h.

◆ operator+() [1/2]

template<typename WRES , typename HRES >
Cursor zxeco::Cursor< WRES, HRES >::operator+ ( const Cursor< WRES, HRES > &  oth) const
inline

#include <ZXGraphics.h>

< Return the sum of both cursors.

Definition at line 431 of file ZXGraphics.h.

◆ operator+=() [1/2]

template<typename WRES , typename HRES >
Cursor & zxeco::Cursor< WRES, HRES >::operator+= ( const Cursor< WRES, HRES > &  oth)
inline

#include <ZXGraphics.h>

Make the sum and return the result.

Definition at line 437 of file ZXGraphics.h.

◆ operator-() [1/2]

template<typename WRES , typename HRES >
Cursor zxeco::Cursor< WRES, HRES >::operator- ( const Cursor< WRES, HRES > &  oth) const
inline

#include <ZXGraphics.h>

< Return the cursor THIS relative to OTH, or throw if result is negative.

Definition at line 440 of file ZXGraphics.h.

◆ operator-=() [1/2]

template<typename WRES , typename HRES >
Cursor & zxeco::Cursor< WRES, HRES >::operator-= ( const Cursor< WRES, HRES > &  oth)
inline

#include <ZXGraphics.h>

Make the substraction and return the result.

Definition at line 448 of file ZXGraphics.h.

◆ to_string() [1/9]

template<typename WRES , typename HRES >
std::string zxeco::Cursor< WRES, HRES >::to_string ( bool  withtype = true) const
inline

#include <ZXGraphics.h>

< Return a string with the textual information of the area.

Definition at line 451 of file ZXGraphics.h.

◆ getPixCursor() [1/2]

PixCursor zxeco::getPixCursor ( const CharCursor cc)
inline

#include <ZXGraphics.h>

Convert a char cursor to a pix cursor placed at the top-left of the former.

Definition at line 481 of file ZXGraphics.h.

◆ getPixCursor() [2/2]

PixCursor zxeco::getPixCursor ( const CharPixCursor cc)
inline

#include <ZXGraphics.h>

Convert a char-pix cursor to a pix cursor placed at the top-left of former.

Definition at line 485 of file ZXGraphics.h.

◆ getCharPixCursor()

CharPixCursor zxeco::getCharPixCursor ( const CharCursor cc)
inline

#include <ZXGraphics.h>

Convert a char cursor to a char-pix cursor placed at the top of the former.

Definition at line 489 of file ZXGraphics.h.

◆ theEmpty() [1/2]

template<typename WRES , typename HRES >
static const Area & zxeco::Area< WRES, HRES >::theEmpty ( void  )
inlinestaticnoexcept

#include <ZXGraphics.h>

Return a reference to an inmutable empty area of this type.

Definition at line 515 of file ZXGraphics.h.

◆ Area() [1/3]

template<typename WRES , typename HRES >
zxeco::Area< WRES, HRES >::Area ( typename WidthType::type  w,
typename HeightType::type  h 
)
inline

#include <ZXGraphics.h>

Default constructor, from the numerical dist types.

No default values for preventing common errors of promotion of numbers to this type (without being so strict as by defining it as explicit).

Definition at line 520 of file ZXGraphics.h.

◆ Area() [2/3]

template<typename WRES , typename HRES >
zxeco::Area< WRES, HRES >::Area ( WidthType  w,
HeightType  h 
)
inline

#include <ZXGraphics.h>

Constructor from the trait dist types.

Definition at line 525 of file ZXGraphics.h.

◆ Area() [3/3]

template<typename WRES , typename HRES >
zxeco::Area< WRES, HRES >::Area ( const CursorType c0,
const CursorType c1 
)
inline

#include <ZXGraphics.h>

Constructor of the area within C0 (top-left) and C1 (bottom-right).

Both are considered included in the area. Throw if the corners are invalid.

Definition at line 531 of file ZXGraphics.h.

◆ empty() [1/2]

template<typename WRES , typename HRES >
bool zxeco::Area< WRES, HRES >::empty ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Return TRUE if the area is empty.

Definition at line 535 of file ZXGraphics.h.

◆ area()

template<typename WRES , typename HRES >
size_t zxeco::Area< WRES, HRES >::area ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

< Return the number of cells in the area.

Definition at line 538 of file ZXGraphics.h.

◆ containedInto()

template<typename WRES , typename HRES >
bool zxeco::Area< WRES, HRES >::containedInto ( const Area< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Return TRUE if this area can be contained into OTH or if they are equal

Definition at line 542 of file ZXGraphics.h.

◆ operator+() [2/2]

template<typename WRES , typename HRES >
Area zxeco::Area< WRES, HRES >::operator+ ( const Area< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Add width and height of OTH to THIS.

Definition at line 546 of file ZXGraphics.h.

◆ operator+=() [2/2]

template<typename WRES , typename HRES >
Area & zxeco::Area< WRES, HRES >::operator+= ( const Area< WRES, HRES > &  oth)
inlinenoexcept

#include <ZXGraphics.h>

< Add to THIS the width and height of OTH.

Definition at line 552 of file ZXGraphics.h.

◆ operator-() [2/2]

template<typename WRES , typename HRES >
Area zxeco::Area< WRES, HRES >::operator- ( const Area< WRES, HRES > &  oth) const
inline

#include <ZXGraphics.h>

< Substract OTH dimensions from THIS dims and return the result, or throw

Definition at line 556 of file ZXGraphics.h.

◆ operator-=() [2/2]

template<typename WRES , typename HRES >
Area & zxeco::Area< WRES, HRES >::operator-= ( const Area< WRES, HRES > &  oth)
inline

#include <ZXGraphics.h>

Substract OTH from THIS and return THIS. Throw if error.

Definition at line 565 of file ZXGraphics.h.

◆ operator*()

template<typename WRES , typename HRES >
Area zxeco::Area< WRES, HRES >::operator* ( const Area< WRES, HRES > &  oth) const
inline

#include <ZXGraphics.h>

< Intersect OTH dimensions to THIS dims and return the result.

Definition at line 570 of file ZXGraphics.h.

◆ operator*=()

template<typename WRES , typename HRES >
Area & zxeco::Area< WRES, HRES >::operator*= ( const Area< WRES, HRES > &  oth)
inline

#include <ZXGraphics.h>

Intersect OTH to THIS and return THIS.

Definition at line 575 of file ZXGraphics.h.

◆ operator==() [2/3]

template<typename WRES , typename HRES >
bool zxeco::Area< WRES, HRES >::operator== ( const Area< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Equality.

Definition at line 579 of file ZXGraphics.h.

◆ operator!=() [2/3]

template<typename WRES , typename HRES >
bool zxeco::Area< WRES, HRES >::operator!= ( const Area< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Unequality.

Definition at line 583 of file ZXGraphics.h.

◆ to_string() [2/9]

template<typename WRES , typename HRES >
std::string zxeco::Area< WRES, HRES >::to_string ( bool  withtype = true) const
inline

#include <ZXGraphics.h>

< Return a string with the textual information of the area.

Definition at line 587 of file ZXGraphics.h.

◆ getPixArea() [1/2]

PixArea zxeco::getPixArea ( const CharArea cc)
inline

#include <ZXGraphics.h>

Convert a char area to a pix area covering the same region on screen.

Definition at line 618 of file ZXGraphics.h.

◆ getPixArea() [2/2]

PixArea zxeco::getPixArea ( const CharPixArea cc)
inline

#include <ZXGraphics.h>

Convert a char-pix area to a pix area covering the same region on screen.

Definition at line 623 of file ZXGraphics.h.

◆ getCharPixArea()

CharPixArea zxeco::getCharPixArea ( const CharArea cc)
inline

#include <ZXGraphics.h>

Convert a char area to a char-pix area covering the same region on screen.

Definition at line 627 of file ZXGraphics.h.

◆ theEmpty() [2/2]

template<typename WRES , typename HRES >
static const Rect & zxeco::Rect< WRES, HRES >::theEmpty ( void  )
inlinestaticnoexcept

#include <ZXGraphics.h>

Return a reference to an inmutable empty rectangle of this type.

Definition at line 652 of file ZXGraphics.h.

◆ Rect()

template<typename WRES , typename HRES >
zxeco::Rect< WRES, HRES >::Rect ( const cursor_type c = cursor_type{0,0},
const area_type a = area_type{0,0} 
)
inline

#include <ZXGraphics.h>

Default constructor: empty rectangle.

Definition at line 658 of file ZXGraphics.h.

◆ empty() [2/2]

template<typename WRES , typename HRES >
bool zxeco::Rect< WRES, HRES >::empty ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Return TRUE if the rectangle area is empty.

Definition at line 662 of file ZXGraphics.h.

◆ contains()

template<typename WRES , typename HRES >
bool zxeco::Rect< WRES, HRES >::contains ( const cursor_type cur) const
noexcept

#include <ZXGraphics.h>

Return TRUE if CUR is inside the rectangle.

Definition at line 1557 of file ZXGraphics.h.

◆ bottomRight()

template<typename WRES , typename HRES >
cursor_type zxeco::Rect< WRES, HRES >::bottomRight ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

< Return the coordinates of the bottom-right extreme within the rectangle

Definition at line 668 of file ZXGraphics.h.

◆ applyConstrainedDiffs()

template<typename WRES , typename HRES >
bool zxeco::Rect< WRES, HRES >::applyConstrainedDiffs ( IntDist xdiff,
IntDist ydiff,
const Rect< WRES, HRES > &  oth 
)
noexcept

#include <ZXGraphics.h>

Apply the given increments to the corner of THIS, keeping it within OTH.

Return TRUE if the corner has changed. XDIFF and YDIFF are changed to contain the actual changes made under the constraints.

Definition at line 1564 of file ZXGraphics.h.

◆ compose()

template<typename WRES , typename HRES >
Rect zxeco::Rect< WRES, HRES >::compose ( const Rect< WRES, HRES > &  reloth) const
inline

#include <ZXGraphics.h>

< Return the RELOTH region of THIS as a rectangle.

< This serves to define rectangles that are relative to others (contained into others), like RELOTH, that is relative to THIS, and to get the absolute rectangle equivalent to them. This method does not detect any error in the definition of the rectangles, nor if RELOTH is not contained into THIS.

Definition at line 681 of file ZXGraphics.h.

◆ subRect()

template<typename WRES , typename HRES >
Rect zxeco::Rect< WRES, HRES >::subRect ( const cursor_type reltopleft) const
inline

#include <ZXGraphics.h>

< Return the absolute sub-rectangle that starts at RELTOPLEFT within this

Definition at line 691 of file ZXGraphics.h.

◆ intersect()

template<typename WRES , typename HRES >
Rect< WRES, HRES > zxeco::Rect< WRES, HRES >::intersect ( const Rect< WRES, HRES > &  oth) const
noexcept

#include <ZXGraphics.h>

Return the rectangle resulting from the intersection of this and OTH.

Return an empty rectangle placed at (0,0) if no such intersection exists.

Definition at line 1593 of file ZXGraphics.h.

◆ align_area()

template<typename WRES , typename HRES >
Rect< WRES, HRES > zxeco::Rect< WRES, HRES >::align_area ( const area_type areaneeded,
char  horalign,
char  vertalign 
) const

#include <ZXGraphics.h>

Return the portion of this rectangle that contains AREANEEDED aligned.

Throw if AREANEEDED cannot enter within this rectangle. The rectangle returned corner is in the same absolute reference system as this rectangle, not relative to it.

Parameters
horalignmust be one of 'C' (center), 'R' (right) or 'L' (left).
vertalignmust be one of 'M' (middle), 'B' (bottom) or 'T' (top).

Definition at line 1628 of file ZXGraphics.h.

◆ operator==() [3/3]

template<typename WRES , typename HRES >
bool zxeco::Rect< WRES, HRES >::operator== ( const Rect< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Equality.

Definition at line 712 of file ZXGraphics.h.

◆ operator!=() [3/3]

template<typename WRES , typename HRES >
bool zxeco::Rect< WRES, HRES >::operator!= ( const Rect< WRES, HRES > &  oth) const
inlinenoexcept

#include <ZXGraphics.h>

< Unequality.

Definition at line 716 of file ZXGraphics.h.

◆ to_string() [3/9]

template<typename WRES , typename HRES >
std::string zxeco::Rect< WRES, HRES >::to_string ( bool  withtype = true) const
inline

#include <ZXGraphics.h>

< Return a string with the textual information of the rectangle.

Definition at line 720 of file ZXGraphics.h.

◆ getPixRect() [1/2]

PixRect zxeco::getPixRect ( const CharRect cc)
inline

#include <ZXGraphics.h>

Convert a char rect to a pix rect representing the same region on screen.

Definition at line 748 of file ZXGraphics.h.

◆ getPixRect() [2/2]

PixRect zxeco::getPixRect ( const CharPixRect cc)
inline

#include <ZXGraphics.h>

Convert a char-pix rect to a pix rect representing the same region.

Definition at line 752 of file ZXGraphics.h.

◆ getCharPixRect()

CharPixRect zxeco::getCharPixRect ( const CharRect cc)
inline

#include <ZXGraphics.h>

Convert a char rect to a char-pix rect representing the same region.

Definition at line 756 of file ZXGraphics.h.

◆ DoubleArea() [1/2]

zxeco::DoubleArea::DoubleArea ( const CharArea area = CharArea::theEmpty())
inline

#include <ZXGraphics.h>

Definition at line 778 of file ZXGraphics.h.

◆ DoubleArea() [2/2]

zxeco::DoubleArea::DoubleArea ( const CharArea carea,
const PixArea parea 
)
inline

#include <ZXGraphics.h>

Definition at line 783 of file ZXGraphics.h.

◆ to_string() [4/9]

std::string zxeco::DoubleArea::to_string ( void  ) const
inline

#include <ZXGraphics.h>

Definition at line 791 of file ZXGraphics.h.

◆ DoubleRect() [1/2]

zxeco::DoubleRect::DoubleRect ( const CharRect rect = CharRect::theEmpty())
inline

#include <ZXGraphics.h>

Definition at line 808 of file ZXGraphics.h.

◆ DoubleRect() [2/2]

zxeco::DoubleRect::DoubleRect ( const CharRect crect,
const PixRect prect 
)
inline

#include <ZXGraphics.h>

Definition at line 813 of file ZXGraphics.h.

◆ to_string() [5/9]

std::string zxeco::DoubleRect::to_string ( void  ) const
inline

#include <ZXGraphics.h>

Definition at line 820 of file ZXGraphics.h.

◆ LinearGraphic() [1/3]

zxeco::LinearGraphic::LinearGraphic ( size_t  s)

#include <ZXGraphics.h>

Construct an empty graphic of the given size, yet to be filled.

S can be 0.

◆ LinearGraphic() [2/3]

zxeco::LinearGraphic::LinearGraphic ( uint8_t *  bs,
size_t  s 
)

#include <ZXGraphics.h>

Construct a graphic that is held externally (NO OWNERSHIP to this).

S must be > 0.

◆ LinearGraphic() [3/3]

zxeco::LinearGraphic::LinearGraphic ( LinearGraphic oth,
size_t  firstoff,
size_t  chunksize,
size_t  gap,
size_t  numchunks 
)

#include <ZXGraphics.h>

Construct a graphic referring to part of another one (no ownership).

This graphic will refer in all operations to a part of OTH that begins at FIRSTOFF (in OTH) and has a number NUMCHUNKS of contiguous chunks of CHUNKSIZE (>0) separated by GAP bytes from each other. OTH must outlive this object and cannot be onebyte.

Note
A LinearGraphic may be created this way referring to a LinearGraphic that was also created this way, and so on. Notice, however, that the longer the chain, the slower some operations.

◆ external()

bool zxeco::LinearGraphic::external ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Whether the object refers to part of another linear graphic.

Definition at line 900 of file ZXGraphics.h.

◆ owner()

bool zxeco::LinearGraphic::owner ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Whether the object owns the graphical data.

Return TRUE if this object owns the graphical data and thus will delete them at destruction.

Definition at line 903 of file ZXGraphics.h.

◆ size()

size_t zxeco::LinearGraphic::size ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Size in memory, in bytes.

Return the size in bytes of the graphic content, even when ONEBYTE == TRUE (that is, in that case the size will not be necessarily 1) or when it refers to an external linear graphic (in that case the size is the sum of bytes accessible from this object).

Definition at line 907 of file ZXGraphics.h.

◆ oneByte()

bool zxeco::LinearGraphic::oneByte ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Return TRUE if the graphic content is compressed into one byte.

Definition at line 913 of file ZXGraphics.h.

◆ setByte() [1/2]

void zxeco::LinearGraphic::setByte ( size_t  offset,
uint8_t  b 
)

#include <ZXGraphics.h>

Change the byte at the given offset inside the data.

If the graphic is onebyte or the offset is invalid, throw an exception.

◆ setByteUnsafe()

void zxeco::LinearGraphic::setByteUnsafe ( size_t  offset,
uint8_t  b 
)
noexcept

#include <ZXGraphics.h>

Change the byte at the given offset without checking anything.

If the graphic is onebyte, do nothing.

◆ setAllBytes()

void zxeco::LinearGraphic::setAllBytes ( uint8_t  b)
noexcept

#include <ZXGraphics.h>

Set all bytes of the graphic to the given value.

Works correctly either if this graphic is onebyte-filled or not.

◆ merge() [1/4]

void zxeco::LinearGraphic::merge ( size_t  destoffset,
const LinearGraphic oth,
size_t  origoffset,
size_t  howmany,
GraphOp  op = GraphOp::COPY 
)

#include <ZXGraphics.h>

Merge HOWMANY bytes from OTH (at ORIGOFFSET) into this (at DESTOFFSET).

Uses the byte operation indicated by OP. If any of the offsets get out of range, or the destination graphic is oneByte(), throws.

◆ mergeUnsafe()

void zxeco::LinearGraphic::mergeUnsafe ( size_t  destoffset,
const LinearGraphic oth,
size_t  origoffset,
size_t  howmany,
GraphOp  op = GraphOp::COPY 
)

#include <ZXGraphics.h>

Merge HOWMANY bytes from OTH (at ORIGOFFSET) into this (at DESTOFFSET).

Uses the byte operation indicated by OP. No out of ranges are detected. If this graphic is oneByte(), do nothing.

◆ compare()

int zxeco::LinearGraphic::compare ( const LinearGraphic oth,
bool  withinv = false 
) const
noexcept

#include <ZXGraphics.h>

Compare this graphic to OTH and return 1 if both are equal.

Both are considered equal if they have the same dimensions and content (byte by byte). If WITHINV == TRUE and the content are the same but inversed (one-complement) in all bytes, they are also considered equal and -1 is returned. In any case they are not equal, 0 is returned.

◆ similarity()

size_t zxeco::LinearGraphic::similarity ( const LinearGraphic oth) const
noexcept

#include <ZXGraphics.h>

Return a measure of the bitmap similarity (bit by bit) between both.

Similarity is defined here as the total number of bits that are equal in both graphics; the returned value will be that number of bits. This method returns 0 if both graphics have different dimensions, and std::numeric_limits<size_t>::max() if they are both empty.

◆ DimsGraphic() [1/6]

template<typename HEIGHTRESOL >
zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic ( void  )
inline

#include <ZXGraphics.h>

Default constructor: empty graphic.

Definition at line 1024 of file ZXGraphics.h.

◆ DimsGraphic() [2/6]

template<typename HEIGHTRESOL >
zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic ( const AreaType a)
inline

#include <ZXGraphics.h>

Construct an undefined graphic of the given dimensions, to be filled.

Definition at line 1027 of file ZXGraphics.h.

◆ DimsGraphic() [3/6]

template<typename HEIGHTRESOL >
zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic ( const AreaType a,
uint8_t  b 
)
inline

#include <ZXGraphics.h>

Construct a graphic of the given dimensions filled with one byte (B).

Definition at line 1031 of file ZXGraphics.h.

◆ DimsGraphic() [4/6]

template<typename HEIGHTRESOL >
zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic ( uint8_t *  bs,
const AreaType a 
)
inline

#include <ZXGraphics.h>

Construct a graphic that is held externally (NO OWNERSHIP to this).

Definition at line 1036 of file ZXGraphics.h.

◆ DimsGraphic() [5/6]

template<typename HEIGHTRESOL >
zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic ( DimsGraphic< HEIGHTRESOL > &  g,
const RectType region,
bool  copy = true 
)

#include <ZXGraphics.h>

Construct a graphic that refers to a region within another one.

If the region is empty (0 width or height), take the entire region of G from the given corner to the G boundaries.

Parameters
copyindicates whether the region is copied into this graphic (taking ownerwhip of the copied data) or not (referring to G data and, therefore, requiring G to outlive this object). If it is copied, G is not modified by this constructor.

Definition at line 1786 of file ZXGraphics.h.

◆ DimsGraphic() [6/6]

template<typename HEIGHTRESOL >
zxeco::DimsGraphic< HEIGHTRESOL >::DimsGraphic ( DimsGraphic< HEIGHTRESOL > &&  oth)
inline

#include <ZXGraphics.h>

Move constructor.

Definition at line 1052 of file ZXGraphics.h.

◆ operator=() [1/2]

template<typename HEIGHTRESOL >
DimsGraphic & zxeco::DimsGraphic< HEIGHTRESOL >::operator= ( DimsGraphic< HEIGHTRESOL > &&  oth)
inline

#include <ZXGraphics.h>

Move assignment.

Definition at line 1056 of file ZXGraphics.h.

◆ offset()

template<typename HEIGHTRESOL >
size_t zxeco::DimsGraphic< HEIGHTRESOL >::offset ( const CursorType pos) const

#include <ZXGraphics.h>

Get the offset corresponding to the given coordinates in the graphic.

Throw if the coords are invalid.

Definition at line 1838 of file ZXGraphics.h.

◆ coords()

template<typename HEIGHTRESOL >
DimsGraphic< HEIGHTRESOL >::CursorType zxeco::DimsGraphic< HEIGHTRESOL >::coords ( size_t  offset) const

#include <ZXGraphics.h>

Get the coordinates of the given offset, if it is valid, or throws.

Definition at line 1850 of file ZXGraphics.h.

◆ getByte()

template<typename HEIGHTRESOL >
uint8_t zxeco::DimsGraphic< HEIGHTRESOL >::getByte ( const CursorType pos) const
inline

#include <ZXGraphics.h>

< Unhide the linear getByte() method hidden by the new getByte().

< Get that byte from the graphic or throw if the coordinates are wrong.

Definition at line 1072 of file ZXGraphics.h.

◆ setByte() [2/2]

template<typename HEIGHTRESOL >
void zxeco::DimsGraphic< HEIGHTRESOL >::setByte ( const CursorType pos,
uint8_t  b 
)
inline

#include <ZXGraphics.h>

< Unhide the linear setByte() method hidden by the new setByte().

Parameters
bChange the byte at the given coordinates by the new byte B. If the graphic has ONEBYTE == TRUE or the coordinates are outside the byte, throw an exception.

Definition at line 1079 of file ZXGraphics.h.

◆ merge() [2/4]

template<typename HEIGHTRESOL >
void zxeco::DimsGraphic< HEIGHTRESOL >::merge ( const DimsGraphic< HEIGHTRESOL > &  oth,
const CursorType pos,
GraphOp  mode = GraphOp::COPY 
)

#include <ZXGraphics.h>

Merge OTH at the given coordinates of this object with the given mode.

The portion of OTH that falls outside this object will be ignored. Raise an exception if this object is onebyte.

Definition at line 1859 of file ZXGraphics.h.

◆ scrollUp()

template<typename HEIGHTRESOL >
HEIGHTRESOL::type zxeco::DimsGraphic< HEIGHTRESOL >::scrollUp ( typename HEIGHTRESOL::type  howmany,
typename HEIGHTRESOL::type  upperrow,
uint8_t  fillb 
)
inline

#include <ZXGraphics.h>

Scroll HOWMANY rows of the graphic up, beginning at y-coord UPPERROW.

The scroll is done all the way down to the bottom of the graphic. UPPERROW indicates the first row (i.e., the one with smallest y-coord) that is scrolled up; rows higher than that will not be scrolled, but can be overwritten by lower rows that are scrolled (depending on HOWMANY). Fill the free space left at the bottom with FILLB. Return the upper row that will fall in the visible part of the graphic after scroll: if UPPERROW < HOWMANY, that is not equal to UPPERROW, since UPPERROW dissappears through the upper border in that case.

If HOWMANY is 0 or >= the height of the graphic, do nothing. If UPPERROW >= height of the graphic, no scroll is done. If the graphic has ONEBYTE==true, do nothing.

Definition at line 1104 of file ZXGraphics.h.

◆ to_string() [6/9]

template<typename HEIGHTRESOL >
std::string zxeco::DimsGraphic< HEIGHTRESOL >::to_string ( void  ) const

#include <ZXGraphics.h>

Return a text with the info of the graphic.

Definition at line 1891 of file ZXGraphics.h.

◆ graphicDimensionsTooLarge()

template<typename WIDTHRESOL , typename HEIGHTRESOL >
bool zxeco::graphicDimensionsTooLarge ( unsigned  sx,
unsigned  sy 
)
inlinenoexcept

#include <ZXGraphics.h>

< Return TRUE if SX,SY are too large to fit in WITHRESOL,HEIGHTRESOL.

Definition at line 1137 of file ZXGraphics.h.

◆ Bitmap()

zxeco::Bitmap::Bitmap ( DesktopInterface desktop,
const std::string &  pngfile 
)

#include <ZXGraphics.h>

< Reuse all constructor from Gr<PixelDistT>.

Construct a b&w bitmap from reading a png file and discarding color. If the image width is not a multiple of 8, takes the greatest multiple of 8 that is smaller than the image width; the rest of pixels are discarded. RGB colors with a average gray level smaller than 127 will be ink (1), otherwise paper (0). PNG transparency is ignored.

◆ merge() [3/4]

void zxeco::Bitmap::merge ( const Bitmap oth,
const PixCursor pos,
GraphOp  mode = GraphOp::COPY 
)

#include <ZXGraphics.h>

< Unhide the base merge() method hidden by the new merge().

Merge the given graphic at the given pixel coordinates in that mode. This is an additional overload of the merge() method in the parent class. To select this overload, you can explicitly use PixCursor in the second argument, or CharPixCursor if you wish the base version. Unlike the merge() method of the parent class, this works in pixel coordinates also for the width dimension, therefore allows to place OTH at any pixel of this graphic, not only on whole char boundaries. The portion of OTH that falls outside this graphic will be ignored. Raise an exception if this graphic is onebyte.

◆ to_string() [7/9]

std::string zxeco::Bitmap::to_string ( void  ) const
inline

#include <ZXGraphics.h>

Return a text with the info of the graphic.

Definition at line 1207 of file ZXGraphics.h.

◆ swapPaperInk()

void zxeco::Attrmap::swapPaperInk ( void  )

#include <ZXGraphics.h>

< Reuse all constructor from Gr<CharDistT>.

Swap paper and ink in all attributed of the attrmap.

◆ to_string() [8/9]

std::string zxeco::Attrmap::to_string ( void  ) const
inline

#include <ZXGraphics.h>

Return a text with the info of the graphic.

Definition at line 1237 of file ZXGraphics.h.

◆ DoubleGraphic() [1/5]

zxeco::DoubleGraphic::DoubleGraphic ( const CharArea dims)
inline

#include <ZXGraphics.h>

Constructor for a given size in characters.

Both the bitmap and the attrmap get a size that cover the same region.

Definition at line 1301 of file ZXGraphics.h.

◆ DoubleGraphic() [2/5]

zxeco::DoubleGraphic::DoubleGraphic ( uint8_t *  bs,
uint8_t *  as,
const CharArea a 
)
inline

#include <ZXGraphics.h>

Construct a graphic that is held externally (NO OWNERSHIP to this).

Definition at line 1307 of file ZXGraphics.h.

◆ DoubleGraphic() [3/5]

zxeco::DoubleGraphic::DoubleGraphic ( DoubleGraphic g,
const CharRect region,
bool  copy = true 
)
inline

#include <ZXGraphics.h>

Construct a graphic that refers to the same region within a bit/attrmap.

If the region is empty (0 width or height), take the entire region of G from the given corner to the G boundaries.

Parameters
copyindicates whether the region is copied into this graphic (taking ownerwhip of the copied data) or not (referring to G data and, therefore, requiring G to outlive this object). If it is copied, G will not be modified by this constructor.

Definition at line 1312 of file ZXGraphics.h.

◆ DoubleGraphic() [4/5]

zxeco::DoubleGraphic::DoubleGraphic ( DesktopInterface desktop,
const std::string &  pngfile,
const PNGConversionParms parms = {PNGConversionMode::ToNearestPlainPNGConversionSubmode::None} 
)

#include <ZXGraphics.h>

Constructor from a .png file.

Create the bitmap and the attrmap from the file. The algorithm used for deducing both is the same as in: http://jafma.net/software/zxscreen/

◆ DoubleGraphic() [5/5]

zxeco::DoubleGraphic::DoubleGraphic ( DoubleGraphic &&  oth)
inline

#include <ZXGraphics.h>

Definition at line 1333 of file ZXGraphics.h.

◆ operator=() [2/2]

DoubleGraphic & zxeco::DoubleGraphic::operator= ( DoubleGraphic &&  oth)
inline

#include <ZXGraphics.h>

Definition at line 1335 of file ZXGraphics.h.

◆ merge() [4/4]

void zxeco::DoubleGraphic::merge ( const DoubleGraphic oth,
const CharCursor pos,
LinearGraphic::GraphOp  mode = LinearGraphic::GraphOp::COPY 
)
inline

#include <ZXGraphics.h>

Merge both bitmap and attrmap of OTH at the given coordinates in MODE.

The portion of OTH that falls outside this graphic will be ignored. Raise an exception if this bitmap or attrmap are onebyte.

Definition at line 1346 of file ZXGraphics.h.

◆ savePNG()

void zxeco::DoubleGraphic::savePNG ( DesktopInterface desktop,
const std::string &  pngfile 
)

#include <ZXGraphics.h>

Save the double graphic into a PNG file.

Raise an exception if any error in the process.

◆ to_string() [9/9]

std::string zxeco::DoubleGraphic::to_string ( void  ) const
inline

#include <ZXGraphics.h>

Return a text with the info of the graphic.

Definition at line 1355 of file ZXGraphics.h.

◆ indexInPal()

RGBPalette::Index zxeco::DoubleGraphic::DitheringSystem::Color::indexInPal ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Definition at line 1406 of file ZXGraphics.h.

◆ firstExtreme()

RGBPalette::Index zxeco::DoubleGraphic::DitheringSystem::Color::firstExtreme ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Definition at line 1411 of file ZXGraphics.h.

◆ secondExtreme()

RGBPalette::Index zxeco::DoubleGraphic::DitheringSystem::Color::secondExtreme ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Definition at line 1413 of file ZXGraphics.h.

◆ ditherLevel()

DitherLevel zxeco::DoubleGraphic::DitheringSystem::Color::ditherLevel ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Definition at line 1415 of file ZXGraphics.h.

◆ notDithered()

bool zxeco::DoubleGraphic::DitheringSystem::Color::notDithered ( void  ) const
inlinenoexcept

#include <ZXGraphics.h>

Definition at line 1417 of file ZXGraphics.h.

◆ equalExtremesOrder()

bool zxeco::DoubleGraphic::DitheringSystem::Color::equalExtremesOrder ( const Color oc) const
inlinenoexcept

#include <ZXGraphics.h>

Definition at line 1420 of file ZXGraphics.h.

◆ equalExtremesNotOrder()

bool zxeco::DoubleGraphic::DitheringSystem::Color::equalExtremesNotOrder ( const Color oc) const
inlinenoexcept

#include <ZXGraphics.h>

Definition at line 1423 of file ZXGraphics.h.

◆ equalExtremes()

bool zxeco::DoubleGraphic::DitheringSystem::Color::equalExtremes ( const Color oc) const
inlinenoexcept

#include <ZXGraphics.h>

Definition at line 1426 of file ZXGraphics.h.

◆ DitheringSystem()

zxeco::DoubleGraphic::DitheringSystem::DitheringSystem ( NumDithLevels  nlvs)
inline

#include <ZXGraphics.h>

Definition at line 1452 of file ZXGraphics.h.

◆ numDithLevels()

constexpr NumDithLevels zxeco::DoubleGraphic::DitheringSystem::numDithLevels ( void  ) const
inlineconstexprnoexcept

#include <ZXGraphics.h>

Definition at line 1460 of file ZXGraphics.h.

◆ maxDithLevel()

constexpr NumDithLevels zxeco::DoubleGraphic::DitheringSystem::maxDithLevel ( void  ) const
inlineconstexprnoexcept

#include <ZXGraphics.h>

Definition at line 1463 of file ZXGraphics.h.

◆ inverseDithLevel()

constexpr DitherLevel zxeco::DoubleGraphic::DitheringSystem::inverseDithLevel ( DitherLevel  dl) const
inlineconstexprnoexcept

#include <ZXGraphics.h>

Definition at line 1466 of file ZXGraphics.h.

◆ numClusters()

constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::numClusters ( void  ) const
inlineconstexprnoexcept

#include <ZXGraphics.h>

Definition at line 1469 of file ZXGraphics.h.

◆ totalColors()

constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::totalColors ( void  ) const
inlineconstexprnoexcept

#include <ZXGraphics.h>

Definition at line 1472 of file ZXGraphics.h.

◆ deployColor() [1/2]

Color zxeco::DoubleGraphic::DitheringSystem::deployColor ( const RGBColor rgb) const
inline

#include <ZXGraphics.h>

Definition at line 1480 of file ZXGraphics.h.

◆ deployColor() [2/2]

Color zxeco::DoubleGraphic::DitheringSystem::deployColor ( RGBPalette::Index  palind) const
inline

#include <ZXGraphics.h>

Definition at line 1483 of file ZXGraphics.h.

◆ LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INV >()

template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INV > ( uint8_t  b0,
uint8_t  b1 
)
constexprnoexcept

#include <ZXGraphics.h>

Definition at line 1684 of file ZXGraphics.h.

◆ LinearGraphic::doGraphOp< LinearGraphic::GraphOp::OR >()

template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::OR > ( uint8_t  b0,
uint8_t  b1 
)
constexprnoexcept

#include <ZXGraphics.h>

Definition at line 1690 of file ZXGraphics.h.

◆ LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INVOR >()

template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INVOR > ( uint8_t  b0,
uint8_t  b1 
)
constexprnoexcept

#include <ZXGraphics.h>

Definition at line 1696 of file ZXGraphics.h.

◆ LinearGraphic::doGraphOp< LinearGraphic::GraphOp::AND >()

template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::AND > ( uint8_t  b0,
uint8_t  b1 
)
constexprnoexcept

#include <ZXGraphics.h>

Definition at line 1702 of file ZXGraphics.h.

◆ LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INVAND >()

template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INVAND > ( uint8_t  b0,
uint8_t  b1 
)
constexprnoexcept

#include <ZXGraphics.h>

Definition at line 1708 of file ZXGraphics.h.

◆ LinearGraphic::doGraphOp< LinearGraphic::GraphOp::XOR >()

template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::XOR > ( uint8_t  b0,
uint8_t  b1 
)
constexprnoexcept

#include <ZXGraphics.h>

Definition at line 1714 of file ZXGraphics.h.

◆ LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INVXOR >()

template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::INVXOR > ( uint8_t  b0,
uint8_t  b1 
)
constexprnoexcept

#include <ZXGraphics.h>

Definition at line 1720 of file ZXGraphics.h.

Variable Documentation

◆ kMaxPixelCoord

constexpr PixelCoord zxeco::kMaxPixelCoord = std::numeric_limits<PixelCoord>::max()
constexpr

#include <ZXGraphics.h>

Maximum value of a pixel coordinate.

Definition at line 105 of file ZXGraphics.h.

◆ kMaxCharCoord

constexpr CharCoord zxeco::kMaxCharCoord = std::numeric_limits<CharCoord>::max()
constexpr

#include <ZXGraphics.h>

Maximum value of a char coordinate.

Definition at line 108 of file ZXGraphics.h.

◆ kMaxPixelDist

constexpr PixelDist zxeco::kMaxPixelDist = std::numeric_limits<PixelDist>::max()
constexpr

#include <ZXGraphics.h>

Maximum value of a pixel distance.

Definition at line 111 of file ZXGraphics.h.

◆ kMaxCharDist

constexpr CharDist zxeco::kMaxCharDist = std::numeric_limits<CharDist>::max()
constexpr

#include <ZXGraphics.h>

Maximum value of a char distance.

Definition at line 114 of file ZXGraphics.h.

◆ kMinIntDist

constexpr IntDist zxeco::kMinIntDist = std::numeric_limits<IntDist>::min()
constexpr

#include <ZXGraphics.h>

Minimum value of an int distance.

Definition at line 117 of file ZXGraphics.h.

◆ kMaxIntDist

constexpr IntDist zxeco::kMaxIntDist = std::numeric_limits<IntDist>::max()
constexpr

#include <ZXGraphics.h>

Maximum value of an int distance.

Definition at line 120 of file ZXGraphics.h.

◆ kMaxBorderCoord

constexpr BorderCoord zxeco::kMaxBorderCoord = std::numeric_limits<BorderCoord>::max()
constexpr

#include <ZXGraphics.h>

Maximum value of a border pixel coordinate.

Definition at line 123 of file ZXGraphics.h.

◆ kMaxBorderDist

constexpr BorderDist zxeco::kMaxBorderDist = std::numeric_limits<BorderDist>::max()
constexpr

#include <ZXGraphics.h>

Maximum value of a border pixel distance.

Definition at line 126 of file ZXGraphics.h.

◆ SCREENW

constexpr PixelDist zxeco::SCREENW = 256
constexpr

#include <ZXGraphics.h>

Width in pixels of the original zx screen.

Definition at line 186 of file ZXGraphics.h.

◆ SCREENH

constexpr PixelDist zxeco::SCREENH = 192
constexpr

#include <ZXGraphics.h>

Height in pixels of the original zx screen.

Definition at line 188 of file ZXGraphics.h.

◆ TOPBORDERH

constexpr BorderDist zxeco::TOPBORDERH = 56
constexpr

#include <ZXGraphics.h>

Height in pixels of the original zx visible border in its top section.

Note that 8 of those pixels were hidden, 56 visible.

Definition at line 190 of file ZXGraphics.h.

◆ BOTTOMBORDERH

constexpr BorderDist zxeco::BOTTOMBORDERH = 56
constexpr

#include <ZXGraphics.h>

Height in pixels of the original zx visible border in its bottom section.

Definition at line 193 of file ZXGraphics.h.

◆ LEFTBORDERW

constexpr BorderDist zxeco::LEFTBORDERW = 32
constexpr

#include <ZXGraphics.h>

Height in pixels of the original zx visible border in its left section.

Definition at line 195 of file ZXGraphics.h.

◆ RIGHTBORDERW

constexpr BorderDist zxeco::RIGHTBORDERW = 64
constexpr

#include <ZXGraphics.h>

Height in pixels of the original zx visible border in its right section.

Definition at line 197 of file ZXGraphics.h.

◆ SCREENCHARCOLS

constexpr CharDist zxeco::SCREENCHARCOLS = 32
constexpr

#include <ZXGraphics.h>

Number of char columns in the screen.

Definition at line 199 of file ZXGraphics.h.

◆ SCREENCHARROWS

constexpr CharDist zxeco::SCREENCHARROWS = 24
constexpr

#include <ZXGraphics.h>

Number of char rows in the screen.

Definition at line 201 of file ZXGraphics.h.

◆ BITMAPLEN

constexpr size_t zxeco::BITMAPLEN = 6144
constexpr

#include <ZXGraphics.h>

Length in memory (bytes) of the original zx screen bitmap.

Definition at line 203 of file ZXGraphics.h.

◆ ATTRMAPLEN

constexpr size_t zxeco::ATTRMAPLEN = 768
constexpr

#include <ZXGraphics.h>

Length in memory (bytes) of the original zx screen attrmap.

Definition at line 205 of file ZXGraphics.h.

◆ DISPLAYLEN

constexpr size_t zxeco::DISPLAYLEN = BITMAPLEN + ATTRMAPLEN
constexpr

#include <ZXGraphics.h>

Length in memory (bytes) of the original complete zx screen.

Definition at line 207 of file ZXGraphics.h.

◆ SCREENROWS

constexpr CharDist zxeco::SCREENROWS = pixelDistToCharDist(SCREENH)
constexpr

#include <ZXGraphics.h>

Number of rows in the screen of the original ZX.

Definition at line 232 of file ZXGraphics.h.

◆ SCREENCOLS

constexpr CharDist zxeco::SCREENCOLS = pixelDistToCharDist(SCREENW)
constexpr

#include <ZXGraphics.h>

Number of columns in the screen of the original ZX.

Definition at line 235 of file ZXGraphics.h.

◆ name [1/7]

constexpr const char* zxeco::CharCoordT::name = "CharC"
staticconstexpr

Name of numeric type.

Definition at line 271 of file ZXGraphics.h.

◆ value [1/7]

type zxeco::CharCoordT::value

To hold values of that type.

Definition at line 273 of file ZXGraphics.h.

◆ name [2/7]

constexpr const char* zxeco::PixelCoordT::name = "PixC"
staticconstexpr

Name of numeric type.

Definition at line 281 of file ZXGraphics.h.

◆ value [2/7]

type zxeco::PixelCoordT::value

To hold values of that type.

Definition at line 283 of file ZXGraphics.h.

◆ name [3/7]

constexpr const char* zxeco::CharDistT::name = "CharD"
staticconstexpr

Name of numeric type.

Definition at line 293 of file ZXGraphics.h.

◆ value [3/7]

type zxeco::CharDistT::value

To hold values of that type.

Definition at line 295 of file ZXGraphics.h.

◆ name [4/7]

constexpr const char* zxeco::PixelDistT::name = "PixD"
staticconstexpr

Name of numeric type.

Definition at line 305 of file ZXGraphics.h.

◆ value [4/7]

type zxeco::PixelDistT::value

To hold values of that type.

Definition at line 307 of file ZXGraphics.h.

◆ name [5/7]

constexpr const char* zxeco::IntDistT::name = "IntD"
staticconstexpr

Name of numeric type.

Definition at line 316 of file ZXGraphics.h.

◆ value [5/7]

type zxeco::IntDistT::value

To hold values of that type.

Definition at line 318 of file ZXGraphics.h.

◆ name [6/7]

constexpr const char* zxeco::BorderCoordT::name = "BorderC"
staticconstexpr

Name of numeric type.

Definition at line 326 of file ZXGraphics.h.

◆ value [6/7]

type zxeco::BorderCoordT::value

To hold values of that type.

Definition at line 328 of file ZXGraphics.h.

◆ name [7/7]

constexpr const char* zxeco::BorderDistT::name = "BorderD"
staticconstexpr

Name of numeric type.

Definition at line 338 of file ZXGraphics.h.

◆ value [7/7]

type zxeco::BorderDistT::value

To hold values of that type.

Definition at line 340 of file ZXGraphics.h.

◆ x

template<typename WRES , typename HRES >
WidthType::type zxeco::Cursor< WRES, HRES >::x

Coordinate in width (horizontally).

Definition at line 365 of file ZXGraphics.h.

◆ y

template<typename WRES , typename HRES >
HeightType::type zxeco::Cursor< WRES, HRES >::y

Coordinates in height (vertically).

Definition at line 366 of file ZXGraphics.h.

◆ width

template<typename WRES , typename HRES >
WidthType::type zxeco::Area< WRES, HRES >::width

width of the area.

Definition at line 512 of file ZXGraphics.h.

◆ height

template<typename WRES , typename HRES >
HeightType::type zxeco::Area< WRES, HRES >::height

height of the area.

Definition at line 513 of file ZXGraphics.h.

◆ corner

template<typename WRES , typename HRES >
cursor_type zxeco::Rect< WRES, HRES >::corner

Top-left corner.

Definition at line 649 of file ZXGraphics.h.

◆ area

template<typename WRES , typename HRES >
area_type zxeco::Rect< WRES, HRES >::area

Width and height.

Definition at line 650 of file ZXGraphics.h.

◆ chararea

CharArea zxeco::DoubleArea::chararea

Char resolution.

Definition at line 772 of file ZXGraphics.h.

◆ pixarea

PixArea zxeco::DoubleArea::pixarea

Pixel resolution.

Definition at line 773 of file ZXGraphics.h.

◆ charrect

CharRect zxeco::DoubleRect::charrect

Char resolution.

Definition at line 802 of file ZXGraphics.h.

◆ pixrect

PixRect zxeco::DoubleRect::pixrect

Pixel resolution.

Definition at line 803 of file ZXGraphics.h.

◆ owner_

bool zxeco::LinearGraphic::owner_
protected

Definition at line 971 of file ZXGraphics.h.

◆ s_

size_t zxeco::LinearGraphic::s_
protected

Definition at line 972 of file ZXGraphics.h.

◆ thebyte [1/2]

uint8_t zxeco::LinearGraphic::thebyte

Definition at line 983 of file ZXGraphics.h.

◆  [2/2]

uint8_t { ... } ::thebyte

Definition at line 983 of file ZXGraphics.h.

◆ bytes [1/2]

uint8_t* zxeco::LinearGraphic::bytes

Definition at line 984 of file ZXGraphics.h.

◆  [2/2]

uint8_t* { ... } ::bytes

Definition at line 984 of file ZXGraphics.h.

◆ other [1/2]

LinearGraphic* zxeco::LinearGraphic::other

Definition at line 986 of file ZXGraphics.h.

◆  [2/2]

LinearGraphic* { ... } ::other

Definition at line 986 of file ZXGraphics.h.

◆ firstoff [1/2]

size_t zxeco::LinearGraphic::firstoff

Definition at line 987 of file ZXGraphics.h.

◆  [2/2]

size_t { ... } ::firstoff

Definition at line 987 of file ZXGraphics.h.

◆ chunksize [1/2]

size_t zxeco::LinearGraphic::chunksize

Definition at line 988 of file ZXGraphics.h.

◆  [2/2]

size_t { ... } ::chunksize

Definition at line 988 of file ZXGraphics.h.

◆ gap [1/2]

size_t zxeco::LinearGraphic::gap

Definition at line 989 of file ZXGraphics.h.

◆  [2/2]

size_t { ... } ::gap

Definition at line 989 of file ZXGraphics.h.

◆ numchunks [1/2]

size_t zxeco::LinearGraphic::numchunks

Definition at line 990 of file ZXGraphics.h.

◆  [2/2]

size_t { ... } ::numchunks

Definition at line 990 of file ZXGraphics.h.

◆ dims

template<typename HEIGHTRESOL >
AreaType zxeco::DimsGraphic< HEIGHTRESOL >::dims

Dimensions of the graphic.

Definition at line 1019 of file ZXGraphics.h.

◆ mode

PNGConversionMode zxeco::DoubleGraphic::PNGConversionParms::mode

Mode for conversion.

Definition at line 1276 of file ZXGraphics.h.

◆ submode

PNGConversionSubmode zxeco::DoubleGraphic::PNGConversionParms::submode

Submode.

Definition at line 1277 of file ZXGraphics.h.

◆ numlevels [1/2]

NumDithLevels zxeco::DoubleGraphic::PNGConversionParms::numlevels

Number of dithering levels.

Usually the minimum (3) is the best for a ZX result with noise, since in ZX pixels are so large that having a lot of levels just confuses the viewer. 21 is the best for fixedpattern.

Definition at line 1281 of file ZXGraphics.h.

◆  [2/2]

NumDithLevels { ... } ::numlevels

Number of dithering levels.

Usually the minimum (3) is the best for a ZX result with noise, since in ZX pixels are so large that having a lot of levels just confuses the viewer. 21 is the best for fixedpattern.

Definition at line 1281 of file ZXGraphics.h.

◆ bitmap

Bitmap zxeco::DoubleGraphic::bitmap

Definition at line 1295 of file ZXGraphics.h.

◆ attrmap

Attrmap zxeco::DoubleGraphic::attrmap

Definition at line 1296 of file ZXGraphics.h.

◆ kMinDiths

constexpr NumDithLevels zxeco::DoubleGraphic::DitheringSystem::kMinDiths = 3
staticconstexpr

Definition at line 1385 of file ZXGraphics.h.

◆ kMaxDiths

constexpr NumDithLevels zxeco::DoubleGraphic::DitheringSystem::kMaxDiths = 101
staticconstexpr

Definition at line 1386 of file ZXGraphics.h.

◆ kNumPureColors

constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::kNumPureColors
staticconstexpr
Initial value:
=
static constexpr RGBPalette::Size NUMLINEARCOLORS
Number of linear colors. Black is counted twice, being equal w & w/o br.
Definition: ZXColors.h:201

Definition at line 1388 of file ZXGraphics.h.

◆ kNumColorsButBright

constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::kNumColorsButBright
staticconstexpr
Initial value:

Definition at line 1390 of file ZXGraphics.h.

◆ kClusterSizeButBright

constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::kClusterSizeButBright
staticconstexpr
Initial value:
=
(kNumColorsButBright - 1) *
kNumColorsButBright /
2

Definition at line 1392 of file ZXGraphics.h.

◆ kClusterSize

constexpr RGBPalette::Size zxeco::DoubleGraphic::DitheringSystem::kClusterSize
staticconstexpr
Initial value:
=
kClusterSizeButBright * 2

Definition at line 1396 of file ZXGraphics.h.

◆ DitheringSystem

friend zxeco::DoubleGraphic::DitheringSystem::Color::DitheringSystem

Definition at line 1404 of file ZXGraphics.h.