Flutter Engine
The Flutter Engine
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"
12#include "src/core/SkChecksum.h"
13
14#include <cstdint>
15
16class SkCodec;
17class SkImage;
18class SkPDFDocument;
19struct SkEncodedInfo;
21
22/**
23 * Serialize a SkImage as an Image Xobject.
24 * quality > 100 means lossless
25 */
27 SkPDFDocument* doc,
28 int encodingQuality = 101);
29
31public:
32 static const SkEncodedInfo& GetEncodedInfo(SkCodec&);
33};
34
38 bool operator==(const SkPDFIccProfileKey& that) const {
39 return fChannels == that.fChannels && fData->equals(that.fData.get());
40 }
41 bool operator!=(const SkPDFIccProfileKey& rhs) const { return !(*this == rhs); }
42
43 struct Hash {
44 uint32_t operator()(const SkPDFIccProfileKey& k) const {
45 return SkGoodHash()(k.fChannels) ^ SkChecksum::Hash32(k.fData->data(), k.fData->size());
46 }
47 };
48};
49
50#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 &)
Definition: SkPDFBitmap.cpp:48
T * get() const
Definition: SkRefCnt.h:303
uint32_t Hash32(const void *data, size_t bytes, uint32_t seed)
Definition: SkChecksum.cpp:113
uint32_t operator()(const SkPDFIccProfileKey &k) const
Definition: SkPDFBitmap.h:44
sk_sp< SkData > fData
Definition: SkPDFBitmap.h:36
bool operator!=(const SkPDFIccProfileKey &rhs) const
Definition: SkPDFBitmap.h:41
bool operator==(const SkPDFIccProfileKey &that) const
Definition: SkPDFBitmap.h:38