Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkPDFBitmap.h
Go to the documentation of this file.
1/*
2 * Copyright 2015 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#ifndef SkPDFBitmap_DEFINED
8#define SkPDFBitmap_DEFINED
9
10#include "include/core/SkData.h"
11#include "src/core/SkChecksum.h"
12
13class SkCodec;
14class SkImage;
15class SkPDFDocument;
16struct SkEncodedInfo;
18
19/**
20 * Serialize a SkImage as an Image Xobject.
21 * quality > 100 means lossless
22 */
24 SkPDFDocument* doc,
25 int encodingQuality = 101);
26
28public:
29 static const SkEncodedInfo& GetEncodedInfo(SkCodec&);
30};
31
35 bool operator==(const SkPDFIccProfileKey& that) const {
36 return fChannels == that.fChannels && fData->equals(that.fData.get());
37 }
38 bool operator!=(const SkPDFIccProfileKey& rhs) const { return !(*this == rhs); }
39
40 struct Hash {
41 uint32_t operator()(const SkPDFIccProfileKey& k) const {
42 return SkGoodHash()(k.fChannels) ^ SkChecksum::Hash32(k.fData->data(), k.fData->size());
43 }
44 };
45};
46
47#endif // SkPDFBitmap_DEFINED
SkPDFIndirectReference SkPDFSerializeImage(const SkImage *img, SkPDFDocument *doc, int encodingQuality=101)
bool equals(const SkData *other) const
Definition SkData.cpp:43
const void * data() const
Definition SkData.h:37
size_t size() const
Definition SkData.h:30
static const SkEncodedInfo & GetEncodedInfo(SkCodec &)
T * get() const
Definition SkRefCnt.h:303
uint32_t Hash32(const void *data, size_t bytes, uint32_t seed)
uint32_t operator()(const SkPDFIccProfileKey &k) const
Definition SkPDFBitmap.h:41
sk_sp< SkData > fData
Definition SkPDFBitmap.h:33
bool operator!=(const SkPDFIccProfileKey &rhs) const
Definition SkPDFBitmap.h:38
bool operator==(const SkPDFIccProfileKey &that) const
Definition SkPDFBitmap.h:35