Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
BitmapRegionDecoder.h
Go to the documentation of this file.
1/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef BitmapRegionDecoder_DEFINED
9#define BitmapRegionDecoder_DEFINED
10
14#include "include/core/SkData.h"
15
16namespace android {
17namespace skia {
18
20public:
21 static std::unique_ptr<BitmapRegionDecoder> Make(sk_sp<SkData> data);
22
24 BRDAllocator* allocator,
25 const SkIRect& desiredSubset,
26 int sampleSize,
28 bool requireUnpremul,
29 sk_sp<SkColorSpace> prefColorSpace);
30
31 SkEncodedImageFormat getEncodedFormat() { return fCodec->getEncodedFormat(); }
32
34 return fCodec->computeOutputColorType(requestedColorType);
35 }
36
38 sk_sp<SkColorSpace> prefColorSpace = nullptr) {
39 return fCodec->computeOutputColorSpace(outputColorType, std::move(prefColorSpace));
40 }
41
42 int width() const;
43 int height() const;
44
46 std::unique_ptr<SkStream>* outGainmapImageStream) {
47 return fCodec->getAndroidGainmap(outInfo, outGainmapImageStream);
48 }
49
50private:
51 BitmapRegionDecoder(std::unique_ptr<SkAndroidCodec> codec);
52
53 std::unique_ptr<SkAndroidCodec> fCodec;
54};
55
56} // namespace skia
57} // namespace android
58#endif // BitmapRegionDecoder_DEFINED
SkColorType
Definition SkColorType.h:19
SkEncodedImageFormat
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
bool decodeRegion(SkBitmap *bitmap, BRDAllocator *allocator, const SkIRect &desiredSubset, int sampleSize, SkColorType colorType, bool requireUnpremul, sk_sp< SkColorSpace > prefColorSpace)
static std::unique_ptr< BitmapRegionDecoder > Make(sk_sp< SkData > data)
bool getAndroidGainmap(SkGainmapInfo *outInfo, std::unique_ptr< SkStream > *outGainmapImageStream)
sk_sp< SkColorSpace > computeOutputColorSpace(SkColorType outputColorType, sk_sp< SkColorSpace > prefColorSpace=nullptr)
SkColorType computeOutputColorType(SkColorType requestedColorType)