bool BitmapImage::isSizeAvailable() { if (m_sizeAvailable) return true; m_sizeAvailable = m_source.isSizeAvailable(); didDecodeProperties(); return m_sizeAvailable; }
void BitmapImage::updateSize() const { if (!m_sizeAvailable || m_haveSize) return; m_size = m_source.size(); m_sizeRespectingOrientation = m_source.size(RespectImageOrientation); m_haveSize = true; didDecodeProperties(); }
size_t BitmapImage::frameCount() { if (!m_haveFrameCount) { m_frameCount = m_source.frameCount(); // If decoder is not initialized yet, m_source.frameCount() returns 0. if (m_frameCount) { didDecodeProperties(); m_haveFrameCount = true; } } return m_frameCount; }
bool ImageFrameCache::isSizeAvailable() { if (m_isSizeAvailable) return m_isSizeAvailable.value(); if (!isDecoderAvailable() || !m_decoder->isSizeAvailable()) return false; m_isSizeAvailable = true; didDecodeProperties(m_decoder->bytesDecodedToDetermineProperties()); return true; }
int BitmapImage::repetitionCount(bool imageKnownToBeComplete) { if ((m_repetitionCountStatus == Unknown) || ((m_repetitionCountStatus == Uncertain) && imageKnownToBeComplete)) { // Snag the repetition count. If |imageKnownToBeComplete| is false, the // repetition count may not be accurate yet for GIFs; in this case the // decoder will default to cAnimationLoopOnce, and we'll try and read // the count again once the whole image is decoded. m_repetitionCount = m_source.repetitionCount(); didDecodeProperties(); m_repetitionCountStatus = (imageKnownToBeComplete || m_repetitionCount == cAnimationNone) ? Certain : Uncertain; } return m_repetitionCount; }
T ImageFrameCache::metadata(const T& defaultValue, std::optional<T>* cachedValue) { if (cachedValue && *cachedValue) return cachedValue->value(); if (!isDecoderAvailable() || !m_decoder->isSizeAvailable()) return defaultValue; if (!cachedValue) return (m_decoder->*functor)(); *cachedValue = (m_decoder->*functor)(); didDecodeProperties(m_decoder->bytesDecodedToDetermineProperties()); return cachedValue->value(); }
void BitmapImage::updateSize(ImageOrientationDescription description) const { if (!m_sizeAvailable || m_haveSize) return; m_size = m_source.size(description); m_sizeRespectingOrientation = m_source.size(ImageOrientationDescription(RespectImageOrientation, description.imageOrientation())); m_imageOrientation = static_cast<unsigned>(description.imageOrientation()); m_shouldRespectImageOrientation = static_cast<unsigned>(description.respectImageOrientation()); m_haveSize = true; determineMinimumSubsamplingLevel(); didDecodeProperties(); }
bool BitmapImage::getHotSpot(IntPoint& hotSpot) const { bool result = m_source.getHotSpot(hotSpot); didDecodeProperties(); return result; }
Optional<IntPoint> BitmapImage::hotSpot() const { auto result = m_source.hotSpot(); didDecodeProperties(); return result; }