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