2012-10-24 08:36:10 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright 2011, Blender Foundation.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*
|
|
|
|
|
* Contributor:
|
|
|
|
|
* Jeroen Bakker
|
|
|
|
|
* Monique Dewanchand
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _COM_PixelateOperation_h_
|
|
|
|
|
#define _COM_PixelateOperation_h_
|
|
|
|
|
|
|
|
|
|
#include "COM_NodeOperation.h"
|
|
|
|
|
|
2012-10-24 13:43:32 +00:00
|
|
|
/**
|
|
|
|
|
* @brief Pixelate operation
|
|
|
|
|
*
|
|
|
|
|
* The Tile compositor is by default sub-pixel accurate.
|
|
|
|
|
* For some setups you don want this.
|
|
|
|
|
* This operation will remove the sub-pixel accuracy
|
|
|
|
|
*/
|
2012-10-24 08:36:10 +00:00
|
|
|
class PixelateOperation : public NodeOperation {
|
|
|
|
|
private:
|
2012-10-24 13:43:32 +00:00
|
|
|
/**
|
2012-11-12 07:33:01 +00:00
|
|
|
* @brief cached reference to the input operation
|
2012-10-24 13:43:32 +00:00
|
|
|
*/
|
2012-10-24 09:07:54 +00:00
|
|
|
SocketReader *m_inputOperation;
|
2012-10-24 08:36:10 +00:00
|
|
|
public:
|
2012-10-24 13:43:32 +00:00
|
|
|
/**
|
|
|
|
|
* @brief PixelateOperation
|
|
|
|
|
* @param dataType the datatype to create this operator for (saves datatype conversions)
|
|
|
|
|
*/
|
2012-10-24 09:07:54 +00:00
|
|
|
PixelateOperation(DataType dataType);
|
2012-10-24 13:43:32 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief initialization of the execution
|
|
|
|
|
*/
|
2012-10-24 09:07:54 +00:00
|
|
|
void initExecution();
|
2012-10-24 13:43:32 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief de-initialization of the execution
|
|
|
|
|
*/
|
2012-10-24 09:07:54 +00:00
|
|
|
void deinitExecution();
|
2012-10-24 13:43:32 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief executePixel
|
|
|
|
|
* @param output result
|
|
|
|
|
* @param x x-coordinate
|
|
|
|
|
* @param y y-coordinate
|
|
|
|
|
* @param sampler sampler
|
|
|
|
|
*/
|
2012-10-24 09:07:54 +00:00
|
|
|
void executePixel(float output[4], float x, float y, PixelSampler sampler);
|
2012-10-24 08:36:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|