Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Functions
SkPDFBitmap.h File Reference
#include "include/core/SkData.h"
#include "include/core/SkRefCnt.h"
#include "src/core/SkChecksum.h"
#include <cstdint>

Go to the source code of this file.

Classes

class  SkPDFBitmap
 
struct  SkPDFIccProfileKey
 
struct  SkPDFIccProfileKey::Hash
 

Functions

SkPDFIndirectReference SkPDFSerializeImage (const SkImage *img, SkPDFDocument *doc, int encodingQuality=101)
 

Function Documentation

◆ SkPDFSerializeImage()

SkPDFIndirectReference SkPDFSerializeImage ( const SkImage img,
SkPDFDocument doc,
int  encodingQuality = 101 
)

Serialize a SkImage as an Image Xobject. quality > 100 means lossless

Definition at line 398 of file SkPDFBitmap.cpp.

400 {
401 SkASSERT(img);
402 SkASSERT(doc);
404 if (SkExecutor* executor = doc->executor()) {
405 SkRef(img);
406 doc->incrementJobCount();
407 executor->add([img, encodingQuality, doc, ref]() {
408 serialize_image(img, encodingQuality, doc, ref);
409 SkSafeUnref(img);
410 doc->signalJobComplete();
411 });
412 return ref;
413 }
414 serialize_image(img, encodingQuality, doc, ref);
415 return ref;
416}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static void SkSafeUnref(T *obj)
Definition: SkRefCnt.h:149
static T * SkRef(T *obj)
Definition: SkRefCnt.h:132
static sk_sp< SkData > serialize_image(const SkImage *image, SkSerialProcs procs)
SkExecutor * executor() const
void signalJobComplete()
void incrementJobCount()
SkPDFIndirectReference reserveRef()