farm-ng-core
sophus::MutDynImage< TPredicate, TAllocator > Class Template Reference

#include <mut_dyn_image.h>

Inheritance diagram for sophus::MutDynImage< TPredicate, TAllocator >:
Collaboration diagram for sophus::MutDynImage< TPredicate, TAllocator >:

Public Member Functions

 MutDynImage ()=default
 Empty image. More...
 
 MutDynImage (MutDynImage const &other)=delete
 Not copy constructable. More...
 
auto operator= (MutDynImage const &) -> MutDynImage &=delete
 Not copy assignable. More...
 
 MutDynImage (MutDynImage &&other) noexcept=default
 Nothrow move constructable. More...
 
auto operator= (MutDynImage &&) noexcept -> MutDynImage &=default
 Nothrow move assignable. More...
 
template<class TPixel >
 MutDynImage (MutImage< TPixel, TAllocator > &&image)
 Create type-erased image from MutImage. More...
 
template<class TPixel >
auto has () const noexcept -> bool
 Return true is this contains data of type TPixel. More...
 
template<class TPixel >
auto moveOutAs () noexcept -> MutImage< TPixel, TAllocator >
 Returns typed MutImage. More...
 
- Public Member Functions inherited from sophus::MutDynImageView< AnyImagePredicate >
 MutDynImageView (MutImageView< TPixel > const &image)
 Create type-erased image view from ImageView. More...
 
auto has () const noexcept -> bool
 Return true is this contains data of type TPixel. More...
 
auto rawMutRowPtr (int v) const -> uint8_t *
 Returns v-th row pointer. More...
 
auto rawMutPtr () const -> uint8_t *
 
auto mutSubview (Eigen::Vector2i uv, sophus::ImageSize size) const -> MutDynImageView
 Returns subview with shared ownership semantics of whole image. More...
 
auto mutImageView () const noexcept -> MutImageView< TPixel >
 Returns typed image view. More...
 
void copyDataFrom (DynImageView< AnyImagePredicate > view) const
 Copies data from view into this. More...
 
- Public Member Functions inherited from sophus::DynImageView< AnyImagePredicate >
 DynImageView (ImageView< TPixel > const &image)
 Create type-erased image view from ImageView. More...
 
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...
 
auto imageView () const noexcept -> ImageView< TPixel >
 Returns typed image. More...
 
void setViewToEmpty ()
 

Static Public Member Functions

static Expected< DynImage< TPredicate, TAllocator > > tryFromFormat (ImageSize const &size, PixelFormat const &pixel_format)
 Tries to create image from provided size and format. Returns error if format does not satisfy TPredicate. More...
 
static Expected< MutDynImage< TPredicate, TAllocator > > tryFromFormat (ImageLayout const &layout, PixelFormat const &pixel_format)
 Tries to create image from provided size and format. Returns error if format does not satisfy TPredicate. More...
 
static MutDynImage< TPredicate, TAllocator > fromFormat (ImageSize const &size, PixelFormat const &pixel_format)
 
static DynImage< TPredicate, TAllocator > fromFormat (ImageLayout const &layout, PixelFormat const &pixel_format)
 
template<class TT >
static auto makeCopyFrom (ImageView< TT > image_view) -> MutDynImage
 
static auto makeCopyFrom (DynImageView< TPredicate > image_view) -> MutDynImage
 
- Static Public Member Functions inherited from sophus::DynImageView< AnyImagePredicate >
static DynImageView unsafeWrapAndPromiseProperAlignment (ImageLayout const &layout, PixelFormat const &pixel_format, void const *ptr)
 

Protected Member Functions

 MutDynImage (ImageLayout layout, PixelFormat pixel_format, UniqueDataArea< TAllocator > unique)
 
 MutDynImage (ImageSize const &size, PixelFormat const &pixel_format)
 
 MutDynImage (ImageLayout const &layout, PixelFormat const &pixel_format)
 
- Protected Member Functions inherited from sophus::MutDynImageView< AnyImagePredicate >
 MutDynImageView (ImageLayout const &layout, PixelFormat const &pixel_format, void const *ptr)
 
 MutDynImageView ()=default
 
- Protected Member Functions inherited from sophus::DynImageView< AnyImagePredicate >
 DynImageView ()=default
 
 DynImageView (ImageLayout const &layout, PixelFormat const &pixel_format, void const *ptr)
 

Protected Attributes

UniqueDataArea< TAllocator > unique_
 
- Protected Attributes inherited from sophus::DynImageView< AnyImagePredicate >
ImageLayout layout_
 
PixelFormat pixel_format_
 
uint8_t const * ptr_
 

Friends

template<class TPredicate2 , class TAllocator2T >
class DynImage
 

Constructor & Destructor Documentation

◆ MutDynImage() [1/7]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutDynImage< TPredicate, TAllocator >::MutDynImage ( )
default

Empty image.

◆ MutDynImage() [2/7]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutDynImage< TPredicate, TAllocator >::MutDynImage ( MutDynImage< TPredicate, TAllocator > const &  other)
delete

Not copy constructable.

◆ MutDynImage() [3/7]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutDynImage< TPredicate, TAllocator >::MutDynImage ( MutDynImage< TPredicate, TAllocator > &&  other)
defaultnoexcept

Nothrow move constructable.

◆ MutDynImage() [4/7]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
template<class TPixel >
sophus::MutDynImage< TPredicate, TAllocator >::MutDynImage ( MutImage< TPixel, TAllocator > &&  image)
inline

Create type-erased image from MutImage.

By design not "explicit".

◆ MutDynImage() [5/7]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutDynImage< TPredicate, TAllocator >::MutDynImage ( ImageLayout  layout,
PixelFormat  pixel_format,
UniqueDataArea< TAllocator >  unique 
)
inlineprotected

◆ MutDynImage() [6/7]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutDynImage< TPredicate, TAllocator >::MutDynImage ( ImageSize const &  size,
PixelFormat const &  pixel_format 
)
inlineprotected

◆ MutDynImage() [7/7]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutDynImage< TPredicate, TAllocator >::MutDynImage ( ImageLayout const &  layout,
PixelFormat const &  pixel_format 
)
inlineprotected

Member Function Documentation

◆ fromFormat() [1/2]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
static DynImage<TPredicate, TAllocator> sophus::MutDynImage< TPredicate, TAllocator >::fromFormat ( ImageLayout const &  layout,
PixelFormat const &  pixel_format 
)
inlinestatic

◆ fromFormat() [2/2]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
static MutDynImage<TPredicate, TAllocator> sophus::MutDynImage< TPredicate, TAllocator >::fromFormat ( ImageSize const &  size,
PixelFormat const &  pixel_format 
)
inlinestatic

◆ has()

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
template<class TPixel >
auto sophus::MutDynImage< TPredicate, TAllocator >::has ( ) const -> bool
inlinenoexcept

Return true is this contains data of type TPixel.

◆ makeCopyFrom() [1/2]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
static auto sophus::MutDynImage< TPredicate, TAllocator >::makeCopyFrom ( DynImageView< TPredicate >  image_view) -> MutDynImage
inlinestatic

◆ makeCopyFrom() [2/2]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
template<class TT >
static auto sophus::MutDynImage< TPredicate, TAllocator >::makeCopyFrom ( ImageView< TT >  image_view) -> MutDynImage
inlinestatic

◆ moveOutAs()

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
template<class TPixel >
auto sophus::MutDynImage< TPredicate, TAllocator >::moveOutAs ( ) -> MutImage<TPixel, TAllocator>
inlinenoexcept

Returns typed MutImage.

Precondition: this->has<TPixel>()

◆ operator=() [1/2]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
auto sophus::MutDynImage< TPredicate, TAllocator >::operator= ( MutDynImage< TPredicate, TAllocator > &&  ) -> MutDynImage &=default
defaultnoexcept

Nothrow move assignable.

◆ operator=() [2/2]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
auto sophus::MutDynImage< TPredicate, TAllocator >::operator= ( MutDynImage< TPredicate, TAllocator > const &  ) -> MutDynImage &=delete
delete

Not copy assignable.

◆ tryFromFormat() [1/2]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
static Expected<MutDynImage<TPredicate, TAllocator> > sophus::MutDynImage< TPredicate, TAllocator >::tryFromFormat ( ImageLayout const &  layout,
PixelFormat const &  pixel_format 
)
inlinestatic

Tries to create image from provided size and format. Returns error if format does not satisfy TPredicate.

◆ tryFromFormat() [2/2]

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
static Expected<DynImage<TPredicate, TAllocator> > sophus::MutDynImage< TPredicate, TAllocator >::tryFromFormat ( ImageSize const &  size,
PixelFormat const &  pixel_format 
)
inlinestatic

Tries to create image from provided size and format. Returns error if format does not satisfy TPredicate.

Friends And Related Function Documentation

◆ DynImage

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
template<class TPredicate2 , class TAllocator2T >
friend class DynImage
friend

Member Data Documentation

◆ unique_

template<class TPredicate = AnyImagePredicate, class TAllocator = Eigen::aligned_allocator<uint8_t>>
UniqueDataArea<TAllocator> sophus::MutDynImage< TPredicate, TAllocator >::unique_
protected

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