openMSX
|
A frame buffer where pixels can be written to. More...
#include <OutputSurface.hh>
Public Member Functions | |
OutputSurface (const OutputSurface &)=delete | |
OutputSurface & | operator= (const OutputSurface &)=delete |
virtual | ~OutputSurface ()=default |
int | getLogicalWidth () const |
int | getLogicalHeight () const |
gl::ivec2 | getLogicalSize () const |
gl::ivec2 | getPhysicalSize () const |
gl::ivec2 | getViewOffset () const |
gl::ivec2 | getViewSize () const |
gl::vec2 | getViewScale () const |
bool | isViewScaled () const |
const PixelFormat & | getPixelFormat () const |
uint32_t | mapRGB (gl::vec3 rgb) const |
Returns the pixel value for the given RGB color. More... | |
uint32_t | mapRGB255 (gl::ivec3 rgb) const |
Same as mapRGB, but RGB components are in range [0..255]. More... | |
template<std::unsigned_integral Pixel> | |
Pixel | getKeyColor () const |
Returns the color key for this output surface. More... | |
template<std::unsigned_integral Pixel> | |
Pixel | getKeyColorClash () const |
Returns a color that is visually very close to the key color. More... | |
template<std::unsigned_integral Pixel> | |
Pixel | mapKeyedRGB255 (gl::ivec3 rgb) |
Returns the pixel value for the given RGB color. More... | |
template<std::unsigned_integral Pixel> | |
Pixel | mapKeyedRGB (gl::vec3 rgb) |
Returns the pixel value for the given RGB color. More... | |
virtual void | saveScreenshot (const std::string &filename)=0 |
Save the content of this OutputSurface to a PNG file. More... | |
Protected Member Functions | |
OutputSurface ()=default | |
void | calculateViewPort (gl::ivec2 logSize, gl::ivec2 physSize) |
void | setPixelFormat (const PixelFormat &format) |
void | setOpenGlPixelFormat () |
A frame buffer where pixels can be written to.
It could be an in-memory buffer or a video buffer visible to the user (see *OffScreenSurface and *VisibleSurface classes).
The OutputSurface class itself knows about its dimensions and pixel format. But the actual pixel storage is left for the subclasses.
Definition at line 20 of file OutputSurface.hh.
|
delete |
|
virtualdefault |
|
protecteddefault |
Definition at line 6 of file OutputSurface.cc.
References gl::min_component(), and gl::scale().
Referenced by openmsx::SDLGLOffScreenSurface::SDLGLOffScreenSurface(), openmsx::SDLOffScreenSurface::SDLOffScreenSurface(), and openmsx::SDLVisibleSurface::SDLVisibleSurface().
|
inline |
Returns the color key for this output surface.
Definition at line 59 of file OutputSurface.hh.
|
inline |
Returns a color that is visually very close to the key color.
The returned color can be used as an alternative for pixels that would otherwise have the key color.
Definition at line 70 of file OutputSurface.hh.
|
inline |
Definition at line 29 of file OutputSurface.hh.
Referenced by openmsx::DirectScalerOutput< Pixel >::getHeight(), and openmsx::GLScopedClip::GLScopedClip().
|
inline |
Definition at line 30 of file OutputSurface.hh.
Referenced by openmsx::SDLGLVisibleSurface::createConsoleLayer(), openmsx::SDLVisibleSurface::createConsoleLayer(), openmsx::SDLGLVisibleSurface::fullScreenUpdated(), openmsx::OSDTopWidget::getSize(), openmsx::GLPostProcessor::GLPostProcessor(), openmsx::GLPostProcessor::paint(), openmsx::SDLVisibleSurface::saveScreenshotSDL(), and openmsx::SDLGLOffScreenSurface::SDLGLOffScreenSurface().
|
inline |
Definition at line 28 of file OutputSurface.hh.
Referenced by openmsx::FBPostProcessor< Pixel >::FBPostProcessor(), openmsx::OSDWidget::getScaleFactor(), and openmsx::DirectScalerOutput< Pixel >::getWidth().
|
inline |
Definition at line 31 of file OutputSurface.hh.
Referenced by openmsx::SDLGLOffScreenSurface::SDLGLOffScreenSurface().
|
inline |
Definition at line 38 of file OutputSurface.hh.
Referenced by openmsx::SDLVisibleSurface::createSnowLayer(), openmsx::PostProcessor::getBpp(), mapRGB255(), openmsx::PostProcessor::PostProcessor(), openmsx::PostProcessor::rotateFrames(), and openmsx::SDLOffScreenSurface::SDLOffScreenSurface().
|
inline |
Definition at line 33 of file OutputSurface.hh.
Referenced by openmsx::GLScopedClip::GLScopedClip(), openmsx::GLPostProcessor::paint(), and openmsx::SDLGLVisibleSurface::saveScreenshotGL().
|
inline |
Definition at line 35 of file OutputSurface.hh.
Referenced by openmsx::GLScopedClip::GLScopedClip().
|
inline |
Definition at line 34 of file OutputSurface.hh.
Referenced by openmsx::GLPostProcessor::paint(), and openmsx::SDLGLVisibleSurface::saveScreenshotGL().
|
inline |
Definition at line 36 of file OutputSurface.hh.
Referenced by openmsx::GLPostProcessor::paint().
|
inline |
Returns the pixel value for the given RGB color.
It is guaranteed that the returned pixel value is different from the color key for this output surface.
Definition at line 98 of file OutputSurface.hh.
|
inline |
Returns the pixel value for the given RGB color.
It is guaranteed that the returned pixel value is different from the color key for this output surface.
Definition at line 81 of file OutputSurface.hh.
References mapRGB255().
|
inline |
Returns the pixel value for the given RGB color.
No effort is made to ensure that the returned pixel value is not the color key for this output surface.
Definition at line 44 of file OutputSurface.hh.
References mapRGB255().
|
inline |
Same as mapRGB, but RGB components are in range [0..255].
Definition at line 51 of file OutputSurface.hh.
References g, getPixelFormat(), and openmsx::PixelFormat::map().
Referenced by mapKeyedRGB255(), mapRGB(), and openmsx::SDLSnow< Pixel >::SDLSnow().
|
delete |
|
pure virtual |
Save the content of this OutputSurface to a PNG file.
MSXException | If creating the PNG file fails. |
Implemented in openmsx::SDLGLVisibleSurface, and openmsx::SDLVisibleSurface.
|
protected |
Definition at line 24 of file OutputSurface.cc.
References Endian::BIG, and setPixelFormat().
Referenced by openmsx::SDLGLOffScreenSurface::SDLGLOffScreenSurface(), and openmsx::SDLGLVisibleSurface::SDLGLVisibleSurface().
|
inlineprotected |
Definition at line 113 of file OutputSurface.hh.
References openmsx::DiskImageUtils::format().
Referenced by setOpenGlPixelFormat(), and openmsx::SDLOutputSurface::setSDLPixelFormat().