LibreOffice Module drawinglayer (master) 1
texture3d.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <texture/texture.hxx>
23#include <vcl/bitmapex.hxx>
24
26 class HatchTexturePrimitive3D;
27}
28
30 {
31 class GeoTexSvxMono final : public GeoTexSvx
32 {
34 double mfOpacity;
35
36 public:
38 const basegfx::BColor& rSingleColor,
39 double fOpacity);
40
41 // compare operator
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;
45 };
46
47} // end of namespace drawinglayer::texture
48
50 {
52 {
53 protected:
55 Bitmap maBitmap; // Bitmap held within maBitmapEx, to exist during mpReadBitmap scope
61 double mfMulX;
62 double mfMulY;
63
64 bool mbIsAlpha : 1;
65
66 // helpers
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;
69
70 public:
72 const BitmapEx& rBitmapEx,
73 const basegfx::B2DRange& rRange);
74 virtual ~GeoTexSvxBitmapEx() override;
75
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;
78 };
79
80} // end of namespace drawinglayer::texture
81
83 {
85 {
86 double mfOffsetX;
87 double mfOffsetY;
88
89 bool mbUseOffsetX : 1;
90 bool mbUseOffsetY : 1;
91
92 // helpers
94
95 public:
97 const BitmapEx& rBitmapEx,
98 const basegfx::B2DRange& rRange,
99 double fOffsetX,
100 double fOffsetY);
101
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;
104 };
105
106} // end of namespace drawinglayer::texture
107
108namespace drawinglayer::texture
109 {
110 class GeoTexSvxMultiHatch final : public GeoTexSvx
111 {
114 std::unique_ptr<GeoTexSvxHatch> mp0;
115 std::unique_ptr<GeoTexSvxHatch> mp1;
116 std::unique_ptr<GeoTexSvxHatch> mp2;
117
119
120 // helpers
121 bool impIsOnHatch(const basegfx::B2DPoint& rUV) const;
122
123 public:
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;
128 };
129
130} // end of namespace drawinglayer::texture
131
132/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
basegfx::B2DPoint impGetCorrected(const basegfx::B2DPoint &rUV) const
Definition: texture3d.cxx:197
virtual void modifyOpacity(const basegfx::B2DPoint &rUV, double &rfOpacity) const override
Definition: texture3d.cxx:258
GeoTexSvxBitmapExTiled(const BitmapEx &rBitmapEx, const basegfx::B2DRange &rRange, double fOffsetX, double fOffsetY)
Definition: texture3d.cxx:237
virtual void modifyBColor(const basegfx::B2DPoint &rUV, basegfx::BColor &rBColor, double &rfOpacity) const override
Definition: texture3d.cxx:250
sal_uInt8 impGetTransparence(sal_Int32 rX, sal_Int32 rY) const
Definition: texture3d.cxx:106
bool impIsValid(const basegfx::B2DPoint &rUV, sal_Int32 &rX, sal_Int32 &rY) const
Definition: texture3d.cxx:117
virtual void modifyBColor(const basegfx::B2DPoint &rUV, basegfx::BColor &rBColor, double &rfOpacity) const override
Definition: texture3d.cxx:134
GeoTexSvxBitmapEx(const BitmapEx &rBitmapEx, const basegfx::B2DRange &rRange)
Definition: texture3d.cxx:61
Bitmap::ScopedReadAccess mpReadBitmap
Definition: texture3d.hxx:56
Bitmap::ScopedReadAccess mpReadTransparence
Definition: texture3d.hxx:58
virtual void modifyOpacity(const basegfx::B2DPoint &rUV, double &rfOpacity) const override
Definition: texture3d.cxx:167
virtual void modifyBColor(const basegfx::B2DPoint &rUV, basegfx::BColor &rBColor, double &rfOpacity) const override
Definition: texture3d.cxx:50
virtual void modifyOpacity(const basegfx::B2DPoint &rUV, double &rfOpacity) const override
Definition: texture3d.cxx:55
GeoTexSvxMono(const basegfx::BColor &rSingleColor, double fOpacity)
Definition: texture3d.cxx:33
virtual bool operator==(const GeoTexSvx &rGeoTexSvx) const override
Definition: texture3d.cxx:41
virtual void modifyBColor(const basegfx::B2DPoint &rUV, basegfx::BColor &rBColor, double &rfOpacity) const override
Definition: texture3d.cxx:326
GeoTexSvxMultiHatch(const primitive3d::HatchTexturePrimitive3D &rPrimitive, double fLogicPixelSize)
Definition: texture3d.cxx:267
std::unique_ptr< GeoTexSvxHatch > mp2
Definition: texture3d.hxx:116
std::unique_ptr< GeoTexSvxHatch > mp1
Definition: texture3d.hxx:115
std::unique_ptr< GeoTexSvxHatch > mp0
Definition: texture3d.hxx:114
bool impIsOnHatch(const basegfx::B2DPoint &rUV) const
Definition: texture3d.cxx:306
virtual void modifyOpacity(const basegfx::B2DPoint &rUV, double &rfOpacity) const override
Definition: texture3d.cxx:338
SdrPrimitive3D class.
unsigned char sal_uInt8