diff options
author | Peter Larabell <xgl.asyliax@gmail.com> | 2012-06-13 23:57:23 +0400 |
---|---|---|
committer | Peter Larabell <xgl.asyliax@gmail.com> | 2012-06-13 23:57:23 +0400 |
commit | ceffc2cd50ea1e35757c8834b83b1d55f93d88c6 (patch) | |
tree | c4cbbc1d4ad1369d5412c60e8575ee2308cfe296 /source/blender/compositor/operations | |
parent | 96099688c667dd601d6dc7c795dd508f5d28646c (diff) |
add Anti-Aliasing (very rough draft algorithm, NOT FINAL version) to raskter lib. Code is still quite messy but will be replaced when final algo comes in anyway.
Diffstat (limited to 'source/blender/compositor/operations')
-rw-r--r-- | source/blender/compositor/operations/COM_MaskOperation.cpp | 6 | ||||
-rw-r--r-- | source/blender/compositor/operations/COM_MaskOperation.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/compositor/operations/COM_MaskOperation.cpp b/source/blender/compositor/operations/COM_MaskOperation.cpp index bfbf2b42e82..8f7115659a1 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.cpp +++ b/source/blender/compositor/operations/COM_MaskOperation.cpp @@ -32,6 +32,7 @@ extern "C" { #include "BKE_mask.h" + #include "../../../../intern/raskter/raskter.h" } MaskOperation::MaskOperation(): NodeOperation() @@ -74,7 +75,10 @@ void *MaskOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers float *buffer; buffer = (float *)MEM_callocN(sizeof(float) * width * height, "rasterized mask"); - BKE_mask_rasterize(mask, width, height, buffer, TRUE); + BKE_mask_rasterize(mask, width, height, buffer, TRUE, this->smooth); + if(this->smooth) { + PLX_antialias_buffer(buffer, width, height); + } this->rasterizedMask = buffer; } diff --git a/source/blender/compositor/operations/COM_MaskOperation.h b/source/blender/compositor/operations/COM_MaskOperation.h index 9f2c7f53f56..8534cb20416 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.h +++ b/source/blender/compositor/operations/COM_MaskOperation.h @@ -40,6 +40,7 @@ protected: int maskWidth; int maskHeight; int framenumber; + bool smooth; float *rasterizedMask; /** @@ -59,6 +60,7 @@ public: void setMaskWidth(int width) {this->maskWidth = width;} void setMaskHeight(int height) {this->maskHeight = height;} void setFramenumber(int framenumber) {this->framenumber = framenumber;} + void setSmooth(bool smooth) {this->smooth = smooth;} void executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data); }; |