blob: ba1422647b37c33da4465fe83a5507a227f25c27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkImageDeserializer_DEFINED
#define SkImageDeserializer_DEFINED
#include "SkRefCnt.h"
struct SkIRect;
class SkData;
class SkImage;
class SK_API SkImageDeserializer {
public:
virtual ~SkImageDeserializer() {}
/**
* Given a data containing serialized content, return an SkImage from it.
*
* @param data The data containing the encoded image. The subclass may ref this for later
* decoding, or read it and process it immediately.
* @param subset Optional rectangle represent the subset of the encoded data that is being
* requested to be turned into an image.
* @return The new image, or nullptr on failure.
*
* The default implementation is to call SkImage::MakeFromEncoded(...)
*/
virtual sk_sp<SkImage> makeFromData(SkData*, const SkIRect* subset);
virtual sk_sp<SkImage> makeFromMemory(const void* data, size_t length, const SkIRect* subset);
};
#endif
|