| Flutter Impeller |

Public Member Functions | Friends | List of all members
impeller::Path::ComponentIterator Class Reference

`#include <path.h>`

## Public Member Functions
ComponentType | type () const
const LinearPathComponent * | linear () const
const QuadraticPathComponent * | quadratic () const
const ConicPathComponent * | conic () const
const CubicPathComponent * | cubic () const
const ContourComponent * | contour () const
ComponentIterator & | operator++ ()
bool | operator== (const ComponentIterator &other) const
bool | operator!= (const ComponentIterator &other) const

## Friends
class | Path

## Detailed Description

Definition at line 64 of file path.h.

## Member Function Documentation

## ◆ conic()

const ConicPathComponent * impeller::Path::ComponentIterator::conic | ( |  | ) | const

Definition at line 47 of file path.cc.

47 {
48 if (!CHECK_COMPONENT(Path::ComponentType::kConic)) {
49 return nullptr;
50 }
51 const Point* points = &(path_.data_->points[storage_offset_]);
52 return reinterpret_cast<const ConicPathComponent*>(points);
53 }
impeller::Path::ComponentType::kConic
@ kConic
CHECK_COMPONENT
#define CHECK_COMPONENT(type)
Definition: path.cc:26
impeller::Point
TPoint< Scalar > Point
Definition: point.h:327

References CHECK_COMPONENT, and impeller::Path::kConic.

## ◆ contour()

const ContourComponent * impeller::Path::ComponentIterator::contour | ( |  | ) | const

Definition at line 63 of file path.cc.

63 {
64 if (!CHECK_COMPONENT(Path::ComponentType::kContour)) {
65 return nullptr;
66 }
67 const Point* points = &(path_.data_->points[storage_offset_]);
68 return reinterpret_cast<const ContourComponent*>(points);
69 }
impeller::Path::ComponentType::kContour
@ kContour

References CHECK_COMPONENT, and impeller::Path::kContour.

Referenced by impeller::testing::TEST().

## ◆ cubic()

const CubicPathComponent * impeller::Path::ComponentIterator::cubic | ( |  | ) | const

Definition at line 55 of file path.cc.

55 {
56 if (!CHECK_COMPONENT(Path::ComponentType::kCubic)) {
57 return nullptr;
58 }
59 const Point* points = &(path_.data_->points[storage_offset_]);
60 return reinterpret_cast<const CubicPathComponent*>(points);
61 }
impeller::Path::ComponentType::kCubic
@ kCubic

References CHECK_COMPONENT, and impeller::Path::kCubic.

## ◆ linear()

const LinearPathComponent * impeller::Path::ComponentIterator::linear | ( |  | ) | const

Definition at line 31 of file path.cc.

31 {
32 if (!CHECK_COMPONENT(Path::ComponentType::kLinear)) {
33 return nullptr;
34 }
35 const Point* points = &(path_.data_->points[storage_offset_]);
36 return reinterpret_cast<const LinearPathComponent*>(points);
37 }
impeller::Path::ComponentType::kLinear
@ kLinear

References CHECK_COMPONENT, and impeller::Path::kLinear.

## ◆ operator!=()

bool impeller::Path::ComponentIterator::operator!= | ( | const ComponentIterator & | other | ) | const
| inline

Definition at line 80 of file path.h.

80 {
81 return component_index_ != other.component_index_;
82 }

## ◆ operator++()

Path::ComponentIterator & impeller::Path::ComponentIterator::operator++ | ( |  | ) |

Definition at line 71 of file path.cc.

71 {
72 auto components = path_.data_->components;
73 if (component_index_ < components.size()) {
74 storage_offset_ += VerbToOffset(path_.data_->components[component_index_]);
75 component_index_++;
76 }
77 return *this;
78 }
impeller::Path::VerbToOffset
static constexpr size_t VerbToOffset(Path::ComponentType verb)
Definition: path.h:95

References impeller::Path::VerbToOffset().

## ◆ operator==()

bool impeller::Path::ComponentIterator::operator== | ( | const ComponentIterator & | other | ) | const
| inline

Definition at line 77 of file path.h.

77 {
78 return component_index_ == other.component_index_;
79 }

## ◆ quadratic()

const QuadraticPathComponent * impeller::Path::ComponentIterator::quadratic | ( |  | ) | const

Definition at line 39 of file path.cc.

39 {
40 if (!CHECK_COMPONENT(Path::ComponentType::kQuadratic)) {
41 return nullptr;
42 }
43 const Point* points = &(path_.data_->points[storage_offset_]);
44 return reinterpret_cast<const QuadraticPathComponent*>(points);
45 }
impeller::Path::ComponentType::kQuadratic
@ kQuadratic

References CHECK_COMPONENT, and impeller::Path::kQuadratic.

## ◆ type()

Path::ComponentType impeller::Path::ComponentIterator::type | ( |  | ) | const

Definition at line 22 of file path.cc.

22 {
23 return path_.data_->components[component_index_];
24 }

Referenced by impeller::testing::TEST().

## Friends And Related Function Documentation

## ◆ Path

friend class Path
| friend

Definition at line 92 of file path.h.

The documentation for this class was generated from the following files:

- impeller/geometry/path.h
- impeller/geometry/path.cc