LibreOffice Module drawinglayer (master) 1
|
FillGradientPrimitive2D class. More...
#include <fillgradientprimitive2d.hxx>
Public Member Functions | |
basegfx::B2DPolygon | getUnitPolygon () const |
helpers that support e.g. direct paint/geometry creation More... | |
basegfx::BColor | getOuterColor () const |
void | generateMatricesAndColors (std::function< void(const basegfx::B2DHomMatrix &rMatrix, const basegfx::BColor &rColor)> aCallback) const |
FillGradientPrimitive2D (const basegfx::B2DRange &rOutputRange, attribute::FillGradientAttribute aFillGradient) | |
constructors. The one without definition range will use output range as definition range More... | |
FillGradientPrimitive2D (const basegfx::B2DRange &rOutputRange, const basegfx::B2DRange &rDefinitionRange, attribute::FillGradientAttribute aFillGradient) | |
const basegfx::B2DRange & | getOutputRange () const |
data read access More... | |
const basegfx::B2DRange & | getDefinitionRange () const |
const attribute::FillGradientAttribute & | getFillGradient () const |
virtual bool | operator== (const BasePrimitive2D &rPrimitive) const override |
compare operator More... | |
virtual basegfx::B2DRange | getB2DRange (const geometry::ViewInformation2D &rViewInformation) const override |
get range More... | |
virtual sal_uInt32 | getPrimitive2DID () const override |
provide unique ID More... | |
Public Member Functions inherited from drawinglayer::primitive2d::BufferedDecompositionPrimitive2D | |
BufferedDecompositionPrimitive2D () | |
virtual void | get2DDecomposition (Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override |
The getDecomposition default implementation will on demand use create2DDecomposition() if maBuffered2DDecomposition is empty. More... | |
void | setTransparenceForShadow (sal_uInt16 nTransparenceForShadow) |
sal_uInt16 | getTransparenceForShadow () const |
Public Member Functions inherited from drawinglayer::primitive2d::BasePrimitive2D | |
BasePrimitive2D () | |
virtual | ~BasePrimitive2D () override |
virtual bool | operator== (const BasePrimitive2D &rPrimitive) const |
the ==operator is mainly needed to allow testing newly-created primitives against their last incarnation which buffers/holds the made decompositions. More... | |
bool | operator!= (const BasePrimitive2D &rPrimitive) const |
virtual basegfx::B2DRange | getB2DRange (const geometry::ViewInformation2D &rViewInformation) const |
The default implementation will use getDecomposition results to create the range. More... | |
virtual sal_uInt32 | getPrimitive2DID () const =0 |
provide unique ID for fast identifying of known primitive implementations in renderers. More... | |
virtual void | get2DDecomposition (Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const |
The default implementation will return an empty sequence. More... | |
Primitive2DContainer | getDecomposition (const css::uno::Sequence< css::beans::PropertyValue > &rViewParameters) |
The getDecomposition implementation for UNO API will use getDecomposition from this implementation. More... | |
css::geometry::RealRectangle2D | getRange (const css::uno::Sequence< css::beans::PropertyValue > &rViewParameters) |
The getRange implementation for UNO API will use getRange from this implementation. More... | |
virtual sal_Int64 | estimateUsage () |
Public Member Functions inherited from salhelper::SimpleReferenceObject | |
SimpleReferenceObject () | |
void | acquire () |
void | release () |
Protected Member Functions | |
void | createFill (Primitive2DContainer &rContainer, bool bOverlapping) const |
local helper More... | |
virtual void | create2DDecomposition (Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const override |
local decomposition. More... | |
Protected Member Functions inherited from drawinglayer::primitive2d::BufferedDecompositionPrimitive2D | |
const Primitive2DContainer & | getBuffered2DDecomposition () const |
access methods to maBuffered2DDecomposition. More... | |
void | setBuffered2DDecomposition (Primitive2DContainer &&rNew) |
virtual void | create2DDecomposition (Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const =0 |
method which is to be used to implement the local decomposition of a 2D primitive. More... | |
Protected Member Functions inherited from salhelper::SimpleReferenceObject | |
virtual | ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE |
Private Attributes | |
basegfx::B2DRange | maOutputRange |
the geometrically visible area More... | |
basegfx::B2DRange | maDefinitionRange |
the area the gradient definition is based on in the simplest case identical to OutputRange More... | |
attribute::FillGradientAttribute | maFillGradient |
the gradient definition More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from salhelper::SimpleReferenceObject | |
static void * | operator new (std::size_t nSize) |
static void * | operator new (std::size_t nSize, std::nothrow_t const &rNothrow) |
static void | operator delete (void *pPtr) |
static void | operator delete (void *pPtr, std::nothrow_t const &rNothrow) |
Protected Attributes inherited from salhelper::SimpleReferenceObject | |
oslInterlockedCount | m_nCount |
FillGradientPrimitive2D class.
This class defines a gradient filling for a rectangular area. The Range is defined by the Transformation, the gradient by the FillGradientAttribute.
The decomposition will deliver the decomposed gradient, e.g. for an ellipse gradient the various ellipses in various color steps will be created.
I have added functionality to create both versions of filled decompositions: Those who overlap and non-overlapping ones. The overlapping version is the default one since it works with and without AntiAliasing. The non-overlapping version is used in the MetafilePrimitive2D decomposition when the old XOR paint was recorded.
Definition at line 51 of file fillgradientprimitive2d.hxx.
drawinglayer::primitive2d::FillGradientPrimitive2D::FillGradientPrimitive2D | ( | const basegfx::B2DRange & | rOutputRange, |
attribute::FillGradientAttribute | aFillGradient | ||
) |
constructors. The one without definition range will use output range as definition range
Definition at line 273 of file fillgradientprimitive2d.cxx.
drawinglayer::primitive2d::FillGradientPrimitive2D::FillGradientPrimitive2D | ( | const basegfx::B2DRange & | rOutputRange, |
const basegfx::B2DRange & | rDefinitionRange, | ||
attribute::FillGradientAttribute | aFillGradient | ||
) |
Definition at line 282 of file fillgradientprimitive2d.cxx.
|
overrideprotectedvirtual |
local decomposition.
Implements drawinglayer::primitive2d::BufferedDecompositionPrimitive2D.
Definition at line 258 of file fillgradientprimitive2d.cxx.
References createFill(), and getFillGradient().
|
protected |
local helper
Definition at line 144 of file fillgradientprimitive2d.cxx.
References basegfx::utils::createPolygonFromRect(), generateMatricesAndColors(), getFillGradient(), getOuterColor(), getOutputRange(), getUnitPolygon(), size, and basegfx::B2DPolygon::transform().
Referenced by create2DDecomposition().
void drawinglayer::primitive2d::FillGradientPrimitive2D::generateMatricesAndColors | ( | std::function< void(const basegfx::B2DHomMatrix &rMatrix, const basegfx::BColor &rColor)> | aCallback | ) | const |
Definition at line 60 of file fillgradientprimitive2d.cxx.
References drawinglayer::texture::GeoTexSvxGradientLinear::appendTransformationsAndColors(), drawinglayer::texture::GeoTexSvxGradientAxial::appendTransformationsAndColors(), drawinglayer::texture::GeoTexSvxGradientRadial::appendTransformationsAndColors(), drawinglayer::texture::GeoTexSvxGradientElliptical::appendTransformationsAndColors(), drawinglayer::texture::GeoTexSvxGradientSquare::appendTransformationsAndColors(), drawinglayer::texture::GeoTexSvxGradientRect::appendTransformationsAndColors(), getDefinitionRange(), getFillGradient(), and getOutputRange().
Referenced by createFill(), drawinglayer::processor2d::D2DPixelProcessor2D::processFillGradientPrimitive2D(), and drawinglayer::processor2d::VclPixelProcessor2D::processFillGradientPrimitive2D().
|
overridevirtual |
get range
Reimplemented from drawinglayer::primitive2d::BasePrimitive2D.
Definition at line 306 of file fillgradientprimitive2d.cxx.
References getOutputRange().
|
inline |
Definition at line 90 of file fillgradientprimitive2d.hxx.
Referenced by generateMatricesAndColors(), operator==(), and drawinglayer::processor2d::VclPixelProcessor2D::processFillGradientPrimitive2D().
|
inline |
Definition at line 91 of file fillgradientprimitive2d.hxx.
Referenced by create2DDecomposition(), createFill(), generateMatricesAndColors(), getOuterColor(), getUnitPolygon(), operator==(), drawinglayer::processor2d::VclPixelProcessor2D::processFillGradientPrimitive2D(), and drawinglayer::processor2d::VclMetafileProcessor2D::processTransparencePrimitive2D().
basegfx::BColor drawinglayer::primitive2d::FillGradientPrimitive2D::getOuterColor | ( | ) | const |
Definition at line 37 of file fillgradientprimitive2d.cxx.
References drawinglayer::attribute::FillGradientAttribute::getColorStops(), and getFillGradient().
Referenced by createFill(), drawinglayer::processor2d::D2DPixelProcessor2D::processFillGradientPrimitive2D(), and drawinglayer::processor2d::VclPixelProcessor2D::processFillGradientPrimitive2D().
|
inline |
data read access
Definition at line 89 of file fillgradientprimitive2d.hxx.
Referenced by createFill(), generateMatricesAndColors(), getB2DRange(), operator==(), drawinglayer::processor2d::D2DPixelProcessor2D::processFillGradientPrimitive2D(), and drawinglayer::processor2d::VclPixelProcessor2D::processFillGradientPrimitive2D().
|
overridevirtual |
provide unique ID
Implements drawinglayer::primitive2d::BasePrimitive2D.
Definition at line 313 of file fillgradientprimitive2d.cxx.
References PRIMITIVE2D_ID_FILLGRADIENTPRIMITIVE2D.
Referenced by drawinglayer::processor2d::VclMetafileProcessor2D::processTransparencePrimitive2D().
basegfx::B2DPolygon drawinglayer::primitive2d::FillGradientPrimitive2D::getUnitPolygon | ( | ) | const |
helpers that support e.g. direct paint/geometry creation
Definition at line 49 of file fillgradientprimitive2d.cxx.
References basegfx::utils::createPolygonFromCircle(), basegfx::utils::createPolygonFromRect(), and getFillGradient().
Referenced by createFill(), drawinglayer::processor2d::D2DPixelProcessor2D::processFillGradientPrimitive2D(), and drawinglayer::processor2d::VclPixelProcessor2D::processFillGradientPrimitive2D().
|
overridevirtual |
compare operator
Reimplemented from drawinglayer::primitive2d::BasePrimitive2D.
Definition at line 292 of file fillgradientprimitive2d.cxx.
References getDefinitionRange(), getFillGradient(), and getOutputRange().
|
private |
the area the gradient definition is based on in the simplest case identical to OutputRange
Definition at line 59 of file fillgradientprimitive2d.hxx.
|
private |
the gradient definition
Definition at line 62 of file fillgradientprimitive2d.hxx.
|
private |
the geometrically visible area
Definition at line 55 of file fillgradientprimitive2d.hxx.