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 | |
parent | 2e5181195057b8e8525f2f91c107d6d67e2bdf3a (diff) |
remove references to raskter from compositor and BKE mask.
Diffstat (limited to 'source/blender/compositor')
-rw-r--r-- | source/blender/compositor/operations/COM_MaskOperation.cpp | 101 | ||||
-rw-r--r-- | source/blender/compositor/operations/COM_MaskOperation.h | 21 |
2 files changed, 1 insertions, 121 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 */ diff --git a/source/blender/compositor/operations/COM_MaskOperation.h b/source/blender/compositor/operations/COM_MaskOperation.h index 77d8e1148c2..859420bd650 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.h +++ b/source/blender/compositor/operations/COM_MaskOperation.h @@ -21,14 +21,9 @@ * Sergey Sharybin */ - #ifndef _COM_MaskOperation_h #define _COM_MaskOperation_h -/* XXX, remove when the USE_RASKTER option is also removed */ -extern "C" { - #include "BKE_mask.h" -} #include "COM_NodeOperation.h" #include "DNA_scene_types.h" @@ -36,10 +31,6 @@ extern "C" { #include "BLI_listbase.h" #include "IMB_imbuf_types.h" -#ifdef __PLX_RASKTER_MT__ -#include "../../../../intern/raskter/raskter.h" -#endif - /** * Class with implementation of mask rasterization */ @@ -60,15 +51,8 @@ protected: bool m_do_smooth; bool m_do_feather; -#ifdef USE_RASKTER - float *m_rasterizedMask; - - ListBase m_maskLayers; - -#else /* USE_RASKTER */ struct MaskRasterHandle *m_rasterMaskHandles[32]; unsigned int m_rasterMaskHandleTot; -#endif /* USE_RASKTER */ /** * Determine the output resolution. The resolution is retrieved from the Renderer @@ -100,12 +84,7 @@ public: void setMotionBlurSamples(int samples) { this->m_rasterMaskHandleTot = max(1, samples); } void setMotionBlurShutter(float shutter) { this->m_frame_shutter = shutter; } -#ifdef USE_RASKTER - void *initializeTileData(rcti *rect); - void executePixel(float *color, int x, int y, void *data); -#else /* USE_RASKTER */ void executePixel(float *color, float x, float y, PixelSampler sampler); -#endif /* USE_RASKTER */ }; #endif |