• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2024 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 #include "experimental/rust_png/encoder/SkPngRustEncoder.h"
9 
10 #include <memory>
11 
12 #include "experimental/rust_png/encoder/impl/SkPngRustEncoderImpl.h"
13 #include "include/encode/SkEncoder.h"
14 
15 namespace SkPngRustEncoder {
16 
Encode(SkWStream * dst,const SkPixmap & src,const Options & options)17 bool Encode(SkWStream* dst, const SkPixmap& src, const Options& options) {
18     std::unique_ptr<SkEncoder> encoder = Make(dst, src, options);
19     return encoder && encoder->encodeRows(src.height());
20 }
21 
Make(SkWStream * dst,const SkPixmap & src,const Options & options)22 SK_API std::unique_ptr<SkEncoder> Make(SkWStream* dst,
23                                        const SkPixmap& src,
24                                        const Options& options) {
25     return SkPngRustEncoderImpl::Make(dst, src, options);
26 }
27 
28 }  // namespace SkPngRustEncoder
29