NativeImagePtr BitmapImage::frameAtIndex(size_t index)
{
    if (index >= frameCount())
        return 0;

    if (index >= m_frames.size() || !m_frames[index].m_frame)
        cacheFrame(index);

    return m_frames[index].m_frame;
}
bool BitmapImage::frameIsCompleteAtIndex(size_t index)
{
    if (index >= frameCount())
        return true;

    if (index >= m_frames.size() || !m_frames[index].m_haveMetadata)
        cacheFrame(index);

    return m_frames[index].m_isComplete;
}
Esempio n. 3
0
bool BitmapImage::ensureFrameIsCached(size_t index)
{
    if (index >= frameCount())
        return false;

    if (index >= m_frames.size() || !m_frames[index].m_frame)
        cacheFrame(index);

    return true;
}
Esempio n. 4
0
bool BitmapImage::frameHasAlphaAtIndex(size_t index)
{
    if (index >= frameCount())
        return true;

    if (index >= m_frames.size() || !m_frames[index].m_haveMetadata)
        cacheFrame(index);

    return m_frames[index].m_hasAlpha;
}
Esempio n. 5
0
float BitmapImage::frameDurationAtIndex(size_t index)
{
    if (index >= frameCount())
        return 0;

    if (index >= m_frames.size() || !m_frames[index].m_haveMetadata)
        cacheFrame(index);

    return m_frames[index].m_duration;
}
Esempio n. 6
0
bool Image::frameHasAlphaAtIndex(size_t index)
{
    if (index >= frameCount())
        return 0;

    if (index >= m_frames.size() || !m_frames[index].m_frame)
        cacheFrame(index);

    return m_frames[index].m_hasAlpha;
}
Esempio n. 7
0
bool BitmapImage::ensureFrameIsCached(size_t index, ImageFrameCaching frameCaching)
{
    if (index >= frameCount())
        return false;

    if (index >= m_frames.size()
        || (frameCaching == CacheMetadataAndFrame && !m_frames[index].m_image)
        || (frameCaching == CacheMetadataOnly && !m_frames[index].m_haveMetadata))
        cacheFrame(index, 0, frameCaching);

    return true;
}
Esempio n. 8
0
PassNativeImagePtr BitmapImage::copyUnscaledFrameAtIndex(size_t index)
{
    if (index >= frameCount())
        return nullptr;

    if (index >= m_frames.size() || !m_frames[index].m_frame)
        cacheFrame(index, 0);

    if (!m_frames[index].m_subsamplingLevel)
        return CGImageRetain(m_frames[index].m_frame);

    return m_source.createFrameAtIndex(index);
}
Esempio n. 9
0
void FrameManager::processFrame(const sensor_msgs::Image& img){
	//ROS_INFO("processFrame ... ");
	// caching current frame in memory
	cacheFrame(img);
}