Go to the documentation of this file.
23 template <
class TPredicate,
class TAllocator>
30 template <
class TPixel,
class TAllocator = Eigen::aligned_allocator<u
int8_t>>
40 if (!image.isEmpty()) {
41 this->shared_ = std::move(image.unique_);
42 this->
ptr_ =
reinterpret_cast<TPixel*
>(this->shared_.get());
43 image.setViewToEmpty();
58 template <
class TUVOperation>
62 mut_image.generate(uv_op);
69 template <
class TOtherPixel,
class TUnaryOperation>
78 template <
class TLhsPixel,
class TRhsPixel,
class TBinaryOperation>
82 TBinaryOperation
const& binary_op) ->
Image {
86 [[nodiscard]]
auto useCount() const ->
size_t {
return shared_.use_count(); }
99 template <
class TT,
class TAllocator2T>
102 template <
class TPredicate,
class TAllocator2T>
108 :
ImageView<TPixel>(view), shared_(shared) {}
110 std::shared_ptr<uint8_t> shared_;
void setViewToEmpty()
Resets view such that it is empty.
Definition: image_view.h:239
Image read-only access to pixels and shared ownership, hence cheap to copy. Type is nullable.
Definition: image.h:31
Image MutImage, owning images types.
Definition: num_diff.h:20
static auto makeFromTransform(ImageView< TLhsPixel > lhs, ImageView< TRhsPixel > rhs, TBinaryOperation const &binary_op) -> Image
Creates new Image given two views and binary transform function.
Definition: image.h:79
A view of an (immutable) image, which does not own the data.
Definition: image_view.h:55
Image()=default
Constructs empty image.
static auto makeFromTransform(ImageView< TOtherPixel > view, TUnaryOperation const &unary_op) -> MutImage
Creates new MutImage given view and unary transform function.
Definition: mut_image.h:135
static auto makeFromTransform(ImageView< TOtherPixel > view, TUnaryOperation const &unary_op) -> Image
Creates new Image given view and unary transform function.
Definition: image.h:70
A image with write access to pixels and exclusive ownership. There is no copy constr / copy assignmen...
Definition: image_view.h:32
Image(MutImage< TPixel, TAllocator > &&image) noexcept
Moves MutImage into this. By design not "explicit".
Definition: image.h:38
auto useCount() const -> size_t
Definition: image.h:86
static auto makeCopyFrom(ImageView< TPixel > const &view) -> Image
Creates contiguous copy from view.
Definition: image.h:50
Type-erased image with shared ownership, and read-only access to pixels. Type is nullable.
Definition: dyn_image.h:24
void reset()
Sets Image instance to empty. Reduced use count by one.
Definition: image.h:93
TPixel const * ptr_
Definition: image_view.h:242
Image size, hence its width and height.
Definition: image_size.h:21
static auto makeGenerative(ImageSize size, TUVOperation const &uv_op) -> Image
Allocated and generates image from provided function taking u,v indices.
Definition: image.h:59