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 <string>
6 
7 namespace openmsx {
8 
9 class FrameSource;
10 
14 class GLScaler
15 {
16 public:
17  virtual ~GLScaler() = default;
18 
35  virtual void scaleImage(
36  gl::ColorTexture& src, gl::ColorTexture* superImpose,
37  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
38  unsigned dstStartY, unsigned dstEndY, unsigned dstWidth,
39  unsigned logSrcHeight) = 0;
40 
41  virtual void uploadBlock(
42  unsigned srcStartY, unsigned srcEndY,
43  unsigned lineWidth, FrameSource& paintFrame);
44 
45 protected:
46  explicit GLScaler(const std::string& progName);
47  void setup(bool superImpose);
48 
71  void execute(gl::ColorTexture& src, gl::ColorTexture* superImpose,
72  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
73  unsigned dstStartY, unsigned dstEndY, unsigned dstWidth,
74  unsigned logSrcHeight,
75  bool textureFromZero = false);
76 
77 protected:
80  GLint unifTexSize[2];
81 };
82 
83 } // namespace openmsx
84 
85 #endif // GLSCALER_HH
Wrapper around an OpenGL program: a collection of vertex and fragment shaders.
Definition: GLUtil.hh:388
Interface for getting lines from a video frame.
Definition: FrameSource.hh:16
Abstract base class for OpenGL scalers.
Definition: GLScaler.hh:15
void setup(bool superImpose)
Definition: GLScaler.cc:39
GLScaler(const std::string &progName)
Definition: GLScaler.cc:11
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:45
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:33
gl::BufferObject vbo[2]
Definition: GLScaler.hh:78
GLint unifTexSize[2]
Definition: GLScaler.hh:80
gl::ShaderProgram program[2]
Definition: GLScaler.hh:79
This file implemented 3 utility functions:
Definition: Autofire.cc:9