8#ifndef SkCodecPriv_DEFINED
9#define SkCodecPriv_DEFINED
20#ifdef SK_PRINT_CODEC_MESSAGES
21 #define SkCodecPrintf SkDebugf
23 #define SkCodecPrintf(...)
32 return 1.0f / ((
float) sampleSize);
45 if (sampleSize > srcDimension) {
48 return srcDimension / sampleSize;
67static inline int get_dst_coord(
int srcCoord,
int sampleFactor) {
return srcCoord / sampleFactor; }
82 if (srcCoord < startCoord ||
get_dst_coord(srcCoord, sampleFactor) >= scaledDim) {
87 return ((srcCoord - startCoord) % sampleFactor) == 0;
97 SkCodecPrintf(
"Warning: an opaque image should be decoded as opaque "
98 "- it is being decoded as non-opaque, which will draw slower\n");
110 return nullptr != colorTable ? colorTable->
readColors() :
nullptr;
117 return (
width + pixelsPerByte - 1) / pixelsPerByte;
124 return width * bytesPerPixel;
131 if (bitsPerPixel < 16) {
133 const uint32_t pixelsPerByte = 8 / bitsPerPixel;
137 const uint32_t bytesPerPixel = bitsPerPixel / 8;
186 if ((
'I' !=
data[0] ||
'I' !=
data[1]) && (
'M' !=
data[0] ||
'M' !=
data[1])) {
190 *isLittleEndian = (
'I' ==
data[0]);
231#ifdef SK_PMCOLOR_IS_RGBA
@ kUnknown_SkAlphaType
uninitialized
@ kOpaque_SkAlphaType
pixel is opaque
static bool is_coord_necessary(int srcCoord, int sampleFactor, int scaledDim)
static uint8_t get_byte(const uint8_t *buffer, uint32_t i)
uint32_t(* PackColorProc)(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
static uint32_t get_endian_int(const uint8_t *data, bool littleEndian)
static PackColorProc choose_pack_color_proc(bool isPremul, SkColorType colorType)
static size_t compute_row_bytes(int width, uint32_t bitsPerPixel)
static bool is_valid_subset(const SkIRect &subset, const SkISize &imageDims)
static const SkPMColor * get_color_ptr(SkColorPalette *colorTable)
static bool valid_alpha(SkAlphaType dstAlpha, bool srcIsOpaque)
static size_t compute_row_bytes_bpp(int width, uint32_t bytesPerPixel)
static int get_dst_coord(int srcCoord, int sampleFactor)
static size_t compute_row_bytes_ppb(int width, uint32_t pixelsPerByte)
static float get_scale_from_sample_size(int sampleSize)
static int get_scaled_dimension(int srcDimension, int sampleSize)
static SkPMColor premultiply_argb_as_rgba(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
bool sk_select_xform_format(SkColorType colorType, bool forColorTable, skcms_PixelFormat *outFormat)
static uint32_t get_int(const uint8_t *buffer, uint32_t i)
static uint16_t get_endian_short(const uint8_t *data, bool littleEndian)
#define SkCodecPrintf(...)
static uint16_t get_short(const uint8_t *buffer, uint32_t i)
static bool is_valid_endian_marker(const uint8_t *data, bool *isLittleEndian)
static SkPMColor premultiply_argb_as_bgra(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
static bool is_rgba(SkColorType colorType)
static int get_start_coord(int sampleFactor)
static uint32_t SkPackARGB_as_RGBA(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
static uint32_t SkPackARGB_as_BGRA(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
static uint16_t SkEndianSwap16(uint16_t value)
static constexpr uint32_t SkEndianSwap32(uint32_t value)
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static U8CPU SkMulDiv255Round(U16CPU a, U16CPU b)
const SkPMColor * readColors() const
bool HasDecoder(std::string_view id)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
static constexpr SkIRect MakeSize(const SkISize &size)
bool contains(int32_t x, int32_t y) const
std::shared_ptr< const fml::Mapping > data