| Flutter Impeller |

stroke_parameters.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_GEOMETRY_STROKE_PARAMETERS_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_STROKE_PARAMETERS_H_
7
8 #include "flutter/impeller/geometry/scalar.h"
9
10 namespace impeller {
11
12 /// @brief An enum that describes ways to decorate the end of a path contour.
13 enum class Cap {
14 kButt,
15 kRound,
16 kSquare,
17 };
18
19 /// @brief An enum that describes ways to join two segments of a path.
20 enum class Join {
21 kMiter,
22 kRound,
23 kBevel,
24 };
25
26 /// @brief A structure to store all of the parameters related to stroking
27 /// a path or basic geometry object.
28 struct StrokeParameters {
29 Scalar width = 0.0f;
30 Cap cap = Cap::kButt;
31 Join join = Join::kMiter;
32 Scalar miter_limit = 4.0f;
33
34 constexpr bool operator==(const StrokeParameters& parameters) const = default;
35 };
36
37 } // namespace impeller
38
39 #endif // FLUTTER_IMPELLER_GEOMETRY_STROKE_PARAMETERS_H_
impeller
Definition: allocation.cc:12
impeller::Join
Join
An enum that describes ways to join two segments of a path.
Definition: stroke_parameters.h:20
impeller::Join::kRound
@ kRound
impeller::Join::kMiter
@ kMiter
impeller::Join::kBevel
@ kBevel
impeller::Scalar
float Scalar
Definition: scalar.h:19
impeller::Cap
Cap
An enum that describes ways to decorate the end of a path contour.
Definition: stroke_parameters.h:13
impeller::Cap::kRound
@ kRound
impeller::Cap::kButt
@ kButt
impeller::Cap::kSquare
@ kSquare
scalar.h
impeller::StrokeParameters
A structure to store all of the parameters related to stroking a path or basic geometry object.
Definition: stroke_parameters.h:28
impeller::StrokeParameters::cap
Cap cap
Definition: stroke_parameters.h:30
impeller::StrokeParameters::join
Join join
Definition: stroke_parameters.h:31
impeller::StrokeParameters::operator==
constexpr bool operator==(const StrokeParameters &parameters) const =default
impeller::StrokeParameters::miter_limit
Scalar miter_limit
Definition: stroke_parameters.h:32
impeller::StrokeParameters::width
Scalar width
Definition: stroke_parameters.h:29