Add gaussian blur support in PixelBuffer
[platform/core/uifw/dali-adaptor.git] / adaptors / common / pixel-buffer-impl.cpp
index 1de5382..24ea4bc 100644 (file)
@@ -25,6 +25,7 @@
 // INTERNAL INCLUDES
 #include "pixel-manipulation.h"
 #include "alpha-mask.h"
+#include "gaussian-blur.h"
 #include <platform-abstractions/portable/image-operations.h>
 
 namespace Dali
@@ -309,6 +310,22 @@ PixelBufferPtr PixelBuffer::NewResize( const PixelBuffer& inBuffer, ImageDimensi
   return outBuffer;
 }
 
+void PixelBuffer::ApplyGaussianBlur( const float blurRadius )
+{
+  // This method only works for pixel buffer in RGBA format.
+  if( mWidth > 0 && mHeight > 0 && mPixelFormat == Pixel::RGBA8888 )
+  {
+    if ( blurRadius > Math::MACHINE_EPSILON_1 )
+    {
+      PerformGaussianBlurRGBA( *this, blurRadius );
+    }
+  }
+  else
+  {
+    DALI_LOG_ERROR( "Trying to apply gaussian blur to an empty pixel buffer or a pixel buffer not in RGBA format" );
+  }
+}
+
 }// namespace Adaptor
 }// namespace Internal
 }// namespace Dali