#include <decompressed_image.h>
Definition at line 15 of file decompressed_image.h.
◆ Format
Enumerator |
---|
kInvalid | |
kGrey | |
kGreyAlpha | |
kRGB | |
kRGBA | |
Definition at line 17 of file decompressed_image.h.
17 {
19 kGrey,
20 kGreyAlpha,
21 kRGB,
23 };
◆ DecompressedImage() [1/2]
impeller::DecompressedImage::DecompressedImage |
( |
| ) |
|
|
default |
◆ DecompressedImage() [2/2]
impeller::DecompressedImage::DecompressedImage |
( |
ISize |
size, |
|
|
Format |
format, |
|
|
std::shared_ptr< const fml::Mapping > |
allocation |
|
) |
| |
Definition at line 16 of file decompressed_image.cc.
20 : size_(
size), format_(
format), allocation_(std::move(allocation)) {
22 return;
23 }
24 is_valid_ = true;
25}
uint32_t uint32_t * format
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
◆ ~DecompressedImage()
impeller::DecompressedImage::~DecompressedImage |
( |
| ) |
|
|
default |
◆ ConvertToRGBA()
Definition at line 62 of file decompressed_image.cc.
62 {
63 if (!is_valid_) {
64 return {};
65 }
66
69 }
70
72 const auto source_byte_size = size_.
Area() * bpp;
73 if (allocation_->GetSize() < source_byte_size) {
74 return {};
75 }
76
77 auto rgba_allocation = std::make_shared<Allocation>();
78 if (!rgba_allocation->Truncate(size_.
Area() * 4u,
false)) {
79 return {};
80 }
81
82 const uint8_t*
source = allocation_->GetMapping();
83 uint8_t*
dest = rgba_allocation->GetBuffer();
84
85 for (
size_t i = 0, j = 0;
i < source_byte_size;
i += bpp, j += 4u) {
86 switch (format_) {
92 break;
98 break;
104 break;
107
108
110 break;
111 }
112 }
113
116 std::make_shared<fml::NonOwnedMapping>(
117 rgba_allocation->GetBuffer(),
118 rgba_allocation->GetLength(),
119 [rgba_allocation](auto, auto) {})
120 };
121}
#define FML_CHECK(condition)
static float max(float r, float g, float b)
static size_t GetBytesPerPixel(DecompressedImage::Format format)
constexpr Type Area() const
◆ GetAllocation()
const std::shared_ptr< const fml::Mapping > & impeller::DecompressedImage::GetAllocation |
( |
| ) |
const |
◆ GetFormat()
◆ GetSize()
const ISize & impeller::DecompressedImage::GetSize |
( |
| ) |
const |
◆ IsValid()
bool impeller::DecompressedImage::IsValid |
( |
| ) |
const |
The documentation for this class was generated from the following files: