summaryrefslogtreecommitdiff
path: root/drawinglayer/inc/drawinglayer/primitive2d
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-09-22 18:14:05 +0200
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-09-22 18:14:05 +0200
commit256427a28d4ba3de573c81d64b5fbbe1cb354b01 (patch)
treec572170f1017857711de6be6ba7ddd4b12c8a1d1 /drawinglayer/inc/drawinglayer/primitive2d
parenta0f979d5bf4428f0110c408cc32d1ba670394f07 (diff)
#i97509# continued matrix tooling and adapting the usages now to all the ooo code
Diffstat (limited to 'drawinglayer/inc/drawinglayer/primitive2d')
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx22
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx39
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx21
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx18
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx12
5 files changed, 55 insertions, 57 deletions
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
index 6fdf3200543c..79518eb82358 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
@@ -44,23 +44,37 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** AlphaPrimitive2D class
+
+ This is the basic primitive for applying freely defined transparence
+ to freely defined content. The basic idea is to associate a content
+ which is defined as a sequence of primitives and hold as child content
+ in the GroupPrimitive2D with an alpha channel also defined as a sequence
+ of primitives and hold in the Alpha member.
+
+ The basic definition is to use the Alpha content as Alpha-Mask by
+ interpreting the Alpha-content not as RGB, but as Luminance alpha mask
+ using the common RGB_to_luminance definition as e.g. used by VCL
+ */
class AlphaPrimitive2D : public GroupPrimitive2D
{
private:
- Primitive2DSequence maAlpha; // transparence sequence
+ /// The Alpha-Mask who's RGB-Values are interpreted as Luminance
+ Primitive2DSequence maAlpha;
public:
+ /// constructor
AlphaPrimitive2D(
const Primitive2DSequence& rChildren,
const Primitive2DSequence& rAlpha);
- // get data
+ /// data read access
const Primitive2DSequence& getAlpha() const { return maAlpha; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
index 1fcde759ed68..e505594b2a76 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
@@ -38,6 +38,7 @@
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -114,42 +115,6 @@ namespace drawinglayer
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-// helper class for AnimatedInterpolatePrimitive2D
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
- class BufferedMatrixDecompose
- {
- private:
- // the matrix itself
- basegfx::B2DHomMatrix maB2DHomMatrix;
-
- // the decomposition
- basegfx::B2DVector maScale;
- basegfx::B2DVector maTranslate;
- double mfRotate;
- double mfShearX;
-
- // flag if already decomposed, used by ensureDecompose()
- bool mbDecomposed;
-
- public:
- BufferedMatrixDecompose(const basegfx::B2DHomMatrix& rMatrix);
- void ensureDecompose() const;
-
- // data access
- const basegfx::B2DHomMatrix& getB2DHomMatrix() const { return maB2DHomMatrix; }
- const basegfx::B2DVector& getScale() const { return maScale; }
- const basegfx::B2DVector& getTranslate() const { return maTranslate; }
- double getRotate() const { return mfRotate; }
- double getShearX() const { return mfShearX; }
- };
- } // end of anonymous namespace
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
@@ -159,7 +124,7 @@ namespace drawinglayer
{
private:
// the transformations
- std::vector< BufferedMatrixDecompose > maMatrixStack;
+ std::vector< basegfx::tools::B2DHomMatrixBufferedDecompose > maMatrixStack;
protected:
// create local decomposition
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
index d295c6ab4b89..f5de130febf9 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
@@ -47,28 +47,41 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** BitmapPrimitive2D class
+
+ This class is the central primitive for Bitmap-based primitives.
+ It provides RGBA-based bitmaps, currently using a BitmapEx from VCL.
+ This may change in the future to any other, maybe more general base
+ class providing 24bit RGBA.
+ */
class BitmapPrimitive2D : public BasePrimitive2D
{
private:
+ /// the RGBA Bitmap-data
BitmapEx maBitmapEx;
+
+ /** the object transformation from unit coordinates, defining
+ size, shear, rotate and position
+ */
basegfx::B2DHomMatrix maTransform;
public:
+ /// constructor
BitmapPrimitive2D(
const BitmapEx& rBitmapEx,
const basegfx::B2DHomMatrix& rTransform);
- // get data
+ /// data read access
const BitmapEx& getBitmapEx() const { return maBitmapEx; }
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
index 516210a6a081..0a288cd2ac65 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
@@ -257,9 +257,10 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonGradientPrimitive2D : public PolyPolygonColorPrimitive2D
+ class PolyPolygonGradientPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ basegfx::B2DPolyPolygon maPolyPolygon;
attribute::FillGradientAttribute maFillGradient;
protected:
@@ -269,10 +270,10 @@ namespace drawinglayer
public:
PolyPolygonGradientPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
const attribute::FillGradientAttribute& rFillGradient);
// get data
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }
// compare operator
@@ -291,10 +292,12 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonHatchPrimitive2D : public PolyPolygonColorPrimitive2D
+ class PolyPolygonHatchPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ basegfx::B2DPolyPolygon maPolyPolygon;
attribute::FillHatchAttribute maFillHatch;
+ basegfx::BColor maBackgroundColor;
protected:
// local decomposition.
@@ -303,10 +306,12 @@ namespace drawinglayer
public:
PolyPolygonHatchPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
+ const basegfx::BColor& rBackgroundColor,
const attribute::FillHatchAttribute& rFillHatch);
// get data
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
// compare operator
@@ -325,9 +330,10 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonBitmapPrimitive2D : public PolyPolygonColorPrimitive2D
+ class PolyPolygonBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ basegfx::B2DPolyPolygon maPolyPolygon;
attribute::FillBitmapAttribute maFillBitmap;
protected:
@@ -337,10 +343,10 @@ namespace drawinglayer
public:
PolyPolygonBitmapPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
const attribute::FillBitmapAttribute& rFillBitmap);
// get data
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; }
// compare operator
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
index 536b267f2fbd..fb72500fcb38 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
@@ -41,9 +41,9 @@
//////////////////////////////////////////////////////////////////////////////
// predeclarations
-namespace basegfx {
- class DecomposedB2DHomMatrixContainer;
-} // end of namespace basegfx
+namespace basegfx { namespace tools {
+ class B2DHomMatrixBufferedOnDemandDecompose;
+}}
namespace com { namespace sun { namespace star { namespace i18n {
struct Boundary;
@@ -125,7 +125,7 @@ namespace drawinglayer
// helper methods
void impCreateTextLine(
std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans,
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans,
const basegfx::B2DHomMatrix &rUnscaledTransform,
FontUnderline eLineStyle,
double fLineOffset,
@@ -135,7 +135,7 @@ namespace drawinglayer
void impCreateGeometryContent(
std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans,
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans,
const String& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
@@ -147,7 +147,7 @@ namespace drawinglayer
void impSplitSingleWords(
std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans) const;
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans) const;
protected:
// local decomposition.