farm-ng-core
|
Type-erased image with shared ownership, and read-only access to pixels. Type is nullable. More...
#include <dyn_image.h>
Public Member Functions | |
DynImage ()=default | |
Empty image. More... | |
template<class TPixel > | |
DynImage (Image< TPixel, TAllocator > const &image) | |
Create type-erased image from Image. More... | |
template<class TPixel > | |
DynImage (MutImage< TPixel > &&image) | |
Create type-erased image from MutImage. By design not "explicit". More... | |
DynImage (MutDynImage< TPredicate, TAllocator > &&image) | |
Create type-erased image from MutImage. By design not "explicit". More... | |
template<class TPixel > | |
auto | has () const noexcept -> bool |
Return true is this contains data of type TPixel. More... | |
template<class TPixel > | |
auto | image () const noexcept -> Image< TPixel, TAllocator > |
Returns typed image. More... | |
template<class TPixel > | |
auto | reinterpretAs (ImageSize reinterpreted_size) const noexcept -> Image< TPixel, TAllocator > |
auto | useCount () const -> size_t |
![]() | |
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 DynImage< TPredicate, TAllocator > | fromFormat (ImageSize const &size, PixelFormat const &pixel_format) |
static DynImage< TPredicate, TAllocator > | fromFormat (ImageLayout const &layout, PixelFormat const &pixel_format) |
static Expected< DynImage< 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... | |
template<class TOtherPredicate > | |
static auto | tryFrom (DynImage< TOtherPredicate, TAllocator > other_image) -> Expected< DynImage< TPredicate, TAllocator >> |
![]() | |
static DynImageView | unsafeWrapAndPromiseProperAlignment (ImageLayout const &layout, PixelFormat const &pixel_format, void const *ptr) |
Protected Member Functions | |
DynImage (ImageLayout layout, PixelFormat pixel_format, std::shared_ptr< uint8_t > shared) | |
![]() | |
DynImageView ()=default | |
DynImageView (ImageLayout const &layout, PixelFormat const &pixel_format, void const *ptr) | |
Protected Attributes | |
std::shared_ptr< uint8_t > | shared_ |
![]() | |
ImageLayout | layout_ |
PixelFormat | pixel_format_ |
uint8_t const * | ptr_ |
Friends | |
template<class TPredicate2 , class TAllocator2T > | |
class | DynImage |
Type-erased image with shared ownership, and read-only access to pixels. Type is nullable.
|
default |
Empty image.
|
inline |
|
inline |
Create type-erased image from MutImage. By design not "explicit".
|
inline |
Create type-erased image from MutImage. By design not "explicit".
|
inlineprotected |
|
inlinestatic |
|
inlinestatic |
|
inlinenoexcept |
Return true is this contains data of type TPixel.
|
inlinenoexcept |
Returns typed image.
Precondition: this->has<TPixel>()
|
inlinenoexcept |
|
inlinestatic |
|
inlinestatic |
Tries to create image from provided size and format. Returns error if format does not satisfy TPredicate.
|
inlinestatic |
Tries to create image from provided size and format. Returns error if format does not satisfy TPredicate.
|
inline |
|
friend |
|
protected |