Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
include
encode
SkEncoder.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 SkEncoder_DEFINED
9
#define SkEncoder_DEFINED
10
11
#include "
include/core/SkPixmap.h
"
12
#include "
include/private/base/SkAPI.h
"
13
#include "
include/private/base/SkNoncopyable.h
"
14
#include "
include/private/base/SkTemplates.h
"
15
16
#include <cstddef>
17
#include <cstdint>
18
19
class
SK_API
SkEncoder
:
SkNoncopyable
{
20
public
:
21
/**
22
* A single frame to be encoded into an animated image.
23
*
24
* If a frame does not fit in the canvas size, this is an error.
25
* TODO(skia:13705): Add offsets when we have support for an encoder that supports using
26
* offsets.
27
*/
28
struct
SK_API
Frame
{
29
/**
30
* Pixmap of the frame.
31
*/
32
SkPixmap
pixmap
;
33
/**
34
* Duration of the frame in millseconds.
35
*/
36
int
duration
;
37
};
38
39
/**
40
* Encode |numRows| rows of input. If the caller requests more rows than are remaining
41
* in the src, this will encode all of the remaining rows. |numRows| must be greater
42
* than zero.
43
*/
44
bool
encodeRows(
int
numRows);
45
46
virtual
~SkEncoder
() {}
47
48
protected
:
49
50
virtual
bool
onEncodeRows
(
int
numRows) = 0;
51
52
SkEncoder
(
const
SkPixmap
& src,
size_t
storageBytes)
53
: fSrc(src)
54
, fCurrRow(0)
55
, fStorage(storageBytes)
56
{}
57
58
const
SkPixmap
&
fSrc
;
59
int
fCurrRow
;
60
skia_private::AutoTMalloc<uint8_t>
fStorage
;
61
};
62
63
#endif
SkAPI.h
SK_API
#define SK_API
Definition
SkAPI.h:35
SkNoncopyable.h
SkPixmap.h
SkTemplates.h
SkEncoder
Definition
SkEncoder.h:19
SkEncoder::~SkEncoder
virtual ~SkEncoder()
Definition
SkEncoder.h:46
SkEncoder::fStorage
skia_private::AutoTMalloc< uint8_t > fStorage
Definition
SkEncoder.h:60
SkEncoder::SkEncoder
SkEncoder(const SkPixmap &src, size_t storageBytes)
Definition
SkEncoder.h:52
SkEncoder::onEncodeRows
virtual bool onEncodeRows(int numRows)=0
SkEncoder::fCurrRow
int fCurrRow
Definition
SkEncoder.h:59
SkEncoder::fSrc
const SkPixmap & fSrc
Definition
SkEncoder.h:58
SkNoncopyable
Definition
SkNoncopyable.h:18
SkPixmap
Definition
SkPixmap.h:40
skia_private::AutoTMalloc
Definition
SkTemplates.h:278
SkEncoder::Frame
Definition
SkEncoder.h:28
SkEncoder::Frame::pixmap
SkPixmap pixmap
Definition
SkEncoder.h:32
SkEncoder::Frame::duration
int duration
Definition
SkEncoder.h:36
Generated on Fri Apr 26 2024 06:16:11 for Flutter Engine by
1.9.8