farm-ng-core
sophus::MutImage< TPixel, TAllocator > Class Template Reference

A image with write access to pixels and exclusive ownership. There is no copy constr / copy assignment, but move constr / assignment. More...

#include <image_view.h>

Public Member Functions

 MutImage ()
 Constructs empty image. More...
 
 MutImage (ImageLayout layout)
 Creates new image with given layout. More...
 
 MutImage (sophus::ImageSize size)
 Creates new contiguous image with given size. More...
 
 ~MutImage ()
 Destructor. More...
 
 MutImage (MutImage< TPixel > const &other)=delete
 Not copy constructable. More...
 
auto operator= (MutImage const &) -> MutImage &=delete
 Not copy assignable. More...
 
 MutImage (MutImage &&img) noexcept
 Nothrow move constructor. More...
 
auto operator= (MutImage &&img) noexcept -> MutImage &
 Nothrow move assignment. More...
 
auto viewMut () const -> MutImageView< TPixel >
 
void swap (MutImage &img)
 Swaps img and this. More...
 
void reset ()
 Clears image. More...
 

Static Public Member Functions

static auto makeCopyFrom (ImageView< TPixel > const &view) -> MutImage
 Creates contiguous copy from view. More...
 
template<class TOtherPixel , class TUnaryOperation >
static auto makeFromTransform (ImageView< TOtherPixel > view, TUnaryOperation const &unary_op) -> MutImage
 Creates new MutImage given view and unary transform function. More...
 
template<class TLhsPixel , class TRhsPixel , class TBinaryOperation >
static auto makeFromTransform (ImageView< TLhsPixel > lhs, ImageView< TRhsPixel > rhs, TBinaryOperation const &binary_op) -> MutImage
 Creates new MutImage given two views and binary transform function. More...
 

Protected Member Functions

auto leakAndReturnDeleter () -> MaybeLeakingUniqueDataAreaDeleter< TAllocator >
 Leaks memory and returns deleter. More...
 

Protected Attributes

UniqueDataArea< TAllocator > unique_
 MutImage has unique ownership. More...
 

Friends

template<class TT , class TAllocator2T >
class Image
 
template<class TPredicate , class TAllocator2T >
class MutDynImage
 

Detailed Description

template<class TPixel, class TAllocator = Eigen::aligned_allocator<uint8_t>>
class sophus::MutImage< TPixel, TAllocator >

A image with write access to pixels and exclusive ownership. There is no copy constr / copy assignment, but move constr / assignment.

Content from a MutImage can be moved into an Image.

Type is nullable. In that case this->isEmpty() is true.

Constructor & Destructor Documentation

◆ MutImage() [1/5]

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutImage< TPixel, TAllocator >::MutImage ( )
inline

Constructs empty image.

◆ MutImage() [2/5]

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutImage< TPixel, TAllocator >::MutImage ( ImageLayout  layout)
inlineexplicit

Creates new image with given layout.

If layout is not empty, memory allocation will happen.

◆ MutImage() [3/5]

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutImage< TPixel, TAllocator >::MutImage ( sophus::ImageSize  size)
inlineexplicit

Creates new contiguous image with given size.

If layout is not empty, memory allocation will happen.

◆ ~MutImage()

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutImage< TPixel, TAllocator >::~MutImage ( )
inline

Destructor.

◆ MutImage() [4/5]

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutImage< TPixel, TAllocator >::MutImage ( MutImage< TPixel > const &  other)
delete

Not copy constructable.

◆ MutImage() [5/5]

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
sophus::MutImage< TPixel, TAllocator >::MutImage ( MutImage< TPixel, TAllocator > &&  img)
inlinenoexcept

Nothrow move constructor.

Member Function Documentation

◆ leakAndReturnDeleter()

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
auto sophus::MutImage< TPixel, TAllocator >::leakAndReturnDeleter ( ) -> MaybeLeakingUniqueDataAreaDeleter<TAllocator>
inlineprotected

Leaks memory and returns deleter.

◆ makeCopyFrom()

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
static auto sophus::MutImage< TPixel, TAllocator >::makeCopyFrom ( ImageView< TPixel > const &  view) -> MutImage
inlinestatic

Creates contiguous copy from view.

If view is not empty, memory allocation will happen.

◆ makeFromTransform() [1/2]

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
template<class TLhsPixel , class TRhsPixel , class TBinaryOperation >
static auto sophus::MutImage< TPixel, TAllocator >::makeFromTransform ( ImageView< TLhsPixel >  lhs,
ImageView< TRhsPixel >  rhs,
TBinaryOperation const &  binary_op 
) -> MutImage
inlinestatic

Creates new MutImage given two views and binary transform function.

mut_image(u, v) = binary_op(lhs(u, v), rhs(u, v));

◆ makeFromTransform() [2/2]

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
template<class TOtherPixel , class TUnaryOperation >
static auto sophus::MutImage< TPixel, TAllocator >::makeFromTransform ( ImageView< TOtherPixel >  view,
TUnaryOperation const &  unary_op 
) -> MutImage
inlinestatic

Creates new MutImage given view and unary transform function.

mut_image(u, v) = unary_op(view(u, v));

◆ operator=() [1/2]

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
auto sophus::MutImage< TPixel, TAllocator >::operator= ( MutImage< TPixel, TAllocator > &&  img) -> MutImage&
inlinenoexcept

Nothrow move assignment.

◆ operator=() [2/2]

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

Not copy assignable.

◆ reset()

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
void sophus::MutImage< TPixel, TAllocator >::reset ( )
inline

Clears image.

If image was not empty, memory deallocations will happen.

◆ swap()

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
void sophus::MutImage< TPixel, TAllocator >::swap ( MutImage< TPixel, TAllocator > &  img)
inline

Swaps img and this.

◆ viewMut()

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
auto sophus::MutImage< TPixel, TAllocator >::viewMut ( ) const -> MutImageView<TPixel>
inline

Friends And Related Function Documentation

◆ Image

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
template<class TT , class TAllocator2T >
friend class Image
friend

◆ MutDynImage

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
template<class TPredicate , class TAllocator2T >
friend class MutDynImage
friend

Member Data Documentation

◆ unique_

template<class TPixel , class TAllocator = Eigen::aligned_allocator<uint8_t>>
UniqueDataArea<TAllocator> sophus::MutImage< TPixel, TAllocator >::unique_
protected

MutImage has unique ownership.


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