14f506f19SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
34f506f19SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
44f506f19SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
54f506f19SAndrew Rist  * distributed with this work for additional information
64f506f19SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
74f506f19SAndrew Rist  * to you under the Apache License, Version 2.0 (the
84f506f19SAndrew Rist  * "License"); you may not use this file except in compliance
94f506f19SAndrew Rist  * with the License.  You may obtain a copy of the License at
104f506f19SAndrew Rist  *
114f506f19SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
124f506f19SAndrew Rist  *
134f506f19SAndrew Rist  * Unless required by applicable law or agreed to in writing,
144f506f19SAndrew Rist  * software distributed under the License is distributed on an
154f506f19SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
164f506f19SAndrew Rist  * KIND, either express or implied.  See the License for the
174f506f19SAndrew Rist  * specific language governing permissions and limitations
184f506f19SAndrew Rist  * under the License.
194f506f19SAndrew Rist  *
204f506f19SAndrew Rist  *************************************************************/
214f506f19SAndrew Rist 
224f506f19SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE3D_HXX
25cdf0e10cSrcweir #define INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE3D_HXX
26cdf0e10cSrcweir 
27090f0eb8SEike Rathke #include <drawinglayer/drawinglayerdllapi.h>
28cdf0e10cSrcweir #include <drawinglayer/texture/texture.hxx>
29*035a2f44SArmin Le Grand #include <vcl/bitmapex.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
32cdf0e10cSrcweir // predeclarations
33cdf0e10cSrcweir 
34cdf0e10cSrcweir namespace drawinglayer { namespace primitive3d {
35cdf0e10cSrcweir 	class HatchTexturePrimitive3D;
36cdf0e10cSrcweir }}
37cdf0e10cSrcweir 
38cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace drawinglayer
41cdf0e10cSrcweir {
42cdf0e10cSrcweir 	namespace texture
43cdf0e10cSrcweir 	{
44090f0eb8SEike Rathke 		class DRAWINGLAYER_DLLPUBLIC GeoTexSvxMono : public GeoTexSvx
45cdf0e10cSrcweir 		{
46cdf0e10cSrcweir 		protected:
47cdf0e10cSrcweir 			basegfx::BColor								maSingleColor;
48cdf0e10cSrcweir 			double										mfOpacity;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 		public:
51*035a2f44SArmin Le Grand 			GeoTexSvxMono(
52*035a2f44SArmin Le Grand                 const basegfx::BColor& rSingleColor,
53*035a2f44SArmin Le Grand                 double fOpacity);
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 			// compare operator
56cdf0e10cSrcweir 			virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const;
57cdf0e10cSrcweir 			virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
58cdf0e10cSrcweir 			virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
59cdf0e10cSrcweir 		};
60cdf0e10cSrcweir 	} // end of namespace texture
61cdf0e10cSrcweir } // end of namespace drawinglayer
62cdf0e10cSrcweir 
63cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
64cdf0e10cSrcweir 
65cdf0e10cSrcweir namespace drawinglayer
66cdf0e10cSrcweir {
67cdf0e10cSrcweir 	namespace texture
68cdf0e10cSrcweir 	{
69*035a2f44SArmin Le Grand 		class DRAWINGLAYER_DLLPUBLIC GeoTexSvxBitmapEx : public GeoTexSvx
70cdf0e10cSrcweir 		{
71cdf0e10cSrcweir 		protected:
72*035a2f44SArmin Le Grand 			BitmapEx									maBitmapEx;
73*035a2f44SArmin Le Grand 			BitmapReadAccess*							mpReadBitmap;
74*035a2f44SArmin Le Grand             Bitmap                                      maTransparence;
75*035a2f44SArmin Le Grand             BitmapReadAccess*							mpReadTransparence;
76cdf0e10cSrcweir 			basegfx::B2DPoint							maTopLeft;
77cdf0e10cSrcweir 			basegfx::B2DVector							maSize;
78cdf0e10cSrcweir 			double										mfMulX;
79cdf0e10cSrcweir 			double										mfMulY;
80cdf0e10cSrcweir 
81*035a2f44SArmin Le Grand             /// bitfield
82*035a2f44SArmin Le Grand             bool                                        mbIsAlpha : 1;
83*035a2f44SArmin Le Grand             bool                                        mbIsTransparent : 1;
84*035a2f44SArmin Le Grand 
85cdf0e10cSrcweir 			// helpers
86cdf0e10cSrcweir 			bool impIsValid(const basegfx::B2DPoint& rUV, sal_Int32& rX, sal_Int32& rY) const;
87*035a2f44SArmin Le Grand             sal_uInt8 impGetTransparence(sal_Int32& rX, sal_Int32& rY) const;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 		public:
90*035a2f44SArmin Le Grand 			GeoTexSvxBitmapEx(
91*035a2f44SArmin Le Grand                 const BitmapEx& rBitmapEx,
92*035a2f44SArmin Le Grand                 const basegfx::B2DRange& rRange);
93*035a2f44SArmin Le Grand 			virtual ~GeoTexSvxBitmapEx();
94*035a2f44SArmin Le Grand 
95*035a2f44SArmin Le Grand             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
96cdf0e10cSrcweir 			virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
97cdf0e10cSrcweir 		};
98cdf0e10cSrcweir 	} // end of namespace texture
99cdf0e10cSrcweir } // end of namespace drawinglayer
100cdf0e10cSrcweir 
101cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
102cdf0e10cSrcweir 
103cdf0e10cSrcweir namespace drawinglayer
104cdf0e10cSrcweir {
105cdf0e10cSrcweir 	namespace texture
106cdf0e10cSrcweir 	{
107*035a2f44SArmin Le Grand 		class DRAWINGLAYER_DLLPUBLIC GeoTexSvxBitmapExTiled : public GeoTexSvxBitmapEx
108cdf0e10cSrcweir 		{
109cdf0e10cSrcweir 		protected:
110*035a2f44SArmin Le Grand             double                                      mfOffsetX;
111*035a2f44SArmin Le Grand             double                                      mfOffsetY;
112cdf0e10cSrcweir 
113*035a2f44SArmin Le Grand             /// bitfield
114*035a2f44SArmin Le Grand             bool                                        mbUseOffsetX : 1;
115*035a2f44SArmin Le Grand             bool                                        mbUseOffsetY : 1;
116cdf0e10cSrcweir 
117*035a2f44SArmin Le Grand 			// helpers
118*035a2f44SArmin Le Grand 			basegfx::B2DPoint impGetCorrected(const basegfx::B2DPoint& rUV) const;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 		public:
121*035a2f44SArmin Le Grand 			GeoTexSvxBitmapExTiled(
122*035a2f44SArmin Le Grand                 const BitmapEx& rBitmapEx,
123*035a2f44SArmin Le Grand                 const basegfx::B2DRange& rRange,
124*035a2f44SArmin Le Grand                 double fOffsetX = 0.0,
125*035a2f44SArmin Le Grand                 double fOffsetY = 0.0);
126*035a2f44SArmin Le Grand 
127*035a2f44SArmin Le Grand             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
128cdf0e10cSrcweir 			virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
129cdf0e10cSrcweir 		};
130cdf0e10cSrcweir 	} // end of namespace texture
131cdf0e10cSrcweir } // end of namespace drawinglayer
132cdf0e10cSrcweir 
133cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
134cdf0e10cSrcweir 
135cdf0e10cSrcweir namespace drawinglayer
136cdf0e10cSrcweir {
137cdf0e10cSrcweir 	namespace texture
138cdf0e10cSrcweir 	{
139090f0eb8SEike Rathke 		class DRAWINGLAYER_DLLPUBLIC GeoTexSvxMultiHatch : public GeoTexSvx
140cdf0e10cSrcweir 		{
141cdf0e10cSrcweir 		protected:
142cdf0e10cSrcweir 			basegfx::BColor					maColor;
143cdf0e10cSrcweir 			double							mfLogicPixelSize;
144cdf0e10cSrcweir 			GeoTexSvxHatch*					mp0;
145cdf0e10cSrcweir 			GeoTexSvxHatch*					mp1;
146cdf0e10cSrcweir 			GeoTexSvxHatch*					mp2;
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 			// bitfield
149cdf0e10cSrcweir 			unsigned						mbFillBackground : 1;
150cdf0e10cSrcweir 
151cdf0e10cSrcweir 			// helpers
152cdf0e10cSrcweir 			bool impIsOnHatch(const basegfx::B2DPoint& rUV) const;
153cdf0e10cSrcweir 
154cdf0e10cSrcweir 		public:
155cdf0e10cSrcweir 			GeoTexSvxMultiHatch(const primitive3d::HatchTexturePrimitive3D& rPrimitive, double fLogicPixelSize);
156cdf0e10cSrcweir 			virtual ~GeoTexSvxMultiHatch();
157cdf0e10cSrcweir 			virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
158cdf0e10cSrcweir 			virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const;
159cdf0e10cSrcweir 
160cdf0e10cSrcweir 			// dada access
getFillBackground() const161cdf0e10cSrcweir 			bool getFillBackground() const { return mbFillBackground; }
162cdf0e10cSrcweir 		};
163cdf0e10cSrcweir 	} // end of namespace texture
164cdf0e10cSrcweir } // end of namespace drawinglayer
165cdf0e10cSrcweir 
166cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
167cdf0e10cSrcweir 
168cdf0e10cSrcweir #endif // INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE3D_HXX
169cdf0e10cSrcweir 
170cdf0e10cSrcweir // eof
171