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