skia2/include/encode/SkEncoder.h
Matt Sarett b1d3b2e1df SkEncoder base class needs SK_API
Bug: skia:
Change-Id: I244da1f5f091eaa30d3f65946e11a2fc642b63ea
Reviewed-on: https://skia-review.googlesource.com/16661
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-12 13:21:49 +00:00

42 lines
908 B
C++

/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkEncoder_DEFINED
#define SkEncoder_DEFINED
#include "SkPixmap.h"
#include "../private/SkTemplates.h"
class SK_API SkEncoder : SkNoncopyable {
public:
/**
* Encode |numRows| rows of input. If the caller requests more rows than are remaining
* in the src, this will encode all of the remaining rows. |numRows| must be greater
* than zero.
*/
bool encodeRows(int numRows);
virtual ~SkEncoder() {}
protected:
virtual bool onEncodeRows(int numRows) = 0;
SkEncoder(const SkPixmap& src, size_t storageBytes)
: fSrc(src)
, fCurrRow(0)
, fStorage(storageBytes)
{}
const SkPixmap& fSrc;
int fCurrRow;
SkAutoTMalloc<uint8_t> fStorage;
};
#endif