summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-08-27 12:46:41 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-08-28 09:53:24 +0100
commit4a8f7ddc290d1ea3131de6611b6833b77ac7ab1f (patch)
treeba207c236999f462c214d9c2a8782bd99e0a21ea /include
parente75e0214134ca6ad92150bf6099c12d8859575b1 (diff)
Resolves: #i122778# Enhanced own transformer for drawing transformed bitmaps
which is used in the cases where no fallback for direct system support is there (Linux) (cherry picked from commit 75e9010730525ed6122655ac3c3899359c305104) Conflicts: vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/bmpacc.hxx vcl/source/gdi/bmpacc.cxx Change-Id: I6e7a575e01456297e84785a7de14e42e0dc72f5f
Diffstat (limited to 'include')
-rw-r--r--include/vcl/bitmapex.hxx23
-rw-r--r--include/vcl/bmpacc.hxx10
2 files changed, 30 insertions, 3 deletions
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index 9a0d159d6b74..73ae31ed9c56 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -393,25 +393,42 @@ public:
@param rTransformation
The back transformation for each pixel in (0 .. fWidth),(0 .. fHeight) to
local pixel coordiantes
+
+ @param bSmooth
+ Defines if pixel interpolation is to be used to create the result
*/
BitmapEx TransformBitmapEx(
double fWidth,
double fHeight,
- const basegfx::B2DHomMatrix& rTransformation) const;
+ const basegfx::B2DHomMatrix& rTransformation,
+ bool bSmooth = true) const;
/** Create transformed Bitmap
@param rTransformation
- The transformation from unit coordinates to target
+ The transformation from unit coordinates to the unit range
+
+ @param rVisibleRange
+ The relative visible range in unit coordinates, relative to (0,0,1,1) which
+ defines the whole target area
@param fMaximumArea
A limitation for the maximum size of pixels to use for the result
+ @param bSmooth
+ Defines if pixel interpolation is to be used to create the result
+
+ The traget size of the result bitmap is defined by transforming the given
+ rTargetRange with the given rTransformation; the area of the result is
+ linearly scaled to not exceed the given fMaximumArea
+
@return The transformed bitmap
*/
BitmapEx getTransformed(
const basegfx::B2DHomMatrix& rTransformation,
- double fMaximumArea = 500000.0) const;
+ const basegfx::B2DRange& rVisibleRange,
+ double fMaximumArea = 500000.0,
+ bool bSmooth = true) const;
/** Create ColorStack-modified version of this BitmapEx
diff --git a/include/vcl/bmpacc.hxx b/include/vcl/bmpacc.hxx
index ea36a05b0d36..70015ba17fa6 100644
--- a/include/vcl/bmpacc.hxx
+++ b/include/vcl/bmpacc.hxx
@@ -158,6 +158,16 @@ public:
inline BitmapColor GetColor( long nY, long nX ) const;
inline sal_uInt8 GetPixelIndex( long nY, long nX ) const;
inline sal_uInt8 GetLuminance( long nY, long nX ) const;
+
+ /** Get the interpolated color at coordinates fY, fX; if outside, return rFallback */
+ BitmapColor GetInterpolatedColorWithFallback( double fY, double fX, const BitmapColor& rFallback ) const;
+
+ /** Get the color at coordinates fY, fX; if outside, return rFallback. Automatically does the correct
+ inside/outside checks, e.g. static_cast< sal_uInt32 >(-0.25) *is* 0, not -1 and has to be outside */
+ BitmapColor GetColorWithFallback( double fY, double fX, const BitmapColor& rFallback ) const;
+
+ /** Get the color at coordinates nY, nX; if outside, return rFallback */
+ BitmapColor GetColorWithFallback( long nY, long nX, const BitmapColor& rFallback ) const;
};
// ---------------------