| Flutter Impeller |

Public Member Functions | List of all members
impeller::interop::LineMetrics Class Referencefinal

Internal C++ peer of ImpellerLineMetrics. For detailed documentation, refer to the headerdocs in the public API in impeller.h. More...

`#include <line_metrics.h>`

Inheritance diagram for impeller::interop::LineMetrics:

## Public Member Functions
| LineMetrics (const std::vector< txt::LineMetrics > &metrics)
| ~LineMetrics ()
| LineMetrics (const LineMetrics &)=delete
LineMetrics & | operator= (const LineMetrics &)=delete
double | GetAscent (size_t line) const
double | GetUnscaledAscent (size_t line) const
double | GetDescent (size_t line) const
double | GetBaseline (size_t line) const
bool | IsHardbreak (size_t line) const
double | GetWidth (size_t line) const
double | GetHeight (size_t line) const
double | GetLeft (size_t line) const
size_t | GetCodeUnitStartIndex (size_t line) const
size_t | GetCodeUnitEndIndex (size_t line) const
size_t | GetCodeUnitEndIndexExcludingWhitespace (size_t line) const
size_t | GetCodeUnitEndIndexIncludingNewline (size_t line) const
Public Member Functions inherited from impeller::interop::ObjectBase
| ObjectBase ()=default
virtual | ~ObjectBase ()=default
| ObjectBase (const ObjectBase &)=delete
| ObjectBase (ObjectBase &&)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
ObjectBase & | operator= (ObjectBase &&)=delete
void | Retain ()
void | Release ()
uint64_t | GetRefCountForTests () const

## Additional Inherited Members
Public Types inherited from impeller::interop::Object< LineMetrics, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerLineMetrics)>
using | InteropClass = LineMetrics
using | InteropCSibling = IMPELLER_INTERNAL_HANDLE_NAME(ImpellerLineMetrics)
Static Public Member Functions inherited from impeller::interop::ObjectBase
static void | SafeRetain (void *ptr)
static void | SafeRelease (void *ptr)

## Detailed Description

Internal C++ peer of ImpellerLineMetrics. For detailed documentation, refer to the headerdocs in the public API in impeller.h.

Accessing metrics of missing lines returns default initialized values.

Definition at line 24 of file line_metrics.h.

## Constructor & Destructor Documentation

## ◆ LineMetrics() [1/2]

impeller::interop::LineMetrics::LineMetrics | ( | const std::vector< txt::LineMetrics > & | metrics | ) |
| explicit

Definition at line 9 of file line_metrics.cc.

9 {
10 // There aren't any guarantees (documented or otherwise) that metrics will
11 // have line numbers that are sorted or contiguous.
12 for (const auto& metric : metrics) {
13 metrics_[metric.line_number] = metric;
14 }
15 }

## ◆ ~LineMetrics()

impeller::interop::LineMetrics::~LineMetrics | ( |  | ) |
| default

## ◆ LineMetrics() [2/2]

impeller::interop::LineMetrics::LineMetrics | ( | const LineMetrics & |  | ) |
| delete

## Member Function Documentation

## ◆ GetAscent()

double impeller::interop::LineMetrics::GetAscent | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetAscent.

Definition at line 19 of file line_metrics.cc.

19 {
20 return GetLine(line).ascent;
21 }

## ◆ GetBaseline()

double impeller::interop::LineMetrics::GetBaseline | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetBaseline.

Definition at line 31 of file line_metrics.cc.

31 {
32 return GetLine(line).baseline;
33 }

## ◆ GetCodeUnitEndIndex()

size_t impeller::interop::LineMetrics::GetCodeUnitEndIndex | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetCodeUnitEndIndex.

Definition at line 55 of file line_metrics.cc.

55 {
56 return GetLine(line).end_index;
57 }

## ◆ GetCodeUnitEndIndexExcludingWhitespace()

size_t impeller::interop::LineMetrics::GetCodeUnitEndIndexExcludingWhitespace | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetCodeUnitEndIndexExcludingWhitespace.

Definition at line 59 of file line_metrics.cc.

59 {
60 return GetLine(line).end_excluding_whitespace;
61 }

## ◆ GetCodeUnitEndIndexIncludingNewline()

size_t impeller::interop::LineMetrics::GetCodeUnitEndIndexIncludingNewline | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetCodeUnitEndIndexIncludingNewline.

Definition at line 63 of file line_metrics.cc.

63 {
64 return GetLine(line).end_including_newline;
65 }

## ◆ GetCodeUnitStartIndex()

size_t impeller::interop::LineMetrics::GetCodeUnitStartIndex | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetCodeUnitStartIndex.

Definition at line 51 of file line_metrics.cc.

51 {
52 return GetLine(line).start_index;
53 }

## ◆ GetDescent()

double impeller::interop::LineMetrics::GetDescent | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetDescent.

Definition at line 27 of file line_metrics.cc.

27 {
28 return GetLine(line).descent;
29 }

## ◆ GetHeight()

double impeller::interop::LineMetrics::GetHeight | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetHeight.

Definition at line 43 of file line_metrics.cc.

43 {
44 return GetLine(line).height;
45 }

## ◆ GetLeft()

double impeller::interop::LineMetrics::GetLeft | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetLeft.

Definition at line 47 of file line_metrics.cc.

47 {
48 return GetLine(line).left;
49 }

## ◆ GetUnscaledAscent()

double impeller::interop::LineMetrics::GetUnscaledAscent | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetUnscaledAscent.

Definition at line 23 of file line_metrics.cc.

23 {
24 return GetLine(line).unscaled_ascent;
25 }

## ◆ GetWidth()

double impeller::interop::LineMetrics::GetWidth | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsGetWidth.

Definition at line 39 of file line_metrics.cc.

39 {
40 return GetLine(line).width;
41 }

## ◆ IsHardbreak()

bool impeller::interop::LineMetrics::IsHardbreak | ( | size_t | line | ) | const

See also
  ImpellerLineMetricsIsHardbreak.

Definition at line 35 of file line_metrics.cc.

35 {
36 return GetLine(line).hard_break;
37 }

## ◆ operator=()

LineMetrics& impeller::interop::LineMetrics::operator= | ( | const LineMetrics & |  | ) |
| delete

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

- impeller/toolkit/interop/line_metrics.h
- impeller/toolkit/interop/line_metrics.cc