openMSX
|
Abstract base class for OpenGL scalers. More...
#include <GLScaler.hh>
Public Member Functions | |
virtual | ~GLScaler ()=default |
void | setup (bool superImpose) |
Setup scaler. | |
virtual void | scaleImage (gl::ColorTexture &src, gl::ColorTexture *superImpose, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, unsigned dstStartY, unsigned dstEndY, unsigned dstWidth, unsigned logSrcHeight)=0 |
Scales the image in the given area, which must consist of lines which are all equally wide. | |
virtual void | uploadBlock (unsigned srcStartY, unsigned srcEndY, unsigned lineWidth, FrameSource &paintFrame) |
Protected Member Functions | |
GLScaler (const std::string &progName) | |
void | execute (const gl::ColorTexture &src, const gl::ColorTexture *superImpose, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, unsigned dstStartY, unsigned dstEndY, unsigned dstWidth, unsigned logSrcHeight, bool textureFromZero=false) |
Helper method to draw a rectangle with multiple texture coordinates. | |
Protected Attributes | |
std::array< gl::BufferObject, 2 > | vbo |
std::array< gl::ShaderProgram, 2 > | program |
std::array< GLint, 2 > | unifTexSize |
std::array< GLint, 2 > | unifMvpMatrix |
Abstract base class for OpenGL scalers.
A scaler is an algorithm that converts low-res graphics to hi-res graphics.
Definition at line 15 of file GLScaler.hh.
|
virtualdefault |
|
explicitprotected |
Definition at line 13 of file GLScaler.cc.
References program, tmpStrCat(), unifMvpMatrix, unifTexSize, and xrange().
|
protected |
Helper method to draw a rectangle with multiple texture coordinates.
This method is similar to Texture::drawRect() but it calculates a seconds set of texture coordinates. The first tex-coords are used for the MSX texture (texture unit 0), and are calculated from src{Start,End}Y and src.getHeight(). The second set of tex-coord are used for the superimpose texture (texture unit 1) and are calculated from src{Start,End}Y and logSrcHeight.
src | |
superImpose | |
srcStartY | |
srcEndY | |
srcWidth | |
dstStartY | |
dstEndY | |
dstWidth | |
logSrcHeight | |
textureFromZero | If true, the texture coordinates of subpixels will start from zero: for example in 4x zoom the source coordinates will be 0.0, 0.25, 0.5, 0.75. If false, the texture coordinates of subpixels will be centered: for example in 4x zoom the source coordinates will be 0.125, 0.375, 0.625, 0.875. |
Definition at line 48 of file GLScaler.cc.
References gl::Texture::bind(), gl::ColorTexture::getHeight(), unifTexSize, and vbo.
Referenced by openmsx::GLDefaultScaler::scaleImage(), openmsx::GLHQLiteScaler::scaleImage(), openmsx::GLHQScaler::scaleImage(), openmsx::GLRGBScaler::scaleImage(), openmsx::GLScaleNxScaler::scaleImage(), openmsx::GLSimpleScaler::scaleImage(), and openmsx::GLTVScaler::scaleImage().
|
pure virtual |
Scales the image in the given area, which must consist of lines which are all equally wide.
Scaling factor depends on the concrete scaler.
src | Source: texture containing the frame to be scaled. |
superImpose | Texture containing the to-be-superimposed image (can be nullptr). |
srcStartY | Y-coordinate of the top source line (inclusive). |
srcEndY | Y-coordinate of the bottom source line (exclusive). |
srcWidth | The number of pixels per line for the given area. |
dstStartY | Y-coordinate of the top destination line (inclusive). |
dstEndY | Y-coordinate of the bottom destination line (exclusive). |
dstWidth | The number of pixels per line on the output screen. |
logSrcHeight | The logical height of the complete src texture (actual texture height can be double as high in case of non-interlace). This is needed to translate src-Y-coordinates to superImpose-Y-coordinates. |
Implemented in openmsx::GLDefaultScaler, openmsx::GLHQLiteScaler, openmsx::GLHQScaler, openmsx::GLRGBScaler, openmsx::GLScaleNxScaler, openmsx::GLSimpleScaler, and openmsx::GLTVScaler.
Referenced by openmsx::GLHQLiteScaler::scaleImage(), openmsx::GLHQScaler::scaleImage(), openmsx::GLRGBScaler::scaleImage(), openmsx::GLScaleNxScaler::scaleImage(), and openmsx::GLSimpleScaler::scaleImage().
void openmsx::GLScaler::setup | ( | bool | superImpose | ) |
Setup scaler.
Must be called once per frame before calling scaleImage() (possibly multiple times).
Definition at line 40 of file GLScaler.cc.
References gl::context, program, and unifMvpMatrix.
Referenced by openmsx::GLDefaultScaler::scaleImage(), openmsx::GLHQLiteScaler::scaleImage(), openmsx::GLHQScaler::scaleImage(), openmsx::GLRGBScaler::scaleImage(), openmsx::GLScaleNxScaler::scaleImage(), openmsx::GLSimpleScaler::scaleImage(), and openmsx::GLTVScaler::scaleImage().
|
virtual |
Reimplemented in openmsx::GLHQLiteScaler, and openmsx::GLHQScaler.
Definition at line 34 of file GLScaler.cc.
|
protected |
Definition at line 85 of file GLScaler.hh.
Referenced by openmsx::GLHQLiteScaler::GLHQLiteScaler(), openmsx::GLHQScaler::GLHQScaler(), openmsx::GLRGBScaler::GLRGBScaler(), GLScaler(), openmsx::GLSimpleScaler::GLSimpleScaler(), openmsx::GLTVScaler::GLTVScaler(), and setup().
|
protected |
Definition at line 87 of file GLScaler.hh.
Referenced by GLScaler(), and setup().
|
protected |
Definition at line 86 of file GLScaler.hh.
Referenced by execute(), and GLScaler().
|
protected |
Definition at line 84 of file GLScaler.hh.
Referenced by execute().