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/bitmapex.hxx>
28 namespace drawinglayer
{ namespace primitive3d
{
29 class HatchTexturePrimitive3D
;
32 namespace drawinglayer
36 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxMono
: public GeoTexSvx
39 basegfx::BColor maSingleColor
;
44 const basegfx::BColor
& rSingleColor
,
48 virtual bool operator==(const GeoTexSvx
& rGeoTexSvx
) const override
;
49 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const override
;
50 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const override
;
52 } // end of namespace texture
53 } // end of namespace drawinglayer
55 namespace drawinglayer
59 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxBitmapEx
: public GeoTexSvx
63 Bitmap maBitmap
; // Bitmap held within maBitmapEx, to exist during mpReadBitmap scope
64 Bitmap::ScopedReadAccess mpReadBitmap
;
65 Bitmap maTransparence
;
66 Bitmap::ScopedReadAccess mpReadTransparence
;
67 basegfx::B2DPoint maTopLeft
;
68 basegfx::B2DVector maSize
;
73 bool mbIsTransparent
: 1;
76 bool impIsValid(const basegfx::B2DPoint
& rUV
, sal_Int32
& rX
, sal_Int32
& rY
) const;
77 sal_uInt8
impGetTransparence(sal_Int32
& rX
, sal_Int32
& rY
) const;
81 const BitmapEx
& rBitmapEx
,
82 const basegfx::B2DRange
& rRange
);
83 virtual ~GeoTexSvxBitmapEx() override
;
85 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const override
;
86 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const override
;
88 } // end of namespace texture
89 } // end of namespace drawinglayer
91 namespace drawinglayer
95 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxBitmapExTiled
: public GeoTexSvxBitmapEx
101 bool mbUseOffsetX
: 1;
102 bool mbUseOffsetY
: 1;
105 basegfx::B2DPoint
impGetCorrected(const basegfx::B2DPoint
& rUV
) const;
108 GeoTexSvxBitmapExTiled(
109 const BitmapEx
& rBitmapEx
,
110 const basegfx::B2DRange
& rRange
,
114 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const override
;
115 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const override
;
117 } // end of namespace texture
118 } // end of namespace drawinglayer
120 namespace drawinglayer
124 class DRAWINGLAYER_DLLPUBLIC GeoTexSvxMultiHatch
: public GeoTexSvx
127 basegfx::BColor maColor
;
128 double mfLogicPixelSize
;
133 bool mbFillBackground
: 1;
136 bool impIsOnHatch(const basegfx::B2DPoint
& rUV
) const;
139 GeoTexSvxMultiHatch(const primitive3d::HatchTexturePrimitive3D
& rPrimitive
, double fLogicPixelSize
);
140 virtual ~GeoTexSvxMultiHatch() override
;
141 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const override
;
142 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const override
;
144 } // end of namespace texture
145 } // end of namespace drawinglayer
147 #endif // INCLUDED_DRAWINGLAYER_TEXTURE_TEXTURE3D_HXX
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */