Flutter Engine
The Flutter Engine
Typedefs | Functions
SkImageEncoderFns.h File Reference
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkTypes.h"
#include "include/encode/SkICC.h"
#include "modules/skcms/skcms.h"
#include <cstring>

Go to the source code of this file.

Typedefs

typedef void(* transform_scanline_proc) (char *dst, const char *src, int width, int bpp)
 

Functions

static void transform_scanline_memcpy (char *dst, const char *src, int width, int bpp)
 
static void transform_scanline_A8_to_GrayAlpha (char *dst, const char *src, int width, int)
 
static void skcms (char *dst, const char *src, int n, skcms_PixelFormat srcFmt, skcms_AlphaFormat srcAlpha, skcms_PixelFormat dstFmt, skcms_AlphaFormat dstAlpha)
 
static void transform_scanline_gray (char *dst, const char *src, int width, int)
 
static void transform_scanline_565 (char *dst, const char *src, int width, int)
 
static void transform_scanline_RGBX (char *dst, const char *src, int width, int)
 
static void transform_scanline_BGRX (char *dst, const char *src, int width, int)
 
static void transform_scanline_444 (char *dst, const char *src, int width, int)
 
static void transform_scanline_rgbA (char *dst, const char *src, int width, int)
 
static void transform_scanline_bgrA (char *dst, const char *src, int width, int)
 
static void transform_scanline_to_premul_legacy (char *dst, const char *src, int width, int)
 
static void transform_scanline_BGRA (char *dst, const char *src, int width, int)
 
static void transform_scanline_4444 (char *dst, const char *src, int width, int)
 
static void transform_scanline_101010x (char *dst, const char *src, int width, int)
 
static void transform_scanline_1010102 (char *dst, const char *src, int width, int)
 
static void transform_scanline_1010102_premul (char *dst, const char *src, int width, int)
 
static void transform_scanline_bgr_101010x (char *dst, const char *src, int width, int)
 
static void transform_scanline_bgra_1010102 (char *dst, const char *src, int width, int)
 
static void transform_scanline_bgr_101010x_xr (char *dst, const char *src, int width, int)
 
static void transform_scanline_bgra_10101010_xr (char *dst, const char *src, int width, int)
 
static void transform_scanline_bgra_1010102_premul (char *dst, const char *src, int width, int)
 
static void transform_scanline_F16 (char *dst, const char *src, int width, int)
 
static void transform_scanline_F16_premul (char *dst, const char *src, int width, int)
 
static void transform_scanline_F16_to_8888 (char *dst, const char *src, int width, int)
 
static void transform_scanline_F16_premul_to_8888 (char *dst, const char *src, int width, int)
 
static void transform_scanline_F16_to_premul_8888 (char *dst, const char *src, int width, int)
 
static void transform_scanline_F32 (char *dst, const char *src, int width, int)
 
static void transform_scanline_F32_premul (char *dst, const char *src, int width, int)
 
static sk_sp< SkDataicc_from_color_space (const SkColorSpace *cs, const skcms_ICCProfile *profile, const char *profile_description)
 
static sk_sp< SkDataicc_from_color_space (const SkImageInfo &info, const skcms_ICCProfile *profile, const char *profile_description)
 

Typedef Documentation

◆ transform_scanline_proc

typedef void(* transform_scanline_proc) (char *dst, const char *src, int width, int bpp)

Definition at line 21 of file SkImageEncoderFns.h.

Function Documentation

◆ icc_from_color_space() [1/2]

static sk_sp< SkData > icc_from_color_space ( const SkColorSpace cs,
const skcms_ICCProfile profile,
const char *  profile_description 
)
inlinestatic

Definition at line 198 of file SkImageEncoderFns.h.

200 {
201 // TODO(ccameron): Remove this check.
202 if (!cs) {
203 return nullptr;
204 }
205
206 if (profile) {
207 return SkWriteICCProfile(profile, profile_description);
208 }
209
210 skcms_Matrix3x3 toXYZD50;
211 if (cs->toXYZD50(&toXYZD50)) {
213 cs->transferFn(&fn);
214 return SkWriteICCProfile(fn, toXYZD50);
215 }
216 return nullptr;
217}
SK_API sk_sp< SkData > SkWriteICCProfile(const skcms_TransferFunction &, const skcms_Matrix3x3 &toXYZD50)
Definition: SkICC.cpp:682
bool toXYZD50(skcms_Matrix3x3 *toXYZD50) const
void transferFn(float gabcdef[7]) const

◆ icc_from_color_space() [2/2]

static sk_sp< SkData > icc_from_color_space ( const SkImageInfo info,
const skcms_ICCProfile profile,
const char *  profile_description 
)
inlinestatic

Definition at line 219 of file SkImageEncoderFns.h.

221 {
222 return icc_from_color_space(info.colorSpace(), profile, profile_description);
223}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
static sk_sp< SkData > icc_from_color_space(const SkColorSpace *cs, const skcms_ICCProfile *profile, const char *profile_description)

◆ skcms()

static void skcms ( char *  dst,
const char *  src,
int  n,
skcms_PixelFormat  srcFmt,
skcms_AlphaFormat  srcAlpha,
skcms_PixelFormat  dstFmt,
skcms_AlphaFormat  dstAlpha 
)
static

Definition at line 35 of file SkImageEncoderFns.h.

37 {
38 SkAssertResult(skcms_Transform(src, srcFmt, srcAlpha, nullptr,
39 dst, dstFmt, dstAlpha, nullptr, n));
40}
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
dst
Definition: cp.py:12
bool skcms_Transform(const void *src, skcms_PixelFormat srcFmt, skcms_AlphaFormat srcAlpha, const skcms_ICCProfile *srcProfile, void *dst, skcms_PixelFormat dstFmt, skcms_AlphaFormat dstAlpha, const skcms_ICCProfile *dstProfile, size_t nz)
Definition: skcms.cc:2495

◆ transform_scanline_1010102()

static void transform_scanline_1010102 ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

Definition at line 108 of file SkImageEncoderFns.h.

108 {
109 skcms(dst, src, width,
112}
static void skcms(char *dst, const char *src, int n, skcms_PixelFormat srcFmt, skcms_AlphaFormat srcAlpha, skcms_PixelFormat dstFmt, skcms_AlphaFormat dstAlpha)
int32_t width
@ skcms_PixelFormat_RGBA_16161616BE
Definition: skcms_public.h:302
@ skcms_PixelFormat_RGBA_1010102
Definition: skcms_public.h:292
@ skcms_AlphaFormat_Unpremul
Definition: skcms_public.h:339

◆ transform_scanline_1010102_premul()

static void transform_scanline_1010102_premul ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_101010x()

static void transform_scanline_101010x ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_444()

static void transform_scanline_444 ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_4444()

static void transform_scanline_4444 ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_565()

static void transform_scanline_565 ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_A8_to_GrayAlpha()

static void transform_scanline_A8_to_GrayAlpha ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

Definition at line 27 of file SkImageEncoderFns.h.

27 {
28 for (int i = 0; i < width; i++) {
29 *dst++ = 0;
30 *dst++ = *src++;
31 }
32}

◆ transform_scanline_bgr_101010x()

static void transform_scanline_bgr_101010x ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_bgr_101010x_xr()

static void transform_scanline_bgr_101010x_xr ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_bgrA()

static void transform_scanline_bgrA ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_BGRA()

static void transform_scanline_BGRA ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_bgra_10101010_xr()

static void transform_scanline_bgra_10101010_xr ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_bgra_1010102()

static void transform_scanline_bgra_1010102 ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_bgra_1010102_premul()

static void transform_scanline_bgra_1010102_premul ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_BGRX()

static void transform_scanline_BGRX ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_F16()

static void transform_scanline_F16 ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_F16_premul()

static void transform_scanline_F16_premul ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_F16_premul_to_8888()

static void transform_scanline_F16_premul_to_8888 ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_F16_to_8888()

static void transform_scanline_F16_to_8888 ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_F16_to_premul_8888()

static void transform_scanline_F16_to_premul_8888 ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_F32()

static void transform_scanline_F32 ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_F32_premul()

static void transform_scanline_F32_premul ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_gray()

static void transform_scanline_gray ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_memcpy()

static void transform_scanline_memcpy ( char *  dst,
const char *  src,
int  width,
int  bpp 
)
inlinestatic

Definition at line 23 of file SkImageEncoderFns.h.

23 {
24 memcpy(dst, src, width * bpp);
25}

◆ transform_scanline_rgbA()

static void transform_scanline_rgbA ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_RGBX()

static void transform_scanline_RGBX ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic

◆ transform_scanline_to_premul_legacy()

static void transform_scanline_to_premul_legacy ( char *  dst,
const char *  src,
int  width,
int   
)
inlinestatic