2
* Copyright 2011, Blender Foundation.
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.
23
#ifndef _COM_ConvertOperation_h
24
#define _COM_ConvertOperation_h
26
#include "COM_NodeOperation.h"
29
class ConvertBaseOperation : public NodeOperation {
31
SocketReader *m_inputOperation;
34
ConvertBaseOperation();
37
void deinitExecution();
41
class ConvertValueToColorOperation : public ConvertBaseOperation {
43
ConvertValueToColorOperation();
45
void executePixel(float output[4], float x, float y, PixelSampler sampler);
49
class ConvertColorToValueOperation : public ConvertBaseOperation {
51
ConvertColorToValueOperation();
53
void executePixel(float output[4], float x, float y, PixelSampler sampler);
57
class ConvertColorToBWOperation : public ConvertBaseOperation {
59
ConvertColorToBWOperation();
61
void executePixel(float output[4], float x, float y, PixelSampler sampler);
65
class ConvertColorToVectorOperation : public ConvertBaseOperation {
67
ConvertColorToVectorOperation();
69
void executePixel(float output[4], float x, float y, PixelSampler sampler);
73
class ConvertValueToVectorOperation : public ConvertBaseOperation {
75
ConvertValueToVectorOperation();
77
void executePixel(float output[4], float x, float y, PixelSampler sampler);
81
class ConvertVectorToColorOperation : public ConvertBaseOperation {
83
ConvertVectorToColorOperation();
85
void executePixel(float output[4], float x, float y, PixelSampler sampler);
89
class ConvertVectorToValueOperation : public ConvertBaseOperation {
91
ConvertVectorToValueOperation();
93
void executePixel(float output[4], float x, float y, PixelSampler sampler);
97
class ConvertRGBToYCCOperation : public ConvertBaseOperation {
99
/** YCbCr mode (Jpeg, ITU601, ITU709) */
102
ConvertRGBToYCCOperation();
104
void executePixel(float output[4], float x, float y, PixelSampler sampler);
106
/** Set the YCC mode */
107
void setMode(int mode);
111
class ConvertYCCToRGBOperation : public ConvertBaseOperation {
113
/** YCbCr mode (Jpeg, ITU601, ITU709) */
116
ConvertYCCToRGBOperation();
118
void executePixel(float output[4], float x, float y, PixelSampler sampler);
120
/** Set the YCC mode */
121
void setMode(int mode);
125
class ConvertRGBToYUVOperation : public ConvertBaseOperation {
127
ConvertRGBToYUVOperation();
129
void executePixel(float output[4], float x, float y, PixelSampler sampler);
133
class ConvertYUVToRGBOperation : public ConvertBaseOperation {
135
ConvertYUVToRGBOperation();
137
void executePixel(float output[4], float x, float y, PixelSampler sampler);
141
class ConvertRGBToHSVOperation : public ConvertBaseOperation {
143
ConvertRGBToHSVOperation();
145
void executePixel(float output[4], float x, float y, PixelSampler sampler);
149
class ConvertHSVToRGBOperation : public ConvertBaseOperation {
151
ConvertHSVToRGBOperation();
153
void executePixel(float output[4], float x, float y, PixelSampler sampler);
157
class ConvertPremulToStraightOperation : public ConvertBaseOperation {
159
ConvertPremulToStraightOperation();
161
void executePixel(float output[4], float x, float y, PixelSampler sampler);
165
class ConvertStraightToPremulOperation : public ConvertBaseOperation {
167
ConvertStraightToPremulOperation();
169
void executePixel(float output[4], float x, float y, PixelSampler sampler);
173
class SeparateChannelOperation : public NodeOperation {
175
SocketReader *m_inputOperation;
178
SeparateChannelOperation();
179
void executePixel(float output[4], float x, float y, PixelSampler sampler);
181
void initExecution();
182
void deinitExecution();
184
void setChannel(int channel) { this->m_channel = channel; }
188
class CombineChannelsOperation : public NodeOperation {
190
SocketReader *m_inputChannel1Operation;
191
SocketReader *m_inputChannel2Operation;
192
SocketReader *m_inputChannel3Operation;
193
SocketReader *m_inputChannel4Operation;
195
CombineChannelsOperation();
196
void executePixel(float output[4], float x, float y, PixelSampler sampler);
198
void initExecution();
199
void deinitExecution();