1 /* ***** BEGIN LICENSE BLOCK *****
5 * Copyright (c) 2008 BBC Research
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 * ***** END LICENSE BLOCK ***** */
46 Unknown
}; //how is the data packed?
49 void resize(int w
, int h
, DataFmt f
);
53 void convertPlanar16();
55 unsigned long frameNum
;
56 bool isLastFrame
; //mark the first and last frames in a sequence
59 DataFmt diskFormat
; //enumerated format read from the disk
60 DataFmt renderFormat
; //pixel packing used for openGL rendering
62 bool isPlanar
; //flag to indicate that we have a seperate texture for each component to copy to the GPU
64 GLenum glInternalFormat
; //format used to describe which components of the texture are applied to the texels
65 GLenum glFormat
; //format of the texture data, GL_LUMINANCE or GL_RGBA in these applications
66 GLenum glType
; //the data type for the texture, GL_UNSIGNED_BYTE, GL_INT etc...
67 int glMinMaxFilter
; //filter type for scaling the pixel data GL_LINEAR for planar, or GL_NEAREST for packed
68 int glYTextureWidth
; //the width of the Y texture, which may actually be UYVY data packed as RGBA. There
69 //will be half the number of RGBA quads as Y pixels across the image as each quad
70 //stores two luminance samples
72 int Ywidth
; //luminance dimensions in pixels
75 int Cwidth
; //chrominance dimensions in pixels
78 int dataSize
; //total allocation at *data
79 int YdataSize
; //number of bytes for each component
83 unsigned char *data
; //pointer to allocated block
84 unsigned char *Ydata
; //pointer to luminance, or multiplexed YCbCr
85 unsigned char *Udata
; //pointers to planar chrominance components, if format is planar
89 VideoData(const VideoData
&);
90 void operator= (const VideoData
&);
91 void allocate(int w
, int h
, DataFmt f
);