1 /* 2 * Copyright 2023 Google LLC 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 SkPngEncoderImpl_DEFINED 9 #define SkPngEncoderImpl_DEFINED 10 11 #include <cstdint> 12 13 #include "src/encode/SkPngEncoderBase.h" 14 15 #include <memory> 16 17 class SkPixmap; 18 class SkPngEncoderMgr; 19 template <typename T> class SkSpan; 20 21 class SkPngEncoderImpl final : public SkPngEncoderBase { 22 public: 23 // public so it can be called from SkPngEncoder namespace. It should only be made 24 // via SkPngEncoder::Make 25 SkPngEncoderImpl(TargetInfo targetInfo, std::unique_ptr<SkPngEncoderMgr>, const SkPixmap& src); 26 ~SkPngEncoderImpl() override; 27 28 protected: 29 bool onEncodeRow(SkSpan<const uint8_t> row) override; 30 bool onFinishEncoding() override; 31 32 std::unique_ptr<SkPngEncoderMgr> fEncoderMgr; 33 }; 34 #endif 35