Flutter Engine
The Flutter Engine
SkBmpBaseCodec.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#ifndef SkBmpBaseCodec_DEFINED
8#define SkBmpBaseCodec_DEFINED
9
13
14#include <cstdint>
15#include <memory>
16
17class SkStream;
18struct SkEncodedInfo;
19
20/*
21 * Common base class for SkBmpStandardCodec and SkBmpMaskCodec.
22 */
23class SkBmpBaseCodec : public SkBmpCodec {
24public:
25 ~SkBmpBaseCodec() override;
26
27 /*
28 * Whether fSrcBuffer was successfully created.
29 *
30 * If false, this Codec must not be used.
31 */
32 bool didCreateSrcBuffer() const { return fSrcBuffer != nullptr; }
33
34protected:
35 SkBmpBaseCodec(SkEncodedInfo&& info, std::unique_ptr<SkStream>,
36 uint16_t bitsPerPixel, SkCodec::SkScanlineOrder rowOrder);
37
38 uint8_t* srcBuffer() { return reinterpret_cast<uint8_t*>(fSrcBuffer.get()); }
39
40private:
42
43 using INHERITED = SkBmpCodec;
44};
45#endif // SkBmpBaseCodec_DEFINED
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
uint8_t * srcBuffer()
bool didCreateSrcBuffer() const
~SkBmpBaseCodec() override
SkBmpBaseCodec(SkEncodedInfo &&info, std::unique_ptr< SkStream >, uint16_t bitsPerPixel, SkCodec::SkScanlineOrder rowOrder)
SkBmpCodec(SkEncodedInfo &&info, std::unique_ptr< SkStream >, uint16_t bitsPerPixel, SkCodec::SkScanlineOrder rowOrder)
Definition: SkBmpCodec.cpp:621
uint16_t bitsPerPixel() const
Definition: SkBmpCodec.h:87
SkScanlineOrder
Definition: SkCodec.h:575
std::unique_ptr< void, SkOverloadedFunctionObject< void(void *), sk_free > > UniqueVoidPtr
Definition: SkTemplates.h:431