Flutter Engine
The Flutter Engine
Functions
SkPDFBitmap.cpp File Reference
#include "src/pdf/SkPDFBitmap.h"
#include "include/codec/SkCodec.h"
#include "include/codec/SkEncodedOrigin.h"
#include "include/codec/SkJpegDecoder.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkColorType.h"
#include "include/core/SkData.h"
#include "include/core/SkExecutor.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPixmap.h"
#include "include/core/SkSize.h"
#include "include/core/SkStream.h"
#include "include/docs/SkPDFDocument.h"
#include "include/encode/SkICC.h"
#include "include/encode/SkJpegEncoder.h"
#include "include/private/SkEncodedInfo.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkMutex.h"
#include "include/private/base/SkTo.h"
#include "modules/skcms/skcms.h"
#include "src/core/SkTHash.h"
#include "src/pdf/SkDeflate.h"
#include "src/pdf/SkPDFDocumentPriv.h"
#include "src/pdf/SkPDFTypes.h"
#include "src/pdf/SkPDFUnion.h"
#include <algorithm>
#include <array>
#include <cstring>
#include <functional>
#include <memory>
#include <optional>
#include <utility>

Go to the source code of this file.

Functions

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

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()