Add frame image accessor.

This commit is contained in:
Bartosz Taudul 2019-06-06 21:48:01 +02:00
parent 34b84bb284
commit af56f41e32
2 changed files with 9 additions and 0 deletions

View File

@ -1400,6 +1400,14 @@ int64_t Worker::GetFrameEnd( const FrameData& fd, size_t idx ) const
}
}
const FrameImage* Worker::GetFrameImage( const FrameData& fd, size_t idx ) const
{
assert( idx < fd.frames.size() );
const auto& v = fd.frames[idx].frameImage;
if( v < 0 ) return nullptr;
return m_data.frameImage[v];
}
std::pair <int, int> Worker::GetFrameRange( const FrameData& fd, int64_t from, int64_t to )
{
auto zitbegin = std::lower_bound( fd.frames.begin(), fd.frames.end(), from, [] ( const auto& lhs, const auto& rhs ) { return lhs.start < rhs; } );

View File

@ -263,6 +263,7 @@ public:
int64_t GetFrameTime( const FrameData& fd, size_t idx ) const;
int64_t GetFrameBegin( const FrameData& fd, size_t idx ) const;
int64_t GetFrameEnd( const FrameData& fd, size_t idx ) const;
const FrameImage* GetFrameImage( const FrameData& fd, size_t idx ) const;
std::pair <int, int> GetFrameRange( const FrameData& fd, int64_t from, int64_t to );
const flat_hash_map<uint32_t, LockMap*, nohash<uint32_t>>& GetLockMap() const { return m_data.lockMap; }