fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / drawinglayer / texture / texture3d.hxx
blob713cea76c928d3c9fadf1735d2c07a820d14030b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 //////////////////////////////////////////////////////////////////////////////
29 // predeclarations
31 namespace drawinglayer { namespace primitive3d {
32 class HatchTexturePrimitive3D;
35 //////////////////////////////////////////////////////////////////////////////
37 namespace drawinglayer
39 namespace texture
41 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxMono : public GeoTexSvx
43 protected:
44 basegfx::BColor maSingleColor;
45 double mfOpacity;
47 public:
48 GeoTexSvxMono(const basegfx::BColor& rSingleColor, double fOpacity);
50 // compare operator
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
62 namespace texture
64 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxBitmap : public GeoTexSvx
66 protected:
67 Bitmap maBitmap;
68 BitmapReadAccess* mpRead;
69 basegfx::B2DPoint maTopLeft;
70 basegfx::B2DVector maSize;
71 double mfMulX;
72 double mfMulY;
74 // helpers
75 bool impIsValid(const basegfx::B2DPoint& rUV, sal_Int32& rX, sal_Int32& rY) const;
77 public:
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
90 namespace texture
92 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxBitmapTiled : public GeoTexSvxBitmap
94 protected:
95 // helpers
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()));
101 if(fX < 0.0)
103 fX += maSize.getX();
106 if(fY < 0.0)
108 fY += maSize.getY();
111 return basegfx::B2DPoint(fX + maTopLeft.getX(), fY + maTopLeft.getY());
114 public:
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
126 namespace texture
128 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxMultiHatch : public GeoTexSvx
130 protected:
131 basegfx::BColor maColor;
132 double mfLogicPixelSize;
133 GeoTexSvxHatch* mp0;
134 GeoTexSvxHatch* mp1;
135 GeoTexSvxHatch* mp2;
137 // bitfield
138 unsigned mbFillBackground : 1;
140 // helpers
141 bool impIsOnHatch(const basegfx::B2DPoint& rUV) const;
143 public:
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;
149 // dada access
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: */