| Flutter Impeller |

Public Member Functions | List of all members
impeller::BitmapSTB Class Reference

`#include <glyph_atlas_context_stb.h>`

## Public Member Functions
| BitmapSTB ()
| ~BitmapSTB ()
| BitmapSTB (size_t width, size_t height, size_t bytes_per_pixel)
uint8_t * | GetPixels ()
uint8_t * | GetPixelAddress (TPoint< size_t > coords)
size_t | GetRowBytes () const
size_t | GetWidth () const
size_t | GetHeight () const
size_t | GetSize () const

## Detailed Description

Definition at line 12 of file glyph_atlas_context_stb.h.

## Constructor & Destructor Documentation

## ◆ BitmapSTB() [1/2]

impeller::BitmapSTB::BitmapSTB | ( |  | ) |
| default

## ◆ ~BitmapSTB()

impeller::BitmapSTB::~BitmapSTB | ( |  | ) |
| default

## ◆ BitmapSTB() [2/2]

impeller::BitmapSTB::BitmapSTB | ( | size_t | width,
|  | size_t | height,
|  | size_t | bytes_per_pixel
| ) |  |

Definition at line 13 of file glyph_atlas_context_stb.cc.

14 : width_(width),
15 height_(height),
16 bytes_per_pixel_(bytes_per_pixel),
17 pixels_(std::vector<uint8_t>(width * height * bytes_per_pixel, 0)) {}

## Member Function Documentation

## ◆ GetHeight()

size_t impeller::BitmapSTB::GetHeight | ( |  | ) | const

Definition at line 38 of file glyph_atlas_context_stb.cc.

38 {
39 return height_;
40 }

## ◆ GetPixelAddress()

uint8_t * impeller::BitmapSTB::GetPixelAddress | ( | TPoint< size_t > | coords | ) |

Definition at line 23 of file glyph_atlas_context_stb.cc.

23 {
24 FML_DCHECK(coords.x < width_);
25 FML_DCHECK(coords.x < height_);
26
27 return &pixels_.data()[(coords.x + width_ * coords.y) * bytes_per_pixel_];
28 }

References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

Referenced by impeller::DrawGlyph().

## ◆ GetPixels()

uint8_t * impeller::BitmapSTB::GetPixels | ( |  | ) |

Definition at line 19 of file glyph_atlas_context_stb.cc.

19 {
20 return pixels_.data();
21 }

## ◆ GetRowBytes()

size_t impeller::BitmapSTB::GetRowBytes | ( |  | ) | const

Definition at line 30 of file glyph_atlas_context_stb.cc.

30 {
31 return width_ * bytes_per_pixel_;
32 }

Referenced by impeller::DrawGlyph().

## ◆ GetSize()

size_t impeller::BitmapSTB::GetSize | ( |  | ) | const

Definition at line 42 of file glyph_atlas_context_stb.cc.

42 {
43 return width_ * height_ * bytes_per_pixel_;
44 }

## ◆ GetWidth()

size_t impeller::BitmapSTB::GetWidth | ( |  | ) | const

Definition at line 34 of file glyph_atlas_context_stb.cc.

34 {
35 return width_;
36 }

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

- impeller/typographer/backends/stb/glyph_atlas_context_stb.h
- impeller/typographer/backends/stb/glyph_atlas_context_stb.cc