Flutter Engine
The Flutter Engine
SkStubHeifDecoderAPI.h
Go to the documentation of this file.
1/*
2 * Copyright 2017 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 SkStubHeifDecoderAPI_DEFINED
9#define SkStubHeifDecoderAPI_DEFINED
10
11// This stub implementation of HeifDecoderAPI.h lets us compile SkHeifCodec.cpp
12// even when libheif is not available. It, of course, does nothing and fails to decode.
13
14#include <memory>
15#include <stddef.h>
16#include <stdint.h>
17
23};
24
25struct HeifStream {
26 virtual ~HeifStream() {}
27
28 virtual size_t read(void*, size_t) = 0;
29 virtual bool rewind() = 0;
30 virtual bool seek(size_t) = 0;
31 virtual bool hasLength() const = 0;
32 virtual size_t getLength() const = 0;
33};
34
36 uint32_t mWidth;
37 uint32_t mHeight;
38 int32_t mRotationAngle; // Rotation angle, clockwise, should be multiple of 90
39 uint32_t mBytesPerPixel; // Number of bytes for one pixel
40 int64_t mDurationUs; // Duration of the frame in us
41 std::vector<uint8_t> mIccData; // ICC data array
42};
43
46 delete stream;
47 return false;
48 }
49
50 bool getSequenceInfo(HeifFrameInfo* frameInfo, size_t *frameCount) {
51 return false;
52 }
53
55 return false;
56 }
57
58 bool decodeSequence(int frameIndex, HeifFrameInfo* frameInfo) {
59 return false;
60 }
61
63 return false;
64 }
65
66 bool getScanline(uint8_t*) {
67 return false;
68 }
69
70 int skipScanlines(int) {
71 return 0;
72 }
73
74 uint32_t getColorDepth() {
75 return 0;
76 }
77};
78
79static inline HeifDecoder* createHeifDecoder() { return new HeifDecoder; }
80
81#endif//SkStubHeifDecoderAPI_DEFINED
static HeifDecoder * createHeifDecoder()
HeifColorFormat
@ kHeifColorFormat_RGBA_1010102
@ kHeifColorFormat_RGB565
@ kHeifColorFormat_BGRA_8888
@ kHeifColorFormat_RGBA_8888
int skipScanlines(int)
bool setOutputColor(HeifColorFormat)
bool getScanline(uint8_t *)
bool init(HeifStream *stream, HeifFrameInfo *)
uint32_t getColorDepth()
bool getSequenceInfo(HeifFrameInfo *frameInfo, size_t *frameCount)
bool decode(HeifFrameInfo *)
bool decodeSequence(int frameIndex, HeifFrameInfo *frameInfo)
std::vector< uint8_t > mIccData
virtual bool seek(size_t)=0
virtual bool rewind()=0
virtual size_t getLength() const =0
virtual bool hasLength() const =0
virtual size_t read(void *, size_t)=0
virtual ~HeifStream()