diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-31 20:04:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-31 20:04:47 +0400 |
commit | 4c02549d5d90c698946c6beb9df344c05e453158 (patch) | |
tree | 12ad718582db598b16261832e38ff28c875aca0e /source/blender/compositor/operations/COM_MaskOperation.cpp | |
parent | 2e5181195057b8e8525f2f91c107d6d67e2bdf3a (diff) |
remove references to raskter from compositor and BKE mask.
Diffstat (limited to 'source/blender/compositor/operations/COM_MaskOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_MaskOperation.cpp | 101 |
1 files changed, 1 insertions, 100 deletions
diff --git a/source/blender/compositor/operations/COM_MaskOperation.cpp b/source/blender/compositor/operations/COM_MaskOperation.cpp index a3326de0a30..32e79a794bf 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.cpp +++ b/source/blender/compositor/operations/COM_MaskOperation.cpp @@ -30,10 +30,8 @@ #include "DNA_scene_types.h" -#ifdef USE_RASKTER - extern "C" { - #include "../../../../intern/raskter/raskter.h" + #include "BKE_mask.h" } MaskOperation::MaskOperation() : NodeOperation() @@ -42,101 +40,6 @@ MaskOperation::MaskOperation() : NodeOperation() this->m_mask = NULL; this->m_maskWidth = 0; this->m_maskHeight = 0; - this->m_framenumber = 0; - this->m_rasterizedMask = NULL; - setComplex(true); -} - -void MaskOperation::initExecution() -{ - initMutex(); - - this->m_rasterizedMask = NULL; - this->m_maskLayers.first = this->m_maskLayers.last = NULL; - - if (this->m_mask) { - BKE_mask_layer_copy_list(&this->m_maskLayers, &this->m_mask->masklayers); - } -} - -void MaskOperation::deinitExecution() -{ - BKE_mask_layer_free_list(&this->m_maskLayers); - - if (this->m_rasterizedMask) { - MEM_freeN(this->m_rasterizedMask); - this->m_rasterizedMask = NULL; - } -} - -void *MaskOperation::initializeTileData(rcti *rect) -{ - if (this->m_rasterizedMask) - return this->m_rasterizedMask; - - if (!this->m_mask) - return NULL; - - lockMutex(); - if (this->m_rasterizedMask == NULL) { - int width = this->getWidth(); - int height = this->getHeight(); - float *buffer; - - buffer = (float *)MEM_callocN(sizeof(float) * width * height, "rasterized mask"); - - BKE_mask_rasterize_layers(&this->m_maskLayers, width, height, buffer, TRUE, - this->m_do_smooth, this->m_do_feather); - - if (this->m_do_smooth) { - PLX_antialias_buffer(buffer, width, height); - } - - this->m_rasterizedMask = buffer; - } - unlockMutex(); - return this->m_rasterizedMask; -} - -void MaskOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) -{ - if (this->m_maskWidth == 0 || this->m_maskHeight == 0) { - NodeOperation::determineResolution(resolution, preferredResolution); - } - else { - unsigned int nr[2]; - - nr[0] = this->m_maskWidth; - nr[1] = this->m_maskHeight; - - NodeOperation::determineResolution(resolution, nr); - - resolution[0] = this->m_maskWidth; - resolution[1] = this->m_maskHeight; - } -} - -void MaskOperation::executePixel(float *color, int x, int y, void *data) -{ - if (!data) { - color[0] = 0.0f; - } - else { - float *buffer = (float *) data; - int index = (y * this->getWidth() + x); - - color[0] = buffer[index]; - } -} - -#else /* mask rasterizer by campbell wip */ - -MaskOperation::MaskOperation() : NodeOperation() -{ - this->addOutputSocket(COM_DT_VALUE); - this->m_mask = NULL; - this->m_maskWidth = 0; - this->m_maskHeight = 0; this->m_maskWidthInv = 0.0f; this->m_maskHeightInv = 0.0f; this->m_frame_shutter = 0.0f; @@ -252,5 +155,3 @@ void MaskOperation::executePixel(float *color, float x, float y, PixelSampler sa color[0] /= this->m_rasterMaskHandleTot; } } - -#endif /* USE_RASKTER */ |