1#ifndef OUTPUTSURFACE_HH
2#define OUTPUTSURFACE_HH
61 return sizeof(
Pixel) == 2
72 assert(
sizeof(
Pixel) != 4);
84 if constexpr (
sizeof(
Pixel) == 2) {
85 return (p != getKeyColor<Pixel>())
87 : getKeyColorClash<Pixel>();
89 assert(p != getKeyColor<Pixel>());
100 return mapKeyedRGB255<Pixel>(
gl::ivec3(rgb * 255.0f));
A frame buffer where pixels can be written to.
const PixelFormat & getPixelFormat() const
uint32_t mapRGB255(gl::ivec3 rgb) const
Same as mapRGB, but RGB components are in range [0..255].
gl::ivec2 getPhysicalSize() const
Pixel mapKeyedRGB255(gl::ivec3 rgb)
Returns the pixel value for the given RGB color.
int getLogicalWidth() const
void setPixelFormat(const PixelFormat &format)
gl::vec2 getViewScale() const
gl::ivec2 getLogicalSize() const
bool isViewScaled() const
gl::ivec2 getViewOffset() const
OutputSurface(const OutputSurface &)=delete
void calculateViewPort(gl::ivec2 logSize, gl::ivec2 physSize)
virtual ~OutputSurface()=default
void setOpenGlPixelFormat()
gl::ivec2 getViewSize() const
int getLogicalHeight() const
Pixel mapKeyedRGB(gl::vec3 rgb)
Returns the pixel value for the given RGB color.
virtual void saveScreenshot(const std::string &filename)=0
Save the content of this OutputSurface to a PNG file.
uint32_t mapRGB(gl::vec3 rgb) const
Returns the pixel value for the given RGB color.
Pixel getKeyColorClash() const
Returns a color that is visually very close to the key color.
OutputSurface & operator=(const OutputSurface &)=delete
Pixel getKeyColor() const
Returns the color key for this output surface.
void format(SectorAccessibleDisk &disk, MSXBootSectorType bootType)
Format the given disk (= a single partition).
This file implemented 3 utility functions: