openMSX
GLScaler.hh
Go to the documentation of this file.
1#ifndef GLSCALER_HH
2#define GLSCALER_HH
3
4#include "GLUtil.hh"
5#include <array>
6#include <string>
7
8namespace openmsx {
9
10class FrameSource;
11
16{
17public:
18 virtual ~GLScaler() = default;
19
36 virtual void scaleImage(
37 gl::ColorTexture& src, gl::ColorTexture* superImpose,
38 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
39 unsigned dstStartY, unsigned dstEndY, unsigned dstWidth,
40 unsigned logSrcHeight) = 0;
41
42 virtual void uploadBlock(
43 unsigned srcStartY, unsigned srcEndY,
44 unsigned lineWidth, FrameSource& paintFrame);
45
46protected:
47 explicit GLScaler(const std::string& progName);
48 void setup(bool superImpose);
49
72 void execute(gl::ColorTexture& src, gl::ColorTexture* superImpose,
73 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
74 unsigned dstStartY, unsigned dstEndY, unsigned dstWidth,
75 unsigned logSrcHeight,
76 bool textureFromZero = false);
77
78protected:
79 std::array<gl::BufferObject, 2> vbo;
80 std::array<gl::ShaderProgram, 2> program;
81 std::array<GLint, 2> unifTexSize;
82};
83
84} // namespace openmsx
85
86#endif // GLSCALER_HH
Interface for getting lines from a video frame.
Definition: FrameSource.hh:20
Abstract base class for OpenGL scalers.
Definition: GLScaler.hh:16
void setup(bool superImpose)
Definition: GLScaler.cc:40
GLScaler(const std::string &progName)
Definition: GLScaler.cc:12
std::array< gl::ShaderProgram, 2 > program
Definition: GLScaler.hh:80
std::array< GLint, 2 > unifTexSize
Definition: GLScaler.hh:81
std::array< gl::BufferObject, 2 > vbo
Definition: GLScaler.hh:79
virtual ~GLScaler()=default
void execute(gl::ColorTexture &src, 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.
Definition: GLScaler.cc:46
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)
Definition: GLScaler.cc:34
This file implemented 3 utility functions:
Definition: Autofire.cc:9