webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WebCore::ImageDecoder Class Referenceabstract

#include <ImageDecoderCG.h>

Inheritance diagram for WebCore::ImageDecoder:
WebCore::BMPImageDecoder WebCore::GIFImageDecoder WebCore::ICOImageDecoder WebCore::JPEGImageDecoder WebCore::PNGImageDecoder

Public Types

enum  { iccColorProfileHeaderLength = 128 }
 

Public Member Functions

 ImageDecoder (AlphaOption, GammaAndColorProfileOption)
 
bool isSizeAvailable () const
 
size_t frameCount () const
 
RepetitionCount repetitionCount () const
 
String filenameExtension () const
 
std::optional< IntPointhotSpot () const
 
IntSize frameSizeAtIndex (size_t, SubsamplingLevel=SubsamplingLevel::Default) const
 
bool frameIsCompleteAtIndex (size_t) const
 
ImageOrientation frameOrientationAtIndex (size_t) const
 
float frameDurationAtIndex (size_t) const
 
bool frameHasAlphaAtIndex (size_t) const
 
bool frameAllowSubsamplingAtIndex (size_t) const
 
unsigned frameBytesAtIndex (size_t, SubsamplingLevel=SubsamplingLevel::Default) const
 
NativeImagePtr createFrameImageAtIndex (size_t, SubsamplingLevel=SubsamplingLevel::Default, DecodingMode=DecodingMode::OnDemand) const
 
void setData (SharedBuffer &, bool allDataReceived)
 
bool isAllDataReceived () const
 
void clearFrameBufferCache (size_t)
 
 ImageDecoder ()
 
String filenameExtension () const
 
bool isSizeAvailable () const
 
IntSize size () const
 
size_t frameCount () const
 
RepetitionCount repetitionCount () const
 
std::optional< IntPointhotSpot () const
 
IntSize frameSizeAtIndex (size_t, SubsamplingLevel=SubsamplingLevel::Default) const
 
bool frameIsCompleteAtIndex (size_t) const
 
ImageOrientation frameOrientationAtIndex (size_t) const
 
float frameDurationAtIndex (size_t) const
 
bool frameHasAlphaAtIndex (size_t) const
 
bool frameAllowSubsamplingAtIndex (size_t) const
 
unsigned frameBytesAtIndex (size_t, SubsamplingLevel=SubsamplingLevel::Default) const
 
NativeImagePtr createFrameImageAtIndex (size_t, SubsamplingLevel=SubsamplingLevel::Default, DecodingMode=DecodingMode::OnDemand) const
 
void setData (SharedBuffer &, bool allDataReceived)
 
bool isAllDataReceived () const
 
void clearFrameBufferCache (size_t)
 
void setTargetContext (ID2D1RenderTarget *)
 
 ImageDecoder (AlphaOption alphaOption, GammaAndColorProfileOption gammaAndColorProfileOption)
 
virtual ~ImageDecoder ()
 
virtual String filenameExtension () const =0
 
bool premultiplyAlpha () const
 
bool isAllDataReceived () const
 
virtual void setData (SharedBuffer &data, bool allDataReceived)
 
virtual bool isSizeAvailable ()
 
virtual IntSize size ()
 
IntSize scaledSize ()
 
virtual IntSize frameSizeAtIndex (size_t, SubsamplingLevel)
 
virtual bool setSize (const IntSize &size)
 
virtual size_t frameCount () const
 
virtual RepetitionCount repetitionCount () const
 
virtual ImageFrameframeBufferAtIndex (size_t)=0
 
bool frameIsCompleteAtIndex (size_t)
 
bool frameHasAlphaAtIndex (size_t) const
 
unsigned frameBytesAtIndex (size_t) const
 
float frameDurationAtIndex (size_t)
 
NativeImagePtr createFrameImageAtIndex (size_t, SubsamplingLevel=SubsamplingLevel::Default, DecodingMode=DecodingMode::OnDemand)
 
void setIgnoreGammaAndColorProfile (bool flag)
 
bool ignoresGammaAndColorProfile () const
 
ImageOrientation frameOrientationAtIndex (size_t) const
 
bool frameAllowSubsamplingAtIndex (size_t) const
 
virtual bool setFailed ()
 
bool failed () const
 
virtual void clearFrameBufferCache (size_t)
 
virtual std::optional< IntPointhotSpot () const
 

Static Public Member Functions

static std::unique_ptr< ImageDecodercreate (const SharedBuffer &, AlphaOption alphaOption, GammaAndColorProfileOption gammaAndColorProfileOption)
 
static size_t bytesDecodedToDetermineProperties ()
 
static std::unique_ptr< ImageDecodercreate (const SharedBuffer &, AlphaOption, GammaAndColorProfileOption)
 
static size_t bytesDecodedToDetermineProperties ()
 
static IWICImagingFactory * systemImagingFactory ()
 
static std::unique_ptr< ImageDecodercreate (const SharedBuffer &data, AlphaOption, GammaAndColorProfileOption)
 
static bool rgbColorProfile (const char *profileData, unsigned profileLength)
 
static size_t bytesDecodedToDetermineProperties ()
 
static SubsamplingLevel subsamplingLevelForScale (float, SubsamplingLevel)
 
static bool inputDeviceColorProfile (const char *profileData, unsigned profileLength)
 

Protected Member Functions

void prepareScaleDataIfNecessary ()
 
int upperBoundScaledX (int origX, int searchStart=0)
 
int lowerBoundScaledX (int origX, int searchStart=0)
 
int upperBoundScaledY (int origY, int searchStart=0)
 
int lowerBoundScaledY (int origY, int searchStart=0)
 
int scaledY (int origY, int searchStart=0)
 

Protected Attributes

bool m_isAllDataReceived { false }
 
RetainPtr< CGImageSourceRefm_nativeDecoder
 
IntSize m_size
 
COMPtr< IWICBitmapDecoder > m_nativeDecoder
 
COMPtr< ID2D1RenderTarget > m_renderTarget
 
RefPtr< SharedBufferm_data
 
Vector< ImageFrame, 1 > m_frameBufferCache
 
bool m_scaled { false }
 
Vector< int > m_scaledColumns
 
Vector< int > m_scaledRows
 
bool m_premultiplyAlpha
 
bool m_ignoreGammaAndColorProfile
 
ImageOrientation m_orientation
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
iccColorProfileHeaderLength 

Constructor & Destructor Documentation

◆ ImageDecoder() [1/3]

WebCore::ImageDecoder::ImageDecoder ( AlphaOption  ,
GammaAndColorProfileOption   
)

◆ ImageDecoder() [2/3]

WebCore::ImageDecoder::ImageDecoder ( )

◆ ImageDecoder() [3/3]

WebCore::ImageDecoder::ImageDecoder ( AlphaOption  alphaOption,
GammaAndColorProfileOption  gammaAndColorProfileOption 
)
inline

◆ ~ImageDecoder()

virtual WebCore::ImageDecoder::~ImageDecoder ( )
inlinevirtual

Member Function Documentation

◆ bytesDecodedToDetermineProperties() [1/3]

static size_t WebCore::ImageDecoder::bytesDecodedToDetermineProperties ( )
static

◆ bytesDecodedToDetermineProperties() [2/3]

static size_t WebCore::ImageDecoder::bytesDecodedToDetermineProperties ( )
static

◆ bytesDecodedToDetermineProperties() [3/3]

static size_t WebCore::ImageDecoder::bytesDecodedToDetermineProperties ( )
inlinestatic

◆ clearFrameBufferCache() [1/3]

void WebCore::ImageDecoder::clearFrameBufferCache ( size_t  )
inline

◆ clearFrameBufferCache() [2/3]

void WebCore::ImageDecoder::clearFrameBufferCache ( size_t  )
inline

◆ clearFrameBufferCache() [3/3]

virtual void WebCore::ImageDecoder::clearFrameBufferCache ( size_t  )
inlinevirtual

Reimplemented in WebCore::GIFImageDecoder.

◆ create() [1/3]

std::unique_ptr< ImageDecoder > WebCore::ImageDecoder::create ( const SharedBuffer data,
AlphaOption  alphaOption,
GammaAndColorProfileOption  gammaAndColorProfileOption 
)
inlinestatic

◆ create() [2/3]

static std::unique_ptr<ImageDecoder> WebCore::ImageDecoder::create ( const SharedBuffer ,
AlphaOption  ,
GammaAndColorProfileOption   
)
inlinestatic

◆ create() [3/3]

static std::unique_ptr<ImageDecoder> WebCore::ImageDecoder::create ( const SharedBuffer data,
AlphaOption  ,
GammaAndColorProfileOption   
)
static

◆ createFrameImageAtIndex() [1/3]

NativeImagePtr WebCore::ImageDecoder::createFrameImageAtIndex ( size_t  ,
SubsamplingLevel  = SubsamplingLevel::Default,
DecodingMode  = DecodingMode::OnDemand 
) const

◆ createFrameImageAtIndex() [2/3]

NativeImagePtr WebCore::ImageDecoder::createFrameImageAtIndex ( size_t  ,
SubsamplingLevel  = SubsamplingLevel::Default,
DecodingMode  = DecodingMode::OnDemand 
) const

◆ createFrameImageAtIndex() [3/3]

NativeImagePtr WebCore::ImageDecoder::createFrameImageAtIndex ( size_t  index,
SubsamplingLevel  = SubsamplingLevel::Default,
DecodingMode  = DecodingMode::OnDemand 
)

◆ failed()

bool WebCore::ImageDecoder::failed ( ) const
inline

◆ filenameExtension() [1/3]

String WebCore::ImageDecoder::filenameExtension ( ) const

◆ filenameExtension() [2/3]

String WebCore::ImageDecoder::filenameExtension ( ) const

◆ filenameExtension() [3/3]

virtual String WebCore::ImageDecoder::filenameExtension ( ) const
pure virtual

◆ frameAllowSubsamplingAtIndex() [1/3]

bool WebCore::ImageDecoder::frameAllowSubsamplingAtIndex ( size_t  ) const

◆ frameAllowSubsamplingAtIndex() [2/3]

bool WebCore::ImageDecoder::frameAllowSubsamplingAtIndex ( size_t  ) const

◆ frameAllowSubsamplingAtIndex() [3/3]

bool WebCore::ImageDecoder::frameAllowSubsamplingAtIndex ( size_t  ) const
inline

◆ frameBufferAtIndex()

virtual ImageFrame* WebCore::ImageDecoder::frameBufferAtIndex ( size_t  )
pure virtual

◆ frameBytesAtIndex() [1/3]

unsigned WebCore::ImageDecoder::frameBytesAtIndex ( size_t  ,
SubsamplingLevel  = SubsamplingLevel::Default 
) const

◆ frameBytesAtIndex() [2/3]

unsigned WebCore::ImageDecoder::frameBytesAtIndex ( size_t  ,
SubsamplingLevel  = SubsamplingLevel::Default 
) const

◆ frameBytesAtIndex() [3/3]

unsigned WebCore::ImageDecoder::frameBytesAtIndex ( size_t  index) const

◆ frameCount() [1/3]

size_t WebCore::ImageDecoder::frameCount ( ) const

◆ frameCount() [2/3]

size_t WebCore::ImageDecoder::frameCount ( ) const

◆ frameCount() [3/3]

virtual size_t WebCore::ImageDecoder::frameCount ( ) const
inlinevirtual

◆ frameDurationAtIndex() [1/3]

float WebCore::ImageDecoder::frameDurationAtIndex ( size_t  ) const

◆ frameDurationAtIndex() [2/3]

float WebCore::ImageDecoder::frameDurationAtIndex ( size_t  ) const

◆ frameDurationAtIndex() [3/3]

float WebCore::ImageDecoder::frameDurationAtIndex ( size_t  index)

◆ frameHasAlphaAtIndex() [1/3]

bool WebCore::ImageDecoder::frameHasAlphaAtIndex ( size_t  index) const

◆ frameHasAlphaAtIndex() [2/3]

bool WebCore::ImageDecoder::frameHasAlphaAtIndex ( size_t  ) const

◆ frameHasAlphaAtIndex() [3/3]

bool WebCore::ImageDecoder::frameHasAlphaAtIndex ( size_t  ) const

◆ frameIsCompleteAtIndex() [1/3]

bool WebCore::ImageDecoder::frameIsCompleteAtIndex ( size_t  ) const

◆ frameIsCompleteAtIndex() [2/3]

bool WebCore::ImageDecoder::frameIsCompleteAtIndex ( size_t  ) const

◆ frameIsCompleteAtIndex() [3/3]

bool WebCore::ImageDecoder::frameIsCompleteAtIndex ( size_t  index)

◆ frameOrientationAtIndex() [1/3]

ImageOrientation WebCore::ImageDecoder::frameOrientationAtIndex ( size_t  ) const

◆ frameOrientationAtIndex() [2/3]

ImageOrientation WebCore::ImageDecoder::frameOrientationAtIndex ( size_t  ) const

◆ frameOrientationAtIndex() [3/3]

ImageOrientation WebCore::ImageDecoder::frameOrientationAtIndex ( size_t  ) const
inline

◆ frameSizeAtIndex() [1/3]

IntSize WebCore::ImageDecoder::frameSizeAtIndex ( size_t  ,
SubsamplingLevel  = SubsamplingLevel::Default 
) const

◆ frameSizeAtIndex() [2/3]

IntSize WebCore::ImageDecoder::frameSizeAtIndex ( size_t  ,
SubsamplingLevel  = SubsamplingLevel::Default 
) const

◆ frameSizeAtIndex() [3/3]

virtual IntSize WebCore::ImageDecoder::frameSizeAtIndex ( size_t  ,
SubsamplingLevel   
)
inlinevirtual

Reimplemented in WebCore::ICOImageDecoder.

◆ hotSpot() [1/3]

std::optional<IntPoint> WebCore::ImageDecoder::hotSpot ( ) const

◆ hotSpot() [2/3]

std::optional<IntPoint> WebCore::ImageDecoder::hotSpot ( ) const

◆ hotSpot() [3/3]

virtual std::optional<IntPoint> WebCore::ImageDecoder::hotSpot ( ) const
inlinevirtual

Reimplemented in WebCore::ICOImageDecoder.

◆ ignoresGammaAndColorProfile()

bool WebCore::ImageDecoder::ignoresGammaAndColorProfile ( ) const
inline

◆ inputDeviceColorProfile()

static bool WebCore::ImageDecoder::inputDeviceColorProfile ( const char *  profileData,
unsigned  profileLength 
)
inlinestatic

◆ isAllDataReceived() [1/3]

bool WebCore::ImageDecoder::isAllDataReceived ( ) const
inline

◆ isAllDataReceived() [2/3]

bool WebCore::ImageDecoder::isAllDataReceived ( ) const
inline

◆ isAllDataReceived() [3/3]

bool WebCore::ImageDecoder::isAllDataReceived ( ) const
inline

◆ isSizeAvailable() [1/3]

bool WebCore::ImageDecoder::isSizeAvailable ( ) const

◆ isSizeAvailable() [2/3]

bool WebCore::ImageDecoder::isSizeAvailable ( ) const

◆ isSizeAvailable() [3/3]

virtual bool WebCore::ImageDecoder::isSizeAvailable ( )
inlinevirtual

◆ lowerBoundScaledX()

int WebCore::ImageDecoder::lowerBoundScaledX ( int  origX,
int  searchStart = 0 
)
protected

◆ lowerBoundScaledY()

int WebCore::ImageDecoder::lowerBoundScaledY ( int  origY,
int  searchStart = 0 
)
protected

◆ premultiplyAlpha()

bool WebCore::ImageDecoder::premultiplyAlpha ( ) const
inline

◆ prepareScaleDataIfNecessary()

void WebCore::ImageDecoder::prepareScaleDataIfNecessary ( )
protected

◆ repetitionCount() [1/3]

RepetitionCount WebCore::ImageDecoder::repetitionCount ( ) const

◆ repetitionCount() [2/3]

RepetitionCount WebCore::ImageDecoder::repetitionCount ( ) const

◆ repetitionCount() [3/3]

virtual RepetitionCount WebCore::ImageDecoder::repetitionCount ( ) const
inlinevirtual

Reimplemented in WebCore::GIFImageDecoder.

◆ rgbColorProfile()

static bool WebCore::ImageDecoder::rgbColorProfile ( const char *  profileData,
unsigned  profileLength 
)
inlinestatic

◆ scaledSize()

IntSize WebCore::ImageDecoder::scaledSize ( )
inline

◆ scaledY()

int WebCore::ImageDecoder::scaledY ( int  origY,
int  searchStart = 0 
)
protected

◆ setData() [1/3]

void WebCore::ImageDecoder::setData ( SharedBuffer ,
bool  allDataReceived 
)

◆ setData() [2/3]

void WebCore::ImageDecoder::setData ( SharedBuffer ,
bool  allDataReceived 
)

◆ setData() [3/3]

virtual void WebCore::ImageDecoder::setData ( SharedBuffer data,
bool  allDataReceived 
)
inlinevirtual

◆ setFailed()

virtual bool WebCore::ImageDecoder::setFailed ( )
inlinevirtual

◆ setIgnoreGammaAndColorProfile()

void WebCore::ImageDecoder::setIgnoreGammaAndColorProfile ( bool  flag)
inline

◆ setSize()

virtual bool WebCore::ImageDecoder::setSize ( const IntSize size)
inlinevirtual

◆ setTargetContext()

void WebCore::ImageDecoder::setTargetContext ( ID2D1RenderTarget *  )

◆ size() [1/2]

IntSize WebCore::ImageDecoder::size ( ) const

◆ size() [2/2]

virtual IntSize WebCore::ImageDecoder::size ( )
inlinevirtual

Reimplemented in WebCore::ICOImageDecoder.

◆ subsamplingLevelForScale()

static SubsamplingLevel WebCore::ImageDecoder::subsamplingLevelForScale ( float  ,
SubsamplingLevel   
)
inlinestatic

◆ systemImagingFactory()

static IWICImagingFactory* WebCore::ImageDecoder::systemImagingFactory ( )
static

◆ upperBoundScaledX()

int WebCore::ImageDecoder::upperBoundScaledX ( int  origX,
int  searchStart = 0 
)
protected

◆ upperBoundScaledY()

int WebCore::ImageDecoder::upperBoundScaledY ( int  origY,
int  searchStart = 0 
)
protected

Member Data Documentation

◆ m_data

RefPtr<SharedBuffer> WebCore::ImageDecoder::m_data
protected

◆ m_frameBufferCache

Vector<ImageFrame, 1> WebCore::ImageDecoder::m_frameBufferCache
protected

◆ m_ignoreGammaAndColorProfile

bool WebCore::ImageDecoder::m_ignoreGammaAndColorProfile
protected

◆ m_isAllDataReceived

bool WebCore::ImageDecoder::m_isAllDataReceived { false }
protected

◆ m_nativeDecoder [1/2]

RetainPtr<CGImageSourceRef> WebCore::ImageDecoder::m_nativeDecoder
protected

◆ m_nativeDecoder [2/2]

COMPtr<IWICBitmapDecoder> WebCore::ImageDecoder::m_nativeDecoder
protected

◆ m_orientation

ImageOrientation WebCore::ImageDecoder::m_orientation
protected

◆ m_premultiplyAlpha

bool WebCore::ImageDecoder::m_premultiplyAlpha
protected

◆ m_renderTarget

COMPtr<ID2D1RenderTarget> WebCore::ImageDecoder::m_renderTarget
protected

◆ m_scaled

bool WebCore::ImageDecoder::m_scaled { false }
protected

◆ m_scaledColumns

Vector<int> WebCore::ImageDecoder::m_scaledColumns
protected

◆ m_scaledRows

Vector<int> WebCore::ImageDecoder::m_scaledRows
protected

◆ m_size

IntSize WebCore::ImageDecoder::m_size
mutableprotected

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