The ZX Ecosystem v5.1.0;_GUI_v3.1.0
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions | Variables
ZXGraphics.h File Reference
#include <string>
#include <cstdint>
#include <type_traits>
#include <limits>
#include <memory>
#include <utility>
#include <functional>
#include "zxecosystem/ancillary/CppAddons.h"
#include "zxecosystem/ancillary/ColorImages.h"
#include "zxecosystem/desktop/DesktopInterface.h"
#include "zxecosystem/base/ZXColors.h"
#include "zxecosystem/base/ZXChars.h"
Include dependency graph for ZXGraphics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  zxeco::CoordT
 Base class for all coordinate trait classes. More...
 
struct  zxeco::DistT
 Base class for all distance trait classes. More...
 
struct  zxeco::CharCoordT
 A class that makes CharCoord a different, distinguishable type from others. More...
 
struct  zxeco::PixelCoordT
 A class that makes PixelCoord a different, distinguishable type from others. More...
 
struct  zxeco::CharDistT
 A class that makes CharDist a different, distinguishable type from others. More...
 
struct  zxeco::PixelDistT
 A class that makes PixelDist a different, distinguishable type from others. More...
 
struct  zxeco::IntDistT
 A class that makes IntDist a different, distinguishable type from others. More...
 
struct  zxeco::BorderCoordT
 A class that makes BorderCoord a different, distinguishable type from others. More...
 
struct  zxeco::BorderDistT
 A class that makes BorderDist a different, distinguishable type from others. More...
 
class  zxeco::Cursor< WRES, HRES >
 A cursor on screen that uses the given coordinates resolution. More...
 
class  zxeco::Area< WRES, HRES >
 An area on the screen that uses the given distance resolutions. More...
 
struct  zxeco::Rect< WRES, HRES >
 A rectangle placed on the screen that uses the given resolutions. More...
 
class  zxeco::DoubleArea
 An area with both char and pixel resolutions, possibly synchronized. More...
 
class  zxeco::DoubleRect
 A rectangle with both char and pixel resolutions, possibly synchronized. More...
 
class  zxeco::LinearGraphic
 A rectangular graphic block. More...
 
class  zxeco::DimsGraphic< HEIGHTRESOL >
 A graphic that has certain 2D dimensions and coordinates. More...
 
class  zxeco::Bitmap
 A graphic that contains a bitmap, i.e., it has pixel resolution in height. More...
 
class  zxeco::Attrmap
 A graphic that contains an attrmap, i.e., it has char resolution in height. More...
 
class  zxeco::DoubleGraphic
 A bitmap plus an attrmap, possibly synchronized. More...
 
struct  zxeco::DoubleGraphic::PNGConversionParms
 Parameters for the conversion of PNG images into DoubleGraphic. More...
 
class  zxeco::DoubleGraphic::DitheringSystem::Color
 

Namespaces

namespace  zxeco
 The main namespace of the library, that spans across all the zx modules.
 

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::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::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::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...
 

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...
 
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...
 
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...
 
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...
 
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...
 
template<>
constexpr uint8_t zxeco::LinearGraphic::doGraphOp< LinearGraphic::GraphOp::COPY > (uint8_t b0, uint8_t b1) noexcept
 
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...
 
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...