openMSX
Public Member Functions | Protected Member Functions | List of all members
openmsx::GLScaler Class Referenceabstract

Abstract base class for OpenGL scalers. More...

#include <GLScaler.hh>

Inheritance diagram for openmsx::GLScaler:
Inheritance graph
[legend]

Public Member Functions

 GLScaler ()
 
virtual ~GLScaler ()
 
virtual void scaleImage (ColorTexture &src, 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. More...
 
virtual void uploadBlock (unsigned srcStartY, unsigned srcEndY, unsigned lineWidth, FrameSource &paintFrame)
 

Protected Member Functions

void drawMultiTex (ColorTexture &src, unsigned srcStartY, unsigned srcEndY, float physSrcHeight, float logSrcHeight, unsigned dstStartY, unsigned dstEndY, unsigned dstWidth, bool textureFromZero=false)
 Helper method to draw a rectangle with multiple texture coordinates. More...
 

Detailed Description

Abstract base class for OpenGL scalers.

A scaler is an algorithm that converts low-res graphics to hi-res graphics.

Definition at line 13 of file GLScaler.hh.

Constructor & Destructor Documentation

openmsx::GLScaler::GLScaler ( )
openmsx::GLScaler::~GLScaler ( )
virtual

Definition at line 19 of file GLScaler.cc.

Member Function Documentation

void openmsx::GLScaler::drawMultiTex ( ColorTexture src,
unsigned  srcStartY,
unsigned  srcEndY,
float  physSrcHeight,
float  logSrcHeight,
unsigned  dstStartY,
unsigned  dstEndY,
unsigned  dstWidth,
bool  textureFromZero = false 
)
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 (textur unit 0), and are calculated from src{Start,End}Y and physSrcHeight. 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.

Parameters
src
srcStartY
srcEndY
physSrcHeight
logSrcHeight
dstStartY
dstEndY
dstWidth
textureFromZeroIf 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 openmsx::Texture::bind().

Referenced by openmsx::GLSaIScaler::scaleImage(), openmsx::GLScaleNxScaler::scaleImage(), openmsx::GLHQScaler::scaleImage(), openmsx::GLHQLiteScaler::scaleImage(), openmsx::GLSimpleScaler::scaleImage(), openmsx::GLTVScaler::scaleImage(), openmsx::GLRGBScaler::scaleImage(), and scaleImage().

void openmsx::GLScaler::scaleImage ( ColorTexture src,
ColorTexture superImpose,
unsigned  srcStartY,
unsigned  srcEndY,
unsigned  srcWidth,
unsigned  dstStartY,
unsigned  dstEndY,
unsigned  dstWidth,
unsigned  logSrcHeight 
)
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.

Parameters
srcSource: texture containing the frame to be scaled.
superImposeTexture containing the to-be-superimposed image (can be nullptr).
srcStartYY-coordinate of the top source line (inclusive).
srcEndYY-coordinate of the bottom source line (exclusive).
srcWidthThe number of pixels per line for the given area.
dstStartYY-coordinate of the top destination line (inclusive).
dstEndYY-coordinate of the bottom destination line (exclusive).
dstWidthThe number of pixels per line on the output screen.
logSrcHeightThe 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::GLRGBScaler, openmsx::GLSimpleScaler, openmsx::GLTVScaler, openmsx::GLHQLiteScaler, openmsx::GLHQScaler, openmsx::GLSaIScaler, and openmsx::GLScaleNxScaler.

Definition at line 29 of file GLScaler.cc.

References openmsx::ShaderProgram::activate(), openmsx::Texture::bind(), openmsx::ShaderProgram::deactivate(), drawMultiTex(), and openmsx::ColorTexture::getHeight().

Referenced by openmsx::GLScaleNxScaler::scaleImage(), openmsx::GLHQLiteScaler::scaleImage(), and openmsx::GLHQScaler::scaleImage().

void openmsx::GLScaler::uploadBlock ( unsigned  srcStartY,
unsigned  srcEndY,
unsigned  lineWidth,
FrameSource paintFrame 
)
virtual

Reimplemented in openmsx::GLHQLiteScaler, and openmsx::GLHQScaler.

Definition at line 23 of file GLScaler.cc.


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