Valkka  0.17.0
OpenSource Video Management
tex.h
Go to the documentation of this file.
1 #ifndef TEX_HEADER_GUARD
2 #define TEX_HEADER_GUARD
3 
4 /*
5  * tex.h : Handling OpenGL textures.
6  *
7  * Copyright 2017, 2018 Valkka Security Ltd. and Sampsa Riikonen.
8  *
9  * Authors: Sampsa Riikonen <sampsa.riikonen@iki.fi>
10  *
11  * This file is part of the Valkka library.
12  *
13  * Valkka is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU Affero General Public License as
15  * published by the Free Software Foundation, either version 3 of the
16  * License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU Affero General Public License for more details.
22  *
23  * You should have received a copy of the GNU Affero General Public License
24  * along with this program. If not, see <https://www.gnu.org/licenses/>
25  *
26  */
27 
38 #include "frame.h"
39 #include "opengl.h"
40 #include "constant.h"
41 #include "macro.h"
42 
43 
47 class TEX {
48 
49 public:
56  virtual ~TEX();
57  ban_copy_ctor(TEX);
58  ban_copy_asm(TEX);
59 
60 
61 public: // format, dimensions
63  // BitmapPars source_bmpars; ///< Bitmap true dimensions
65  GLint format;
66 
67 public: // OpenGL reference data: indices
68  GLuint index;
69 };
70 
71 
72 
77 class YUVTEX : public TEX {
78 
79 public:
82  ~YUVTEX();
83  YUVTEX(const YUVTEX &f) : TEX(f) notice_ban_copy_ctor();
84  //ban_copy_ctor(YUVTEX); // must call TEX in the init list ..
85  ban_copy_asm(YUVTEX);
86 
87 public:
88  GLuint y_index;
89  GLuint u_index;
90  GLuint v_index;
91 
92 public:
93  void loadYUV(const GLubyte* Y, const GLubyte* U, const GLubyte* V);
94  void loadYUVFrame(YUVFrame *yuvframe);
95 };
96 
97 std::ostream &operator<<(std::ostream &os, YUVTEX const &m);
98 
99 #endif
100 
A class encapsulating information about an OpenGL texture set for a YUV pixmap (sizes, OpenGL reference ids, etc.)
Definition: tex.h:77
GLint format
OpenGL format of the texture.
Definition: tex.h:65
A GPU YUV frame.
Definition: frame.h:485
Constant/default values, version numbers.
For AVBitmapFrames, linesizes are the widths + padding bytes.
Definition: constant.h:129
OpenGL calls for reserving PBOs and TEXtures, plus some auxiliary routines.
BitmapPars bmpars
Max bitmap dimensions (pre-reserved)
Definition: tex.h:62
Frame classes.
GLuint y_index
internal OpenGL/GPU index referring to Y texture;
Definition: tex.h:88
GLuint v_index
internal OpenGL/GPU index referring to V texture;
Definition: tex.h:90
GLuint index
OpenGL reference.
Definition: tex.h:68
GLint internal_format
OpenGL internal format.
Definition: tex.h:64
GLuint u_index
internal OpenGL/GPU index referring to U texture;
Definition: tex.h:89
A class encapsulating information about an OpenGL texture set (sizes, OpenGL reference ids...
Definition: tex.h:47
virtual ~TEX()
Default virtual destructor.
Definition: tex.cpp:46
TEX(BitmapPars bmpars)
Default constructor.
Definition: tex.cpp:43