Flutter Engine
The Flutter Engine
|
Classes | |
struct | Options |
Enumerations | |
enum class | AlphaOption { kIgnore , kBlendOnBlack } |
enum class | Downsample { k420 , k422 , k444 } |
Functions | |
SK_API bool | Encode (SkWStream *dst, const SkPixmap &src, const Options &options) |
SK_API bool | Encode (SkWStream *dst, const SkYUVAPixmaps &src, const SkColorSpace *srcColorSpace, const Options &options) |
SK_API sk_sp< SkData > | Encode (GrDirectContext *ctx, const SkImage *img, const Options &options) |
SK_API std::unique_ptr< SkEncoder > | Make (SkWStream *dst, const SkPixmap &src, const Options &options) |
SK_API std::unique_ptr< SkEncoder > | Make (SkWStream *dst, const SkYUVAPixmaps &src, const SkColorSpace *srcColorSpace, const Options &options) |
|
strong |
Enumerator | |
---|---|
kIgnore | |
kBlendOnBlack |
Definition at line 28 of file SkJpegEncoder.h.
|
strong |
Enumerator | |
---|---|
k420 | Reduction by a factor of two in both the horizontal and vertical directions. |
k422 | Reduction by a factor of two in the horizontal direction. |
k444 | No downsampling. |
Definition at line 33 of file SkJpegEncoder.h.
sk_sp< SkData > SkJpegEncoder::Encode | ( | GrDirectContext * | ctx, |
const SkImage * | img, | ||
const Options & | options | ||
) |
Encode the provided image and return the resulting bytes. If the image was created as a texture-backed image on a GPU context, that |ctx| must be provided so the pixels can be read before being encoded. For raster-backed images, |ctx| can be nullptr. |options| may be used to control the encoding behavior.
Returns nullptr if the pixels could not be read or encoding otherwise fails.
Definition at line 25 of file SkJpegEncoder_none.cpp.
Encode the |src| pixels to the |dst| stream. |options| may be used to control the encoding behavior.
Returns true on success. Returns false on an invalid or unsupported |src|.
Definition at line 20 of file SkJpegEncoder_none.cpp.
bool SkJpegEncoder::Encode | ( | SkWStream * | dst, |
const SkYUVAPixmaps & | src, | ||
const SkColorSpace * | srcColorSpace, | ||
const Options & | options | ||
) |
Definition at line 393 of file SkJpegEncoderImpl.cpp.
std::unique_ptr< SkEncoder > SkJpegEncoder::Make | ( | SkWStream * | dst, |
const SkPixmap & | src, | ||
const Options & | options | ||
) |
Create a jpeg encoder that will encode the |src| pixels to the |dst| stream. |options| may be used to control the encoding behavior.
|dst| is unowned but must remain valid for the lifetime of the object.
This returns nullptr on an invalid or unsupported |src|.
Definition at line 416 of file SkJpegEncoderImpl.cpp.
std::unique_ptr< SkEncoder > SkJpegEncoder::Make | ( | SkWStream * | dst, |
const SkYUVAPixmaps & | src, | ||
const SkColorSpace * | srcColorSpace, | ||
const Options & | options | ||
) |
Definition at line 423 of file SkJpegEncoderImpl.cpp.