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; }
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; }
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; }
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; }
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; }
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; }
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); }
void FrameManager::processFrame(const sensor_msgs::Image& img){ //ROS_INFO("processFrame ... "); // caching current frame in memory cacheFrame(img); }