Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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#include <optional>
10
11#include "flutter/fml/macros.h"
12#include "flutter/fml/mapping.h"
14
15namespace impeller {
16
18 public:
19 enum class Format {
21 kGrey,
23 kRGB,
24 kRGBA,
25 };
26
28
31 std::shared_ptr<const fml::Mapping> allocation);
32
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
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_PLAYGROUND_IMAGE_DECOMPRESSED_IMAGE_H_
DecompressedImage ConvertToRGBA() const
const std::shared_ptr< const fml::Mapping > & GetAllocation() const
const ISize & GetSize() const
uint32_t uint32_t * format