openMSX
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
openmsx::ImagePrinter Class Referenceabstract

#include <Printer.hh>

Inheritance diagram for openmsx::ImagePrinter:
Inheritance graph
[legend]
Collaboration diagram for openmsx::ImagePrinter:
Collaboration graph
[legend]

Classes

struct  FontInfo
 

Public Member Functions

void write (uint8_t data) override
 
void forceFormFeed () override
 
- Public Member Functions inherited from openmsx::PrinterCore
bool getStatus (EmuTime::param time) override
 Returns the STATUS signal: false = low = ready, true = high = not ready.
 
void setStrobe (bool strobe, EmuTime::param time) override
 Sets the strobe signal: false = low, true = high.
 
void writeData (uint8_t data, EmuTime::param time) override
 Sets the data signals.
 
void plugHelper (Connector &connector, EmuTime::param time) override
 
void unplugHelper (EmuTime::param time) override
 
- Public Member Functions inherited from openmsx::PrinterPortDevice
std::string_view getClass () const final
 A pluggable belongs to a certain class.
 
- Public Member Functions inherited from openmsx::Pluggable
virtual ~Pluggable ()=default
 
virtual std::string_view getName () const
 Name used to identify this pluggable.
 
virtual std::string_view getDescription () const =0
 Description for this pluggable.
 
void plug (Connector &connector, EmuTime::param time)
 This method is called when this pluggable is inserted in a connector.
 
void unplug (EmuTime::param time)
 This method is called when this pluggable is removed from a connector.
 
ConnectorgetConnector () const
 Get the connector this Pluggable is plugged into.
 
bool isPluggedIn () const
 Returns true if this pluggable is currently plugged into a connector.
 

Protected Types

enum  CountryCode {
  CC_USA = 0 , CC_FRANCE = 1 , CC_GERMANY = 2 , CC_UNITED_KINGDOM = 3 ,
  CC_DENMARK = 4 , CC_SWEDEN = 5 , CC_ITALY = 6 , CC_SPAIN = 7 ,
  CC_JAPAN = 8
}
 

Protected Member Functions

 ImagePrinter (MSXMotherBoard &motherBoard, bool graphicsHiLo)
 
 ~ImagePrinter () override
 
void resetEmulatedPrinter ()
 
void printGraphicByte (uint8_t data)
 
void seekPrinterHeadRelative (double offset)
 
void ensurePrintPage ()
 
void flushEmulatedPrinter ()
 
void printVisibleCharacter (uint8_t data)
 
void plot9Dots (double x, double y, unsigned pattern)
 
virtual std::pair< unsigned, unsigned > getNumberOfDots ()=0
 
virtual void resetSettings ()=0
 
virtual unsigned calcEscSequenceLength (uint8_t character)=0
 
virtual void processEscSequence ()=0
 
virtual void processCharacter (uint8_t data)=0
 
- Protected Member Functions inherited from openmsx::PrinterCore
 PrinterCore ()=default
 
 ~PrinterCore () override=default
 
- Protected Member Functions inherited from openmsx::Pluggable
 Pluggable ()
 
void setConnector (Connector *conn)
 

Protected Attributes

double graphDensity
 
double fontDensity
 
double hpos
 
double vpos
 
double pageTop
 
double lineFeed
 
double pageHeight
 
double printAreaTop = -1.0
 
double printAreaBottom = 0.0
 
double pixelSizeX
 
double pixelSizeY
 
int eightBit = 0
 
unsigned perforationSkip = 0
 
unsigned leftBorder
 
unsigned rightBorder
 
unsigned fontWidth
 
unsigned remainingCommandBytes = 0
 
unsigned sizeEscPos = 0
 
unsigned sizeRemainingDataBytes = 0
 
unsigned ramLoadOffset = 0
 
unsigned ramLoadEnd = 0
 
unsigned lines
 
CountryCode countryCode = CC_USA
 
std::array< uint8_t, MAX_ESC_CMDSIZEabEscSeq
 
struct openmsx::ImagePrinter::FontInfo fontInfo
 
bool letterQuality = false
 
bool bold = false
 
bool proportional = false
 
bool italic = false
 
bool superscript = false
 
bool subscript = false
 
bool doubleWidth = false
 
bool underline = false
 
bool doubleStrike = false
 
bool escSequence = false
 
bool alternateChar = false
 
bool detectPaperOut = false
 
bool japanese = false
 
bool normalAfterLine = false
 
bool ninePinGraphics = false
 
bool leftToRight = false
 
bool elite = false
 
bool compressed = false
 
bool noHighEscapeCodes = false
 

Static Protected Attributes

static constexpr unsigned PIXEL_WIDTH = 8
 
static constexpr int MAX_ESC_CMDSIZE = 8
 
static constexpr int MAX_FONT_WIDTH = 12
 

Detailed Description

Definition at line 51 of file Printer.hh.

Member Enumeration Documentation

◆ CountryCode

Enumerator
CC_USA 
CC_FRANCE 
CC_GERMANY 
CC_UNITED_KINGDOM 
CC_DENMARK 
CC_SWEDEN 
CC_ITALY 
CC_SPAIN 
CC_JAPAN 

Definition at line 100 of file Printer.hh.

Constructor & Destructor Documentation

◆ ImagePrinter()

openmsx::ImagePrinter::ImagePrinter ( MSXMotherBoard motherBoard,
bool  graphicsHiLo 
)
protected

Definition at line 86 of file Printer.cc.

◆ ~ImagePrinter()

openmsx::ImagePrinter::~ImagePrinter ( )
overrideprotected

Definition at line 97 of file Printer.cc.

References flushEmulatedPrinter().

Member Function Documentation

◆ calcEscSequenceLength()

virtual unsigned openmsx::ImagePrinter::calcEscSequenceLength ( uint8_t  character)
protectedpure virtual

Referenced by write().

◆ ensurePrintPage()

void openmsx::ImagePrinter::ensurePrintPage ( )
protected

Definition at line 193 of file Printer.cc.

References getNumberOfDots(), pixelSizeX, and pixelSizeY.

Referenced by printGraphicByte(), and printVisibleCharacter().

◆ flushEmulatedPrinter()

void openmsx::ImagePrinter::flushEmulatedPrinter ( )
protected

◆ forceFormFeed()

void openmsx::ImagePrinter::forceFormFeed ( )
overridevirtual

Implements openmsx::PrinterCore.

Definition at line 137 of file Printer.cc.

References flushEmulatedPrinter().

◆ getNumberOfDots()

virtual std::pair< unsigned, unsigned > openmsx::ImagePrinter::getNumberOfDots ( )
protectedpure virtual

Referenced by ensurePrintPage().

◆ plot9Dots()

void openmsx::ImagePrinter::plot9Dots ( double  x,
double  y,
unsigned  pattern 
)
protected

Definition at line 151 of file Printer.cc.

References pixelSizeY, and xrange().

Referenced by printGraphicByte(), and printVisibleCharacter().

◆ printGraphicByte()

void openmsx::ImagePrinter::printGraphicByte ( uint8_t  data)
protected

◆ printVisibleCharacter()

void openmsx::ImagePrinter::printVisibleCharacter ( uint8_t  data)
protected

◆ processCharacter()

virtual void openmsx::ImagePrinter::processCharacter ( uint8_t  data)
protectedpure virtual

Referenced by write().

◆ processEscSequence()

virtual void openmsx::ImagePrinter::processEscSequence ( )
protectedpure virtual

Referenced by write().

◆ resetEmulatedPrinter()

void openmsx::ImagePrinter::resetEmulatedPrinter ( )
protected

◆ resetSettings()

virtual void openmsx::ImagePrinter::resetSettings ( )
protectedpure virtual

Referenced by resetEmulatedPrinter().

◆ seekPrinterHeadRelative()

void openmsx::ImagePrinter::seekPrinterHeadRelative ( double  offset)
protected

◆ write()

void openmsx::ImagePrinter::write ( uint8_t  data)
overridevirtual

Member Data Documentation

◆ abEscSeq

std::array<uint8_t, MAX_ESC_CMDSIZE> openmsx::ImagePrinter::abEscSeq
protected

Definition at line 114 of file Printer.hh.

Referenced by write().

◆ alternateChar

bool openmsx::ImagePrinter::alternateChar = false
protected

Definition at line 135 of file Printer.hh.

◆ bold

bool openmsx::ImagePrinter::bold = false
protected

Definition at line 126 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ compressed

bool openmsx::ImagePrinter::compressed = false
protected

Definition at line 142 of file Printer.hh.

◆ countryCode

CountryCode openmsx::ImagePrinter::countryCode = CC_USA
protected

Definition at line 111 of file Printer.hh.

◆ detectPaperOut

bool openmsx::ImagePrinter::detectPaperOut = false
protected

Definition at line 136 of file Printer.hh.

◆ doubleStrike

bool openmsx::ImagePrinter::doubleStrike = false
protected

Definition at line 133 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ doubleWidth

bool openmsx::ImagePrinter::doubleWidth = false
protected

Definition at line 131 of file Printer.hh.

Referenced by printVisibleCharacter(), and seekPrinterHeadRelative().

◆ eightBit

int openmsx::ImagePrinter::eightBit = 0
protected

Definition at line 89 of file Printer.hh.

Referenced by write().

◆ elite

bool openmsx::ImagePrinter::elite = false
protected

Definition at line 141 of file Printer.hh.

◆ escSequence

bool openmsx::ImagePrinter::escSequence = false
protected

Definition at line 134 of file Printer.hh.

Referenced by write().

◆ fontDensity

double openmsx::ImagePrinter::fontDensity
protected

Definition at line 79 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ fontInfo

struct openmsx::ImagePrinter::FontInfo openmsx::ImagePrinter::fontInfo
protected

Referenced by printVisibleCharacter(), and write().

◆ fontWidth

unsigned openmsx::ImagePrinter::fontWidth
protected

Definition at line 93 of file Printer.hh.

◆ graphDensity

double openmsx::ImagePrinter::graphDensity
protected

Definition at line 78 of file Printer.hh.

Referenced by printGraphicByte().

◆ hpos

double openmsx::ImagePrinter::hpos
protected

◆ italic

bool openmsx::ImagePrinter::italic = false
protected

Definition at line 128 of file Printer.hh.

◆ japanese

bool openmsx::ImagePrinter::japanese = false
protected

Definition at line 137 of file Printer.hh.

◆ leftBorder

unsigned openmsx::ImagePrinter::leftBorder
protected

Definition at line 91 of file Printer.hh.

Referenced by flushEmulatedPrinter(), resetEmulatedPrinter(), and seekPrinterHeadRelative().

◆ leftToRight

bool openmsx::ImagePrinter::leftToRight = false
protected

Definition at line 140 of file Printer.hh.

◆ letterQuality

bool openmsx::ImagePrinter::letterQuality = false
protected

Definition at line 125 of file Printer.hh.

◆ lineFeed

double openmsx::ImagePrinter::lineFeed
protected

Definition at line 83 of file Printer.hh.

Referenced by resetEmulatedPrinter(), and seekPrinterHeadRelative().

◆ lines

unsigned openmsx::ImagePrinter::lines
protected

Definition at line 99 of file Printer.hh.

Referenced by resetEmulatedPrinter().

◆ MAX_ESC_CMDSIZE

constexpr int openmsx::ImagePrinter::MAX_ESC_CMDSIZE = 8
staticconstexprprotected

Definition at line 113 of file Printer.hh.

◆ MAX_FONT_WIDTH

constexpr int openmsx::ImagePrinter::MAX_FONT_WIDTH = 12
staticconstexprprotected

Definition at line 116 of file Printer.hh.

◆ ninePinGraphics

bool openmsx::ImagePrinter::ninePinGraphics = false
protected

Definition at line 139 of file Printer.hh.

◆ noHighEscapeCodes

bool openmsx::ImagePrinter::noHighEscapeCodes = false
protected

Definition at line 143 of file Printer.hh.

◆ normalAfterLine

bool openmsx::ImagePrinter::normalAfterLine = false
protected

Definition at line 138 of file Printer.hh.

Referenced by seekPrinterHeadRelative().

◆ pageHeight

double openmsx::ImagePrinter::pageHeight
protected

Definition at line 84 of file Printer.hh.

Referenced by resetEmulatedPrinter(), and seekPrinterHeadRelative().

◆ pageTop

double openmsx::ImagePrinter::pageTop
protected

Definition at line 82 of file Printer.hh.

Referenced by flushEmulatedPrinter(), and resetEmulatedPrinter().

◆ perforationSkip

unsigned openmsx::ImagePrinter::perforationSkip = 0
protected

Definition at line 90 of file Printer.hh.

◆ PIXEL_WIDTH

constexpr unsigned openmsx::ImagePrinter::PIXEL_WIDTH = 8
staticconstexprprotected

Definition at line 76 of file Printer.hh.

◆ pixelSizeX

double openmsx::ImagePrinter::pixelSizeX
protected

Definition at line 87 of file Printer.hh.

Referenced by ensurePrintPage(), printGraphicByte(), and printVisibleCharacter().

◆ pixelSizeY

double openmsx::ImagePrinter::pixelSizeY
protected

Definition at line 88 of file Printer.hh.

Referenced by ensurePrintPage(), plot9Dots(), printGraphicByte(), and printVisibleCharacter().

◆ printAreaBottom

double openmsx::ImagePrinter::printAreaBottom = 0.0
protected

Definition at line 86 of file Printer.hh.

Referenced by flushEmulatedPrinter(), printGraphicByte(), and printVisibleCharacter().

◆ printAreaTop

double openmsx::ImagePrinter::printAreaTop = -1.0
protected

Definition at line 85 of file Printer.hh.

Referenced by flushEmulatedPrinter(), printGraphicByte(), and printVisibleCharacter().

◆ proportional

bool openmsx::ImagePrinter::proportional = false
protected

Definition at line 127 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ ramLoadEnd

unsigned openmsx::ImagePrinter::ramLoadEnd = 0
protected

Definition at line 98 of file Printer.hh.

Referenced by write().

◆ ramLoadOffset

unsigned openmsx::ImagePrinter::ramLoadOffset = 0
protected

Definition at line 97 of file Printer.hh.

Referenced by write().

◆ remainingCommandBytes

unsigned openmsx::ImagePrinter::remainingCommandBytes = 0
protected

Definition at line 94 of file Printer.hh.

Referenced by write().

◆ rightBorder

unsigned openmsx::ImagePrinter::rightBorder
protected

Definition at line 92 of file Printer.hh.

Referenced by seekPrinterHeadRelative().

◆ sizeEscPos

unsigned openmsx::ImagePrinter::sizeEscPos = 0
protected

Definition at line 95 of file Printer.hh.

Referenced by write().

◆ sizeRemainingDataBytes

unsigned openmsx::ImagePrinter::sizeRemainingDataBytes = 0
protected

Definition at line 96 of file Printer.hh.

Referenced by write().

◆ subscript

bool openmsx::ImagePrinter::subscript = false
protected

Definition at line 130 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ superscript

bool openmsx::ImagePrinter::superscript = false
protected

Definition at line 129 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ underline

bool openmsx::ImagePrinter::underline = false
protected

Definition at line 132 of file Printer.hh.

Referenced by printVisibleCharacter().

◆ vpos

double openmsx::ImagePrinter::vpos
protected

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