23 AndroidBitmapInfo
info {
32 info.flags = ANDROID_BITMAP_FLAGS_ALPHA_PREMUL;
35 info.flags = ANDROID_BITMAP_FLAGS_ALPHA_OPAQUE;
38 info.flags = ANDROID_BITMAP_FLAGS_ALPHA_UNPREMUL;
42 info.flags = ANDROID_BITMAP_FLAGS_ALPHA_OPAQUE;
50 AndroidBitmapCompressFormat androidFormat,
54 auto write_to_stream = [](
void* userContext,
const void*
data,
size_t size) {
58 return ANDROID_BITMAP_RESULT_SUCCESS == AndroidBitmap_compress(&
info,
60 reinterpret_cast<void*
>(
stream), write_to_stream);
65 SkDEBUGFAIL(
"Making an encoder is not supported via the NDK");
78 if (!
as_IB(img)->getROPixels(ctx, &bm)) {
83 return stream.detachAsData();
96 SkDEBUGFAIL(
"encoding a YUVA pixmap is not supported via the NDK");
105 if (!
as_IB(img)->getROPixels(ctx, &bm)) {
110 return stream.detachAsData();
116 SkDEBUGFAIL(
"Making an encoder is not supported via the NDK");
124 SkDEBUGFAIL(
"Making an encoder is not supported via the NDK");
135 dst,
src, ANDROID_BITMAP_COMPRESS_FORMAT_WEBP_LOSSLESS,
options.fQuality);
138 dst,
src, ANDROID_BITMAP_COMPRESS_FORMAT_WEBP_LOSSY,
options.fQuality);
146 if (!
as_IB(img)->getROPixels(ctx, &bm)) {
151 return stream.detachAsData();
157 SkDEBUGFAIL(
"Encoding Animated WebP images is not supported with the NDK.");
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
#define SkDEBUGFAIL(message)
static bool write_image_to_stream(SkWStream *stream, const SkPixmap &pmap, AndroidBitmapCompressFormat androidFormat, int quality)
static AndroidBitmapInfo info_for_pixmap(const SkPixmap &pmap)
static SkImage_Base * as_IB(SkImage *image)
constexpr uint32_t SkToU32(S x)
const SkPixmap & pixmap() const
SkColorType colorType() const
SkColorSpace * colorSpace() const
const void * addr() const
SkAlphaType alphaType() const
SK_API std::unique_ptr< SkEncoder > Make(SkWStream *dst, const SkPixmap &src, const Options &options)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
AndroidBitmapFormat toAndroidBitmapFormat(SkColorType colorType)
ADataSpace toDataSpace(SkColorSpace *cs)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
SK_API std::unique_ptr< SkEncoder > Make(SkWStream *dst, const SkPixmap &src, const Options &options)
SK_API bool EncodeAnimated(SkWStream *dst, SkSpan< const SkEncoder::Frame > src, const Options &options)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
void write(SkWStream *wStream, const T &text)
std::shared_ptr< const fml::Mapping > data