Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
SkAndroidCodecAdapter Class Reference

#include <SkAndroidCodecAdapter.h>

Inheritance diagram for SkAndroidCodecAdapter:
SkAndroidCodec SkNoncopyable

Public Member Functions

 SkAndroidCodecAdapter (SkCodec *)
 
 ~SkAndroidCodecAdapter () override
 
- Public Member Functions inherited from SkAndroidCodec
virtual ~SkAndroidCodec ()
 
const SkImageInfogetInfo () const
 
const skcms_ICCProfilegetICCProfile () const
 
SkEncodedImageFormat getEncodedFormat () const
 
SkColorType computeOutputColorType (SkColorType requestedColorType)
 
SkAlphaType computeOutputAlphaType (bool requestedUnpremul)
 
sk_sp< SkColorSpacecomputeOutputColorSpace (SkColorType outputColorType, sk_sp< SkColorSpace > prefColorSpace=nullptr)
 
int computeSampleSize (SkISize *size) const
 
SkISize getSampledDimensions (int sampleSize) const
 
bool getSupportedSubset (SkIRect *desiredSubset) const
 
SkISize getSampledSubsetDimensions (int sampleSize, const SkIRect &subset) const
 
SkCodec::Result getAndroidPixels (const SkImageInfo &info, void *pixels, size_t rowBytes, const AndroidOptions *options)
 
SkCodec::Result getAndroidPixels (const SkImageInfo &info, void *pixels, size_t rowBytes)
 
SkCodec::Result getPixels (const SkImageInfo &info, void *pixels, size_t rowBytes)
 
SkCodeccodec () const
 
bool getAndroidGainmap (SkGainmapInfo *outInfo, std::unique_ptr< SkStream > *outGainmapImageStream)
 

Protected Member Functions

SkISize onGetSampledDimensions (int sampleSize) const override
 
bool onGetSupportedSubset (SkIRect *desiredSubset) const override
 
SkCodec::Result onGetAndroidPixels (const SkImageInfo &info, void *pixels, size_t rowBytes, const AndroidOptions &options) override
 
- Protected Member Functions inherited from SkAndroidCodec
 SkAndroidCodec (SkCodec *)
 
virtual SkISize onGetSampledDimensions (int sampleSize) const =0
 
virtual bool onGetSupportedSubset (SkIRect *desiredSubset) const =0
 
virtual SkCodec::Result onGetAndroidPixels (const SkImageInfo &info, void *pixels, size_t rowBytes, const AndroidOptions &options)=0
 

Additional Inherited Members

- Public Types inherited from SkAndroidCodec
enum class  ExifOrientationBehavior { kIgnore , kRespect }
 
- Static Public Member Functions inherited from SkAndroidCodec
static std::unique_ptr< SkAndroidCodecMakeFromCodec (std::unique_ptr< SkCodec >)
 
static std::unique_ptr< SkAndroidCodecMakeFromStream (std::unique_ptr< SkStream >, SkPngChunkReader *=nullptr)
 
static std::unique_ptr< SkAndroidCodecMakeFromData (sk_sp< SkData >, SkPngChunkReader *=nullptr)
 

Detailed Description

This class wraps SkCodec to implement the functionality of SkAndroidCodec. The underlying SkCodec implements sampled decodes. SkCodec's that do not implement that are wrapped with SkSampledCodec instead.

Definition at line 24 of file SkAndroidCodecAdapter.h.

Constructor & Destructor Documentation

◆ SkAndroidCodecAdapter()

SkAndroidCodecAdapter::SkAndroidCodecAdapter ( SkCodec codec)
explicit

Definition at line 14 of file SkAndroidCodecAdapter.cpp.

15 : INHERITED(codec)
16{}
SkCodec * codec() const

◆ ~SkAndroidCodecAdapter()

SkAndroidCodecAdapter::~SkAndroidCodecAdapter ( )
inlineoverride

Definition at line 29 of file SkAndroidCodecAdapter.h.

29{}

Member Function Documentation

◆ onGetAndroidPixels()

SkCodec::Result SkAndroidCodecAdapter::onGetAndroidPixels ( const SkImageInfo info,
void *  pixels,
size_t  rowBytes,
const AndroidOptions options 
)
overrideprotectedvirtual

Implements SkAndroidCodec.

Definition at line 27 of file SkAndroidCodecAdapter.cpp.

28 {
29 return this->codec()->getPixels(info, pixels, rowBytes, &options);
30}
const char * options
Result getPixels(const SkImageInfo &info, void *pixels, size_t rowBytes, const Options *)
Definition: SkCodec.cpp:467

◆ onGetSampledDimensions()

SkISize SkAndroidCodecAdapter::onGetSampledDimensions ( int  sampleSize) const
overrideprotectedvirtual

Implements SkAndroidCodec.

Definition at line 18 of file SkAndroidCodecAdapter.cpp.

18 {
19 float scale = get_scale_from_sample_size(sampleSize);
20 return this->codec()->getScaledDimensions(scale);
21}
static float get_scale_from_sample_size(int sampleSize)
Definition: SkCodecPriv.h:31
SkISize getScaledDimensions(float desiredScale) const
Definition: SkCodec.h:255
const Scalar scale

◆ onGetSupportedSubset()

bool SkAndroidCodecAdapter::onGetSupportedSubset ( SkIRect desiredSubset) const
overrideprotectedvirtual

Implements SkAndroidCodec.

Definition at line 23 of file SkAndroidCodecAdapter.cpp.

23 {
24 return this->codec()->getValidSubset(desiredSubset);
25}
bool getValidSubset(SkIRect *desiredSubset) const
Definition: SkCodec.h:285

The documentation for this class was generated from the following files: