Flutter Engine
The Flutter Engine
|
#include <image_generator_apng.h>
Public Member Functions | |
~APNGImageGenerator () | |
const SkImageInfo & | GetInfo () override |
Returns basic information about the contents of the encoded image. This information can almost always be collected by just interpreting the header of a decoded image. More... | |
unsigned int | GetFrameCount () const override |
Get the number of frames that the encoded image stores. This method is always expected to be called before GetFrameInfo , as the underlying image decoder may interpret frame information that is then used when calling GetFrameInfo . More... | |
unsigned int | GetPlayCount () const override |
The number of times an animated image should play through before playback stops. More... | |
const ImageGenerator::FrameInfo | GetFrameInfo (unsigned int frame_index) override |
Get information about a single frame in the context of a multi-frame image, useful for animation and frame blending. This method should only ever be called after GetFrameCount has been called. This information is nonsensical for single-frame images. More... | |
SkISize | GetScaledDimensions (float desired_scale) override |
Given a scale value, find the closest image size that can be used for efficiently decoding the image. If subpixel image decoding is not supported by the decoder, this method should just return the original image size. More... | |
bool | GetPixels (const SkImageInfo &info, void *pixels, size_t row_bytes, unsigned int frame_index, std::optional< unsigned int > prior_frame) override |
Decode the image into a given buffer. This method is currently always used for sub-pixel image decoding. For full-sized still images, GetImage is always attempted first. More... | |
Public Member Functions inherited from flutter::ImageGenerator | |
virtual | ~ImageGenerator () |
virtual const SkImageInfo & | GetInfo ()=0 |
Returns basic information about the contents of the encoded image. This information can almost always be collected by just interpreting the header of a decoded image. More... | |
virtual unsigned int | GetFrameCount () const =0 |
Get the number of frames that the encoded image stores. This method is always expected to be called before GetFrameInfo , as the underlying image decoder may interpret frame information that is then used when calling GetFrameInfo . More... | |
virtual unsigned int | GetPlayCount () const =0 |
The number of times an animated image should play through before playback stops. More... | |
virtual const FrameInfo | GetFrameInfo (unsigned int frame_index)=0 |
Get information about a single frame in the context of a multi-frame image, useful for animation and frame blending. This method should only ever be called after GetFrameCount has been called. This information is nonsensical for single-frame images. More... | |
virtual SkISize | GetScaledDimensions (float scale)=0 |
Given a scale value, find the closest image size that can be used for efficiently decoding the image. If subpixel image decoding is not supported by the decoder, this method should just return the original image size. More... | |
virtual bool | GetPixels (const SkImageInfo &info, void *pixels, size_t row_bytes, unsigned int frame_index=0, std::optional< unsigned int > prior_frame=std::nullopt)=0 |
Decode the image into a given buffer. This method is currently always used for sub-pixel image decoding. For full-sized still images, GetImage is always attempted first. More... | |
sk_sp< SkImage > | GetImage () |
Creates an SkImage based on the current ImageInfo of this ImageGenerator . More... | |
Static Public Member Functions | |
static std::unique_ptr< ImageGenerator > | MakeFromData (sk_sp< SkData > data) |
Additional Inherited Members | |
Static Public Attributes inherited from flutter::ImageGenerator | |
static const unsigned int | kInfinitePlayCount |
Frame count value to denote infinite looping. More... | |
Definition at line 27 of file image_generator_apng.h.
|
default |
|
overridevirtual |
Get the number of frames that the encoded image stores. This method is always expected to be called before GetFrameInfo
, as the underlying image decoder may interpret frame information that is then used when calling GetFrameInfo
.
Implements flutter::ImageGenerator.
Definition at line 43 of file image_generator_apng.cc.
|
overridevirtual |
Get information about a single frame in the context of a multi-frame image, useful for animation and frame blending. This method should only ever be called after GetFrameCount
has been called. This information is nonsensical for single-frame images.
[in] | frame_index | The index of the frame to get information about. |
GetFrameCount
Implements flutter::ImageGenerator.
Definition at line 51 of file image_generator_apng.cc.
|
overridevirtual |
Returns basic information about the contents of the encoded image. This information can almost always be collected by just interpreting the header of a decoded image.
Implements flutter::ImageGenerator.
Definition at line 39 of file image_generator_apng.cc.
|
overridevirtual |
Decode the image into a given buffer. This method is currently always used for sub-pixel image decoding. For full-sized still images, GetImage
is always attempted first.
[in] | info | The desired size and color info of the decoded image to be returned. The implementation of GetScaledDimensions determines which sizes are supported by the image decoder. |
[in] | pixels | The location where the raw decoded image data should be written. |
[in] | row_bytes | The total number of bytes that should make up a single row of decoded image data (i.e. width * bytes_per_pixel). |
[in] | frame_index | Which frame to decode. This is only useful for multi-frame images. |
[in] | prior_frame | Optional frame index parameter for multi-frame images which specifies the previous frame that should be use for blending. This hints to the decoder that it should use a previously cached frame instead of decoding dependency frame(s). If an empty value is supplied, the decoder should decode any necessary frames first. |
GetScaledDimensions
Implements flutter::ImageGenerator.
Definition at line 69 of file image_generator_apng.cc.
|
overridevirtual |
The number of times an animated image should play through before playback stops.
kInfinitePlayCount
is returned. Implements flutter::ImageGenerator.
Definition at line 47 of file image_generator_apng.cc.
|
overridevirtual |
Given a scale value, find the closest image size that can be used for efficiently decoding the image. If subpixel image decoding is not supported by the decoder, this method should just return the original image size.
[in] | scale | The desired scale factor of the image for decoding. |
GetPixels
in order to query for supported sizes. GetPixels
Implements flutter::ImageGenerator.
Definition at line 65 of file image_generator_apng.cc.
|
static |
Definition at line 213 of file image_generator_apng.cc.