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 .
22 #include <texture/texture.hxx>
23 #include <vcl/bitmapex.hxx>
25 namespace drawinglayer::primitive3d
{
26 class HatchTexturePrimitive3D
;
29 namespace drawinglayer::texture
31 class GeoTexSvxMono final
: public GeoTexSvx
33 basegfx::BColor maSingleColor
;
38 const basegfx::BColor
& rSingleColor
,
42 virtual bool operator==(const GeoTexSvx
& rGeoTexSvx
) const override
;
43 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const override
;
44 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const override
;
47 } // end of namespace drawinglayer::texture
49 namespace drawinglayer::texture
51 class GeoTexSvxBitmapEx
: public GeoTexSvx
55 Bitmap maBitmap
; // Bitmap held within maBitmapEx, to exist during mpReadBitmap scope
56 Bitmap::ScopedReadAccess mpReadBitmap
;
57 Bitmap maTransparence
;
58 Bitmap::ScopedReadAccess mpReadTransparence
;
59 basegfx::B2DPoint maTopLeft
;
60 basegfx::B2DVector maSize
;
67 bool impIsValid(const basegfx::B2DPoint
& rUV
, sal_Int32
& rX
, sal_Int32
& rY
) const;
68 sal_uInt8
impGetTransparence(sal_Int32 rX
, sal_Int32 rY
) const;
72 const BitmapEx
& rBitmapEx
,
73 const basegfx::B2DRange
& rRange
);
74 virtual ~GeoTexSvxBitmapEx() override
;
76 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const override
;
77 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const override
;
80 } // end of namespace drawinglayer::texture
82 namespace drawinglayer::texture
84 class GeoTexSvxBitmapExTiled final
: public GeoTexSvxBitmapEx
89 bool mbUseOffsetX
: 1;
90 bool mbUseOffsetY
: 1;
93 basegfx::B2DPoint
impGetCorrected(const basegfx::B2DPoint
& rUV
) const;
96 GeoTexSvxBitmapExTiled(
97 const BitmapEx
& rBitmapEx
,
98 const basegfx::B2DRange
& rRange
,
102 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const override
;
103 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const override
;
106 } // end of namespace drawinglayer::texture
108 namespace drawinglayer::texture
110 class GeoTexSvxMultiHatch final
: public GeoTexSvx
112 basegfx::BColor maColor
;
113 double mfLogicPixelSize
;
114 std::unique_ptr
<GeoTexSvxHatch
> mp0
;
115 std::unique_ptr
<GeoTexSvxHatch
> mp1
;
116 std::unique_ptr
<GeoTexSvxHatch
> mp2
;
118 bool mbFillBackground
: 1;
121 bool impIsOnHatch(const basegfx::B2DPoint
& rUV
) const;
124 GeoTexSvxMultiHatch(const primitive3d::HatchTexturePrimitive3D
& rPrimitive
, double fLogicPixelSize
);
125 virtual ~GeoTexSvxMultiHatch() override
;
126 virtual void modifyBColor(const basegfx::B2DPoint
& rUV
, basegfx::BColor
& rBColor
, double& rfOpacity
) const override
;
127 virtual void modifyOpacity(const basegfx::B2DPoint
& rUV
, double& rfOpacity
) const override
;
130 } // end of namespace drawinglayer::texture
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */