1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE3D_HXX
21 #define INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE3D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/texture/texture.hxx>
26 #include <vcl/bitmap.hxx>
28 //////////////////////////////////////////////////////////////////////////////
31 namespace drawinglayer
{ namespace primitive3d
{
32 class HatchTexturePrimitive3D
;
35 //////////////////////////////////////////////////////////////////////////////
37 namespace drawinglayer
41 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxMono
: public GeoTexSvx
44 basegfx::BColor maSingleColor
;
48 GeoTexSvxMono(const basegfx::BColor
& rSingleColor
, double fOpacity
);
51 virtual bool operator==(const GeoTexSvx
& rGeoTexSvx
) const;
52 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const;
53 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const;
55 } // end of namespace texture
56 } // end of namespace drawinglayer
58 //////////////////////////////////////////////////////////////////////////////
60 namespace drawinglayer
64 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxBitmap
: public GeoTexSvx
68 BitmapReadAccess
* mpRead
;
69 basegfx::B2DPoint maTopLeft
;
70 basegfx::B2DVector maSize
;
75 bool impIsValid(const basegfx::B2DPoint
& rUV
, sal_Int32
& rX
, sal_Int32
& rY
) const;
78 GeoTexSvxBitmap(const Bitmap
& rBitmap
, const basegfx::B2DPoint
& rTopLeft
, const basegfx::B2DVector
& rSize
);
79 virtual ~GeoTexSvxBitmap();
80 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const;
81 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const;
83 } // end of namespace texture
84 } // end of namespace drawinglayer
86 //////////////////////////////////////////////////////////////////////////////
88 namespace drawinglayer
92 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxBitmapTiled
: public GeoTexSvxBitmap
96 basegfx::B2DPoint
impGetCorrected(const basegfx::B2DPoint
& rUV
) const
98 double fX(fmod(rUV
.getX() - maTopLeft
.getX(), maSize
.getX()));
99 double fY(fmod(rUV
.getY() - maTopLeft
.getY(), maSize
.getY()));
111 return basegfx::B2DPoint(fX
+ maTopLeft
.getX(), fY
+ maTopLeft
.getY());
115 GeoTexSvxBitmapTiled(const Bitmap
& rBitmap
, const basegfx::B2DPoint
& rTopLeft
, const basegfx::B2DVector
& rSize
);
116 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const;
117 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const;
119 } // end of namespace texture
120 } // end of namespace drawinglayer
122 //////////////////////////////////////////////////////////////////////////////
124 namespace drawinglayer
128 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxMultiHatch
: public GeoTexSvx
131 basegfx::BColor maColor
;
132 double mfLogicPixelSize
;
138 unsigned mbFillBackground
: 1;
141 bool impIsOnHatch(const basegfx::B2DPoint
& rUV
) const;
144 GeoTexSvxMultiHatch(const primitive3d::HatchTexturePrimitive3D
& rPrimitive
, double fLogicPixelSize
);
145 virtual ~GeoTexSvxMultiHatch();
146 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const;
147 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const;
150 bool getFillBackground() const { return mbFillBackground
; }
152 } // end of namespace texture
153 } // end of namespace drawinglayer
155 //////////////////////////////////////////////////////////////////////////////
157 #endif // INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE3D_HXX
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */