CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
path_gradient_brush.h
1
2#ifndef _aspose_drawing_drawing2d_path_gradient_brush_h_
3#define _aspose_drawing_drawing2d_path_gradient_brush_h_
4
5#include "fwd.h"
6#include "drawing/color.h"
7#include "drawing/brush.h"
8#include "drawing/rectangle_f.h"
9#include "drawing/drawing2d/wrap_mode.h"
10#include "drawing/drawing2d/matrix_order.h"
11#include "drawing/point_f.h"
12#include "system/array.h"
13
14#ifdef ASPOSECPPLIB_BEING_BUILT
15#include <core/SkColor.h>
16#include <core/SkPoint.h>
17#endif
19ASPOSECPP_3RD_PARTY_TYPEDEF(SkColor, std::uint32_t);
21ASPOSECPP_3RD_PARTY_CLASS(SkPaint);
23ASPOSECPP_3RD_PARTY_STRUCT(SkPoint);
25ASPOSECPP_3RD_PARTY_TYPEDEF(SkScalar, float);
26
27
28namespace System { namespace Drawing { namespace Drawing2D {
29
30class Blend;
31class ColorBlend;
32class GraphicsPath;
33class Matrix;
38class ASPOSECPP_SHARED_CLASS PathGradientBrush: public Brush
39{
41 RTTI_INFO(System::Drawing::Drawing2D::PathGradientBrush, ::System::BaseTypesInfo<System::Drawing::Brush>);
42
43public:
44
49 ASPOSECPP_SHARED_API PathGradientBrush(const ArrayPtr<PointF>& points, WrapMode wrapMode = WrapMode::Clamp);
54 ASPOSECPP_SHARED_API PathGradientBrush(const ArrayPtr<Point>& points, WrapMode wrapMode = WrapMode::Clamp);
57 ASPOSECPP_SHARED_API PathGradientBrush(const SharedPtr<GraphicsPath>& path);
58
60 ASPOSECPP_SHARED_API WrapMode get_WrapMode() const;
63 ASPOSECPP_SHARED_API void set_WrapMode(WrapMode value);
64
66 ASPOSECPP_SHARED_API SharedPtr<ColorBlend> get_InterpolationColors() const;
69 ASPOSECPP_SHARED_API void set_InterpolationColors(const SharedPtr<ColorBlend>& value);
70
72 ASPOSECPP_SHARED_API PointF get_CenterPoint() const;
75 ASPOSECPP_SHARED_API void set_CenterPoint(const PointF& value);
76
78 ASPOSECPP_SHARED_API Color get_CenterColor() const;
80 ASPOSECPP_SHARED_API ArrayPtr<Color> get_SurroundColors() const;
81
83 ASPOSECPP_SHARED_API void ResetTransform();
88 ASPOSECPP_SHARED_API void ScaleTransform(float sx, float sy, Drawing2D::MatrixOrder order = Drawing2D::MatrixOrder::Prepend);
92 ASPOSECPP_SHARED_API void RotateTransform(float angle, Drawing2D::MatrixOrder order = Drawing2D::MatrixOrder::Prepend);
97 ASPOSECPP_SHARED_API void TranslateTransform(float dx, float dy, Drawing2D::MatrixOrder order = Drawing2D::MatrixOrder::Prepend);
101 ASPOSECPP_SHARED_API void MultiplyTransform(const SharedPtr<Matrix>& matrix, MatrixOrder order = MatrixOrder::Prepend);
104 ASPOSECPP_SHARED_API SharedPtr<Matrix> get_Transform() const;
108 ASPOSECPP_SHARED_API void set_Transform(const SharedPtr<Matrix>& value);
109
112 ASPOSECPP_SHARED_API void set_SurroundColors(const ArrayPtr<Color>& value);
115 ASPOSECPP_SHARED_API void set_CenterColor(Color value);
118 ASPOSECPP_SHARED_API void set_FocusScales(const PointF& value);
121 ASPOSECPP_SHARED_API void SetSigmaBellShape(float focus, float scale = 1.0f);
124 ASPOSECPP_SHARED_API SharedPtr<Blend> get_Blend() const;
127 ASPOSECPP_SHARED_API void set_Blend(const SharedPtr<Blend>& value);
129 ASPOSECPP_SHARED_API PointF get_FocusScales() const;
132 ASPOSECPP_SHARED_API RectangleF get_Rectangle();
135 ASPOSECPP_SHARED_API void SetBlendTriangularShape(float focus, float scale = 1.0f);
136
139 virtual ASPOSECPP_SHARED_API SharedPtr<Brush> Clone() override;
140
141protected:
146 virtual ASPOSECPP_SHARED_API void Apply(SkPaint& paint, const SharedPtr<Drawing2D::Matrix>& matrix, bool apply_shift) override;
147
148private:
152 void ApplyPathGradient(SkPaint& paint, const SharedPtr<Drawing2D::Matrix>& matrix) const;
153
155 void CalculateGradientColors() const;
156
157private:
158
160 PointF m_focus_scales;
162 PointF m_center_point;
163
165 SkColor m_center_color;
167 ArrayPtr<Color> m_surround_colors;
168
170 mutable std::vector<SkColor> m_colors;
171 std::vector<float> m_factors;
173 std::vector<SkScalar> m_positions;
174 bool m_interpolation_colors = false;
175
177 const RectangleF m_path_bounds;
179 std::vector<SkPoint> m_path_points;
181 WrapMode m_wrap_mode;
183 SharedPtr<Matrix> m_transform_matrix;
184
185};
186
187}}}
188
189#endif // _aspose_drawing_drawing2d_path_gradient_brush_h_
A base class for classes that represent fillers used to fill the interiors of graphical shapes....
Definition: brush.h:18
Represents a color. This type should be allocated on stack and passed to functions by value or by ref...
Definition: color.h:24
Represents a brush that fills the interior of a GraphicsPath object with a gradient....
Definition: path_gradient_brush.h:39
void set_Transform(const SharedPtr< Matrix > &value)
Sets a Matrix object that specifies the geometrical transformations for the brush represented by the ...
WrapMode get_WrapMode() const
Returns the wrap mode.
void set_WrapMode(WrapMode value)
Sets the wrap mode.
RectangleF get_Rectangle()
NOT IMPLEMENTED.
SharedPtr< Blend > get_Blend() const
NOT IMPLEMENTED.
SharedPtr< Matrix > get_Transform() const
Returns a copy of a Matrix object that specifies the geometrical transformations for the brush repres...
ArrayPtr< Color > get_SurroundColors() const
Returns colors that correspond to the points in the path this PathGradientBrush fills.
PointF get_FocusScales() const
Gets the focus point for the gradient falloff.
virtual void Apply(SkPaint &paint, const SharedPtr< Drawing2D::Matrix > &matrix, bool apply_shift) override
Sets the properties of the current brush on the specified SkPaint object.
PathGradientBrush(const ArrayPtr< Point > &points, WrapMode wrapMode=WrapMode::Clamp)
Constructs a new instance of PathGradientBrush class.
void set_CenterColor(Color value)
Sets a color that is at the center of the path filled by the current object.
void ScaleTransform(float sx, float sy, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
Scales the local geometric transformation by the specified factors in the specified order.
void SetSigmaBellShape(float focus, float scale=1.0f)
NOT IMPLEMENTED.
void set_FocusScales(const PointF &value)
Sets the focus point for the gradient falloff.
void set_Blend(const SharedPtr< Blend > &value)
Sets a blend that specifies factors and positions of base colors for this brush.
void set_InterpolationColors(const SharedPtr< ColorBlend > &value)
Sets a value the defines a multicolor linear gradient.
void TranslateTransform(float dx, float dy, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
Translates the local geometric transformation by the specified dimensions in the specified order.
PointF get_CenterPoint() const
Gets the center point of the gradient.
void set_SurroundColors(const ArrayPtr< Color > &value)
Sets colors that correspond to the points in the path this PathGradientBrush fills.
void set_CenterPoint(const PointF &value)
Sets the center point of the gradient.
void ResetTransform()
Resets the current object's transform matrix so that it becomes an identity matrix.
PathGradientBrush(const ArrayPtr< PointF > &points, WrapMode wrapMode=WrapMode::Clamp)
Constructs a new instance of PathGradientBrush class.
virtual SharedPtr< Brush > Clone() override
Creates a copy of the current object.
void SetBlendTriangularShape(float focus, float scale=1.0f)
NOT IMPLEMENTED.
void RotateTransform(float angle, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
Rotates the local geometric transformation by the specified angle in the specified order.
SharedPtr< ColorBlend > get_InterpolationColors() const
Returns a value the defines a multicolor linear gradient.
PathGradientBrush(const SharedPtr< GraphicsPath > &path)
Constructs a new instance of PathGradientBrush class.
Color get_CenterColor() const
Returns a color that is at the center of the path filled by the current object.
void MultiplyTransform(const SharedPtr< Matrix > &matrix, MatrixOrder order=MatrixOrder::Prepend)
Multiplies current object's transform matrix by the specified matrix.
Represents a pair of single-precision floating point X and Y coordinates of a point on a 2-dimensiona...
Definition: point_f.h:14
Represents a rectangular area of an image defined as single-precision floating point X and Y coordina...
Definition: rectangle_f.h:15
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
MatrixOrder
Specifies the order of matrix transform operations.
Definition: matrix_order.h:7
@ Prepend
The new operation is applied before the old operation.
WrapMode
Specifies how a texture or a gradient is tiled when it is smaller than the area being filled.
Definition: wrap_mode.h:9
@ Clamp
Clamps the texture or gradient to the object boundary.
Definition: db_command.h:9