[Libreoffice-commits] core.git: include/vcl vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Sun Apr 22 03:31:43 UTC 2018
include/vcl/BitmapConvolutionMatrixFilter.hxx | 7 +++++-
include/vcl/BitmapSharpenFilter.hxx | 28 ++++++++++++++++++++++++++
vcl/source/gdi/bitmap4.cxx | 5 +---
3 files changed, 36 insertions(+), 4 deletions(-)
New commits:
commit 8559353af24123c7a736e64311d57d85bb3cb44c
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Thu Apr 19 06:50:32 2018 +1000
vcl: introduce BitmapSharpenFilter
Change-Id: Ib503efa3634b3a000261d2398d04f779079bfe3f
Reviewed-on: https://gerrit.libreoffice.org/53129
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/include/vcl/BitmapConvolutionMatrixFilter.hxx b/include/vcl/BitmapConvolutionMatrixFilter.hxx
index d27bfffb0fcd..a2189326322b 100644
--- a/include/vcl/BitmapConvolutionMatrixFilter.hxx
+++ b/include/vcl/BitmapConvolutionMatrixFilter.hxx
@@ -20,6 +20,11 @@ class BitmapEx;
class VCL_DLLPUBLIC BitmapConvolutionMatrixFilter : public BitmapFilter
{
public:
+ BitmapConvolutionMatrixFilter()
+ : mpMatrix(nullptr)
+ {
+ }
+
BitmapConvolutionMatrixFilter(const long* pMatrix)
: mpMatrix(pMatrix)
{
@@ -29,7 +34,7 @@ public:
virtual BitmapEx execute(BitmapEx const& rBitmapEx) override;
-private:
+protected:
const long* mpMatrix;
};
diff --git a/include/vcl/BitmapSharpenFilter.hxx b/include/vcl/BitmapSharpenFilter.hxx
new file mode 100644
index 000000000000..7e965976d5e8
--- /dev/null
+++ b/include/vcl/BitmapSharpenFilter.hxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef INCLUDED_VCL_BITMAPSHARPENFILTER_HXX
+#define INCLUDED_VCL_BITMAPSHARPENFILTER_HXX
+
+#include <vcl/BitmapConvolutionMatrixFilter.hxx>
+
+class VCL_DLLPUBLIC BitmapSharpenFilter : public BitmapConvolutionMatrixFilter
+{
+public:
+ BitmapSharpenFilter()
+ {
+ const long pSharpenMatrix[] = { -1, -1, -1, -1, 16, -1, -1, -1, -1 };
+ mpMatrix = &pSharpenMatrix[0];
+ }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index e7c18f01718d..f13aa0bb9d24 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -21,7 +21,7 @@
#include <vcl/bitmapaccess.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/BitmapSmoothenFilter.hxx>
-#include <vcl/BitmapConvolutionMatrixFilter.hxx>
+#include <vcl/BitmapSharpenFilter.hxx>
#include <bitmapwriteaccess.hxx>
@@ -60,9 +60,8 @@ bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam )
case BmpFilter::Sharpen:
{
- const long pSharpenMatrix[] = { -1, -1, -1, -1, 16, -1, -1, -1, -1 };
BitmapEx aBmpEx(*this);
- bRet = BitmapFilter::Filter(aBmpEx, BitmapConvolutionMatrixFilter(&pSharpenMatrix[0]));
+ bRet = BitmapFilter::Filter(aBmpEx, BitmapSharpenFilter());
*this = aBmpEx.GetBitmap();
}
break;
More information about the Libreoffice-commits
mailing list