farm-ng-core
sophus::DynImageView< TPredicate > Class Template Reference

#include <dyn_image_view.h>

Collaboration diagram for sophus::DynImageView< TPredicate >:

Public Member Functions

template<class TPixel >
 DynImageView (ImageView< TPixel > const &image)
 Create type-erased image view from ImageView. More...
 
template<class TPixel >
auto has () const noexcept -> bool
 
auto rawRowPtr (int v) const -> uint8_t const *
 Returns v-th row pointer. More...
 
auto rawPtr () const -> uint8_t const *
 
auto layout () const -> ImageLayout const &
 
auto imageSize () const -> ImageSize const &
 
auto area () const -> size_t
 
auto width () const -> int
 
auto height () const -> int
 
auto pitchBytes () const -> size_t
 
auto sizeBytes () const -> size_t
 
auto isEmpty () const -> bool
 
auto pixelFormat () const -> PixelFormat
 
auto numChannels () const -> int
 
auto subview (Eigen::Vector2i uv, sophus::ImageSize size) const -> DynImageView
 Returns subview with shared ownership semantics of whole image. More...
 
template<class TPixel >
auto imageView () const noexcept -> ImageView< TPixel >
 Returns typed image. More...
 
void setViewToEmpty ()
 

Static Public Member Functions

static DynImageView unsafeWrapAndPromiseProperAlignment (ImageLayout const &layout, PixelFormat const &pixel_format, void const *ptr)
 

Protected Member Functions

 DynImageView ()=default
 
 DynImageView (ImageLayout const &layout, PixelFormat const &pixel_format, void const *ptr)
 

Protected Attributes

ImageLayout layout_ = {}
 
PixelFormat pixel_format_
 
uint8_t const * ptr_ = nullptr
 

Constructor & Destructor Documentation

◆ DynImageView() [1/3]

template<class TPredicate = AnyImagePredicate>
template<class TPixel >
sophus::DynImageView< TPredicate >::DynImageView ( ImageView< TPixel > const &  image)
inline

Create type-erased image view from ImageView.

By design not "explicit".

◆ DynImageView() [2/3]

template<class TPredicate = AnyImagePredicate>
sophus::DynImageView< TPredicate >::DynImageView ( )
protecteddefault

◆ DynImageView() [3/3]

template<class TPredicate = AnyImagePredicate>
sophus::DynImageView< TPredicate >::DynImageView ( ImageLayout const &  layout,
PixelFormat const &  pixel_format,
void const *  ptr 
)
inlineprotected

Member Function Documentation

◆ area()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::area ( ) const -> size_t
inline

◆ has()

template<class TPredicate = AnyImagePredicate>
template<class TPixel >
auto sophus::DynImageView< TPredicate >::has ( ) const -> bool
inlinenoexcept

◆ height()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::height ( ) const -> int
inline

◆ imageSize()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::imageSize ( ) const -> ImageSize const&
inline

◆ imageView()

template<class TPredicate = AnyImagePredicate>
template<class TPixel >
auto sophus::DynImageView< TPredicate >::imageView ( ) const -> ImageView<TPixel>
inlinenoexcept

Returns typed image.

Precondition: this->has<TPixel>()

◆ isEmpty()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::isEmpty ( ) const -> bool
inline

◆ layout()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::layout ( ) const -> ImageLayout const&
inline

◆ numChannels()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::numChannels ( ) const -> int
inline

◆ pitchBytes()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::pitchBytes ( ) const -> size_t
inline

◆ pixelFormat()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::pixelFormat ( ) const -> PixelFormat
inline

◆ rawPtr()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::rawPtr ( ) const -> uint8_t const*
inline

◆ rawRowPtr()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::rawRowPtr ( int  v) const -> uint8_t const*
inline

Returns v-th row pointer.

Precondition: v must be in [0, height).

◆ setViewToEmpty()

template<class TPredicate = AnyImagePredicate>
void sophus::DynImageView< TPredicate >::setViewToEmpty ( )
inline

◆ sizeBytes()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::sizeBytes ( ) const -> size_t
inline

◆ subview()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::subview ( Eigen::Vector2i  uv,
sophus::ImageSize  size 
) const -> DynImageView
inline

Returns subview with shared ownership semantics of whole image.

◆ unsafeWrapAndPromiseProperAlignment()

template<class TPredicate = AnyImagePredicate>
static DynImageView sophus::DynImageView< TPredicate >::unsafeWrapAndPromiseProperAlignment ( ImageLayout const &  layout,
PixelFormat const &  pixel_format,
void const *  ptr 
)
inlinestatic

◆ width()

template<class TPredicate = AnyImagePredicate>
auto sophus::DynImageView< TPredicate >::width ( ) const -> int
inline

Member Data Documentation

◆ layout_

template<class TPredicate = AnyImagePredicate>
ImageLayout sophus::DynImageView< TPredicate >::layout_ = {}
protected

◆ pixel_format_

template<class TPredicate = AnyImagePredicate>
PixelFormat sophus::DynImageView< TPredicate >::pixel_format_
protected

◆ ptr_

template<class TPredicate = AnyImagePredicate>
uint8_t const* sophus::DynImageView< TPredicate >::ptr_ = nullptr
protected

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