2
-----------------------------------------------------------------------------
3
This source file is part of blendTex library
5
Copyright (c) 2007 The Zdeno Ash Miklas
7
This program is free software; you can redistribute it and/or modify it under
8
the terms of the GNU Lesser General Public License as published by the Free Software
9
Foundation; either version 2 of the License, or (at your option) any later
12
This program is distributed in the hope that it will be useful, but WITHOUT
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
You should have received a copy of the GNU Lesser General Public License along with
17
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
19
http://www.gnu.org/copyleft/lesser.txt.
20
-----------------------------------------------------------------------------
2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
* Copyright (c) 2007 The Zdeno Ash Miklas
20
* This source file is part of blendTex library
24
* ***** END GPL LICENSE BLOCK *****
23
27
/** \file FilterSource.h
24
28
* \ingroup bgevideotex
27
31
#ifndef __FILTERSOURCE_H__
28
32
#define __FILTERSOURCE_H__
97
100
{ VT_RGBA(val,src[2],src[1],src[0],0xFF); return val; }
103
/// class for Z_buffer conversion
104
class FilterZZZA : public FilterBase
110
virtual ~FilterZZZA (void) {}
112
/// get source pixel size
113
virtual unsigned int getPixelSize (void) { return 1; }
116
/// filter pixel, source float buffer
117
virtual unsigned int filter (float * src, short x, short y,
118
short * size, unsigned int pixSize, unsigned int val)
120
// calculate gray value
121
// convert float to unsigned char
122
unsigned int depth = int(src[0] * 255);
123
// return depth scale value
134
/// class for Z_buffer conversion
135
class FilterDEPTH : public FilterBase
139
FilterDEPTH (void) {}
141
virtual ~FilterDEPTH (void) {}
143
/// get source pixel size
144
virtual unsigned int getPixelSize (void) { return 1; }
147
/// filter pixel, source float buffer
148
virtual unsigned int filter (float * src, short x, short y,
149
short * size, unsigned int pixSize, unsigned int val)
151
/* Copy the float value straight away
152
* The user can retrieve the original float value by using
153
* 'F' mode in BGL buffer */
154
memcpy(&val, src, sizeof (unsigned int));
100
162
/// class for YV12 conversion
101
163
class FilterYV12 : public FilterBase