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
24 void setup(bool superImpose);
25
42 virtual void scaleImage(
43 gl::ColorTexture& src, gl::ColorTexture* superImpose,
44 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
45 unsigned dstStartY, unsigned dstEndY, unsigned dstWidth,
46 unsigned logSrcHeight) = 0;
47
48 virtual void uploadBlock(
49 unsigned srcStartY, unsigned srcEndY,
50 unsigned lineWidth, FrameSource& paintFrame);
51
52protected:
53 explicit GLScaler(const std::string& progName);
54
77 void execute(const gl::ColorTexture& src, const gl::ColorTexture* superImpose,
78 unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
79 unsigned dstStartY, unsigned dstEndY, unsigned dstWidth,
80 unsigned logSrcHeight,
81 bool textureFromZero = false);
82
83protected:
84 std::array<gl::BufferObject, 2> vbo;
85 std::array<gl::ShaderProgram, 2> program;
86 std::array<GLint, 2> unifTexSize;
87 std::array<GLint, 2> unifMvpMatrix;
88};
89
90} // namespace openmsx
91
92#endif // GLSCALER_HH
Interface for getting lines from a video frame.
Abstract base class for OpenGL scalers.
Definition GLScaler.hh:16
void setup(bool superImpose)
Setup scaler.
Definition GLScaler.cc:40
std::array< gl::ShaderProgram, 2 > program
Definition GLScaler.hh:85
std::array< GLint, 2 > unifTexSize
Definition GLScaler.hh:86
std::array< GLint, 2 > unifMvpMatrix
Definition GLScaler.hh:87
std::array< gl::BufferObject, 2 > vbo
Definition GLScaler.hh:84
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.
Definition GLScaler.cc:48
virtual ~GLScaler()=default
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:11