2012-06-04 15:49:58 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2012, 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
|
|
|
|
* Sergey Sharybin
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _COM_MaskOperation_h
|
|
|
|
#define _COM_MaskOperation_h
|
|
|
|
|
2012-07-12 20:10:41 +00:00
|
|
|
/* XXX, remove when the USE_RASKTER option is also removed */
|
|
|
|
extern "C" {
|
|
|
|
#include "BKE_mask.h"
|
|
|
|
}
|
|
|
|
|
2012-06-04 15:49:58 +00:00
|
|
|
#include "COM_NodeOperation.h"
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
#include "DNA_mask_types.h"
|
|
|
|
#include "BLI_listbase.h"
|
|
|
|
#include "IMB_imbuf_types.h"
|
|
|
|
|
2012-07-10 04:51:08 +00:00
|
|
|
#ifdef __PLX_RASKTER_MT__
|
|
|
|
#include "../../../../intern/raskter/raskter.h"
|
|
|
|
#endif
|
|
|
|
|
2012-06-04 15:49:58 +00:00
|
|
|
/**
|
2012-06-13 23:31:47 +00:00
|
|
|
* Class with implementation of mask rasterization
|
|
|
|
*/
|
2012-06-04 15:49:58 +00:00
|
|
|
class MaskOperation : public NodeOperation {
|
|
|
|
protected:
|
2012-06-26 01:22:05 +00:00
|
|
|
Mask *m_mask;
|
|
|
|
int m_maskWidth;
|
|
|
|
int m_maskHeight;
|
|
|
|
int m_framenumber;
|
|
|
|
bool m_do_smooth;
|
|
|
|
bool m_do_feather;
|
2012-07-12 20:10:41 +00:00
|
|
|
|
|
|
|
#ifdef USE_RASKTER
|
2012-06-26 01:22:05 +00:00
|
|
|
float *m_rasterizedMask;
|
2012-07-10 04:51:08 +00:00
|
|
|
|
2012-07-04 07:10:23 +00:00
|
|
|
ListBase m_maskLayers;
|
2012-06-04 15:49:58 +00:00
|
|
|
|
2012-07-12 20:10:41 +00:00
|
|
|
#else /* USE_RASKTER */
|
|
|
|
struct MaskRasterHandle *m_rasterMaskHandle;
|
|
|
|
#endif /* USE_RASKTER */
|
|
|
|
|
2012-06-04 15:49:58 +00:00
|
|
|
/**
|
2012-06-13 23:31:47 +00:00
|
|
|
* Determine the output resolution. The resolution is retrieved from the Renderer
|
|
|
|
*/
|
2012-06-04 15:49:58 +00:00
|
|
|
void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
|
|
|
|
|
|
|
|
public:
|
|
|
|
MaskOperation();
|
|
|
|
|
|
|
|
void initExecution();
|
|
|
|
void deinitExecution();
|
|
|
|
|
|
|
|
|
2012-06-26 01:22:05 +00:00
|
|
|
void setMask(Mask *mask) { this->m_mask = mask; }
|
|
|
|
void setMaskWidth(int width) { this->m_maskWidth = width; }
|
|
|
|
void setMaskHeight(int height) { this->m_maskHeight = height; }
|
|
|
|
void setFramenumber(int framenumber) { this->m_framenumber = framenumber; }
|
|
|
|
void setSmooth(bool smooth) { this->m_do_smooth = smooth; }
|
|
|
|
void setFeather(bool feather) { this->m_do_feather = feather; }
|
2012-06-04 15:49:58 +00:00
|
|
|
|
2012-07-19 17:28:37 +00:00
|
|
|
#ifdef USE_RASKTER
|
|
|
|
void *initializeTileData(rcti *rect);
|
2012-07-13 12:24:42 +00:00
|
|
|
void executePixel(float *color, int x, int y, void *data);
|
2012-07-19 17:28:37 +00:00
|
|
|
#else /* USE_RASKTER */
|
|
|
|
void executePixel(float *color, float x, float y, PixelSampler sampler);
|
|
|
|
#endif /* USE_RASKTER */
|
2012-06-04 15:49:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|