Go to the documentation of this file.
18 template <
class TAllocator = Eigen::aligned_allocator<u
int8_t>>
22 static_assert(concepts::DynImageView<AnyImageView>);
24 template <
class TAllocator = Eigen::aligned_allocator<u
int8_t>>
28 static_assert(concepts::DynImageView<MutAnyImageView>);
44 template <
class TPixel>
46 return has_type_v<TPixel, PixelVariant>;
50 bool num_components_constraint =
51 (format.num_components == 1 || format.num_components == 2 ||
52 format.num_components == 3 || format.num_components == 4);
53 bool u8_constraint = format.number_type == NumberType::fixed_point &&
54 format.num_bytes_per_component == 1;
55 bool u16_constraint = format.number_type == NumberType::fixed_point &&
56 format.num_bytes_per_component == 2;
57 bool f32_constraint = format.number_type == NumberType::floating_point &&
58 format.num_bytes_per_component == 4;
59 return num_components_constraint &&
60 (u8_constraint || u16_constraint || f32_constraint);
67 template <
class TAllocator = Eigen::aligned_allocator<u
int8_t>>
70 template <
class TAllocator = Eigen::aligned_allocator<u
int8_t>>
77 template <
class TUserFunc,
typename TDynImage,
typename... TTpixelFormats>
81 template <
class TUserFunc,
typename TDynImage,
typename TPixelFormat>
82 struct VisitImpl<TUserFunc, TDynImage, std::variant<TPixelFormat>> {
83 static void visit(TUserFunc&&
func, TDynImage
const& image) {
84 if (image.pixelFormat().template is<TPixelFormat>()) {
85 func(image.template imageView<TPixelFormat>());
94 typename TPixelFormat,
96 struct VisitImpl<TUserFunc, TDynImage, std::variant<TPixelFormat, TRest...>> {
97 static void visit(TUserFunc&&
func, TDynImage
const& image) {
98 if (image.pixelFormat().template is<TPixelFormat>()) {
99 func(image.template imageView<TPixelFormat>());
101 VisitImpl<TUserFunc, TDynImage, std::variant<TRest...>>::visit(
102 std::forward<TUserFunc>(
func), image);
111 class TPredicate = IntensityImagePredicate,
112 class TAllocator = Eigen::aligned_allocator<uint8_t>>
117 visit(std::forward<TUserFunc>(
func), image);
122 template <
class TUserFunc,
class TPredicate = IntensityImagePredicate>
126 VisitImpl<TUserFunc, DynImageView, typename TPredicate::PixelVariant>::
127 visit(std::forward<TUserFunc>(
func), image);
Definition: mut_dyn_image.h:23
Pixel2< uint16_t > Pixel2U16
Definition: image_types.h:20
Image MutImage, owning images types.
Definition: num_diff.h:20
std::variant< uint8_t, uint16_t, float, Pixel2U8, Pixel2U16, Pixel2F32, Pixel3U8, Pixel3U16, Pixel3F32, Pixel4U8, Pixel4U16, Pixel4F32 > PixelVariant
Definition: dyn_image_types.h:43
Definition: dyn_image_types.h:30
Pixel3< uint8_t > Pixel3U8
Definition: image_types.h:25
Pixel3< float > Pixel3F32
Definition: image_types.h:27
static constexpr auto isTypeValid() -> bool
Definition: dyn_image_types.h:45
static void visit(TUserFunc &&func, TDynImage const &image)
Definition: dyn_image_types.h:97
Pixel4< float > Pixel4F32
Definition: image_types.h:33
static constexpr auto isFormatValid(PixelFormat format) -> bool
Definition: dyn_image_types.h:49
Pixel2< float > Pixel2F32
Definition: image_types.h:21
concept DynImageView
Definition: image.h:52
Type-erased image with shared ownership, and read-only access to pixels. Type is nullable.
Definition: dyn_image.h:24
Pixel2< uint8_t > Pixel2U8
Definition: image_types.h:19
Pixel3< uint16_t > Pixel3U16
Definition: image_types.h:26
Pixel4< uint8_t > Pixel4U8
Definition: image_types.h:31
func
Definition: event_service_recorder.py:420
Pixel4< uint16_t > Pixel4U16
Definition: image_types.h:32
Definition: dyn_image_types.h:78
void visitImage(TUserFunc &&func, DynImage< TPredicate, TAllocator > const &image)
Definition: dyn_image_types.h:113