Add monochrome rendering modes

These modes can be used to see the inner workings of colourful artworks that
frequently use "foreground colour, new background, foreground colour",
particularly to show exactly which colours are represented by set or clear
sixels.

One mode renders all characters in white on a black background and the other
mode renders black characters on a white background. The latter could be used
to save ink if the resulting image is printed.

Flash is suppressed in these mono modes, this may or may not change.
This commit is contained in:
Gavin MacGregor
2024-12-01 17:44:58 +00:00
parent 26b5974421
commit 48a2b48964
5 changed files with 110 additions and 74 deletions

View File

@@ -49,11 +49,13 @@ class TeletextPageRender : public QObject
Q_OBJECT
public:
enum RenderMode { RenderNormal, RenderMix, RenderWhiteOnBlack, RenderBlackOnWhite };
TeletextPageRender();
~TeletextPageRender();
QImage* image(int i) const { return m_pageImage[i]; };
bool mix() const { return m_mix; };
RenderMode renderMode() const { return m_renderMode; };
void setDecoder(TeletextPageDecode *decoder);
void renderPage(bool force=false);
bool showControlCodes() const { return m_showControlCodes; };
@@ -61,7 +63,7 @@ public:
public slots:
void colourChanged(int index);
void setReveal(bool reveal);
void setMix(bool mix);
void setRenderMode(RenderMode renderMode);
void setShowControlCodes(bool showControlCodes);
signals:
@@ -71,7 +73,8 @@ protected:
TeletextFontBitmap m_fontBitmap;
QImage* m_pageImage[6];
unsigned char m_controlCodeCache[25][40];
bool m_reveal, m_mix, m_showControlCodes;
RenderMode m_renderMode;
bool m_reveal, m_showControlCodes;
int m_flashBuffersHz;
int m_flashingRow[25];