| Flutter Impeller |

decompressed_image.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_IMAGE_DECOMPRESSED_IMAGE_H_
6 #define FLUTTER_IMPELLER_IMAGE_DECOMPRESSED_IMAGE_H_
7
8 #include <memory>
9 #include <optional>
10
11 #include "flutter/fml/macros.h"
12 #include "flutter/fml/mapping.h"
13 #include "impeller/geometry/size.h"
14
15 namespace impeller {
16
17 class DecompressedImage {
18 public:
19 enum class Format {
20 kInvalid,
21 kGrey,
22 kGreyAlpha,
23 kRGB,
24 kRGBA,
25 };
26
27 DecompressedImage();
28
29 DecompressedImage(ISize size,
30 Format format,
31 std::shared_ptr<const fml::Mapping> allocation);
32
33 ~DecompressedImage();
34
35 const ISize& GetSize() const;
36
37 bool IsValid() const;
38
39 Format GetFormat() const;
40
41 const std::shared_ptr<const fml::Mapping>& GetAllocation() const;
42
43 DecompressedImage ConvertToRGBA() const;
44
45 private:
46 ISize size_;
47 Format format_ = Format::kInvalid;
48 std::shared_ptr<const fml::Mapping> allocation_;
49 bool is_valid_ = false;
50 };
51
52 } // namespace impeller
53
54 #endif // FLUTTER_IMPELLER_IMAGE_DECOMPRESSED_IMAGE_H_
impeller::DecompressedImage
Definition: decompressed_image.h:17
impeller::DecompressedImage::Format::kRGBA
@ kRGBA
impeller::DecompressedImage::Format::kGrey
@ kGrey
impeller::TSize< int64_t >
impeller::DecompressedImage::ConvertToRGBA
DecompressedImage ConvertToRGBA() const
Definition: decompressed_image.cc:62
impeller::DecompressedImage::Format::kRGB
@ kRGB
impeller::DecompressedImage::GetFormat
Format GetFormat() const
Definition: decompressed_image.cc:37
impeller::DecompressedImage::IsValid
bool IsValid() const
Definition: decompressed_image.cc:29
impeller::DecompressedImage::DecompressedImage
DecompressedImage()
impeller::DecompressedImage::GetAllocation
const std::shared_ptr< const fml::Mapping > & GetAllocation() const
Definition: decompressed_image.cc:41
impeller::DecompressedImage::~DecompressedImage
~DecompressedImage()
impeller::DecompressedImage::Format
Format
Definition: decompressed_image.h:19
impeller::DecompressedImage::Format::kGreyAlpha
@ kGreyAlpha
impeller
Definition: aiks_context.cc:10
impeller::DecompressedImage::GetSize
const ISize & GetSize() const
Definition: decompressed_image.cc:33
size.h
impeller::DecompressedImage::Format::kInvalid
@ kInvalid