IDS peak genericC++ v1.13.0
Loading...
Searching...
No Matches
peak_image_view.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
17
18#include <memory>
19
23namespace peak
24{
25namespace core
26{
27class Buffer;
28class BufferPart;
29
30namespace detail
31{
39} // namespace detail
40
55{
56public:
63 explicit ImageView(const std::shared_ptr<Buffer>& buffer);
64
71 explicit ImageView(const std::shared_ptr<BufferPart>& part);
72
79 PEAK_COMMON_NO_DISCARD const uint8_t* GetData() const override;
80
87 PEAK_COMMON_NO_DISCARD uint8_t* GetData() override;
88
95 PEAK_COMMON_NO_DISCARD std::size_t GetSizeInBytes() const override;
96
103
110
117
123 PEAK_COMMON_NO_DISCARD uint32_t GetWidth() const override;
124
130 PEAK_COMMON_NO_DISCARD uint32_t GetHeight() const override;
131
137 PEAK_COMMON_NO_DISCARD size_t GetBitsPerPixel() const override;
138
144 PEAK_COMMON_NO_DISCARD size_t GetBytesPerLine() const override;
145
151 PEAK_COMMON_NO_DISCARD std::shared_ptr<peak::common::Metadata> GetMetadata() override;
152
158 PEAK_COMMON_NO_DISCARD std::shared_ptr<const peak::common::Metadata> GetMetadata() const override;
159
172 PEAK_COMMON_NO_DISCARD std::shared_ptr<peak::core::Buffer> GetParentBuffer() const;
173
174private:
175 explicit ImageView(const detail::ExtractedPayload& payload, std::shared_ptr<peak::common::Metadata> metadata);
176 std::shared_ptr<peak::common::Metadata> m_metadata;
177 std::weak_ptr<peak::core::Buffer> m_parentBuffer;
178 const detail::ExtractedPayload m_payload;
179};
180
181} // namespace core
182} // namespace peak
Interface for viewing image pixel data from arbitrary sources.
Definition peak_common_iimageview.hpp:42
Provides information and utility functions for pixel formats.
Definition peak_common_pixel_format.hpp:140
Represents a GenTL buffer module.
Definition peak_buffer.hpp:87
Represents a buffer part.
Definition peak_buffer_part.hpp:60
PEAK_COMMON_NO_DISCARD uint32_t GetHeight() const override
Height of the image in pixels.
Definition peak_image_view_impl.hpp:267
PEAK_COMMON_NO_DISCARD std::size_t GetSizeInBytes() const override
Size of the image in bytes.
Definition peak_image_view_impl.hpp:242
PEAK_COMMON_NO_DISCARD size_t GetBytesPerLine() const override
The amount of bytes per line.
Definition peak_image_view_impl.hpp:277
PEAK_COMMON_NO_DISCARD peak::common::PixelFormatInfo GetPixelFormatInfo() const override
Information object for the PixelFormat of the contained image.
Definition peak_image_view_impl.hpp:252
PEAK_COMMON_NO_DISCARD size_t GetBitsPerPixel() const override
The amount of bits in one pixel.
Definition peak_image_view_impl.hpp:272
PEAK_COMMON_NO_DISCARD std::shared_ptr< peak::core::Buffer > GetParentBuffer() const
The parent buffer object, the image view was created from.
Definition peak_image_view_impl.hpp:294
PEAK_COMMON_NO_DISCARD uint32_t GetWidth() const override
Width of the image in pixels.
Definition peak_image_view_impl.hpp:262
PEAK_COMMON_NO_DISCARD const uint8_t * GetData() const override
Get pointer to the first byte of the image (read-only).
Definition peak_image_view_impl.hpp:232
ImageView(const std::shared_ptr< Buffer > &buffer)
Construct an ImageView from a Buffer.
Definition peak_image_view_impl.hpp:220
PEAK_COMMON_NO_DISCARD peak::common::PixelFormat GetPixelFormat() const override
PixelFormat of the contained image.
Definition peak_image_view_impl.hpp:247
PEAK_COMMON_NO_DISCARD peak::common::Size GetSize() const override
Get the dimensions of the image. I.e. Width, Height, etc.
Definition peak_image_view_impl.hpp:257
PEAK_COMMON_NO_DISCARD std::shared_ptr< peak::common::Metadata > GetMetadata() override
The metadata object belonging to the image.
Definition peak_image_view_impl.hpp:284
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.h:86
detail::SizeT< uint32_t > Size
Size with unsigned 32-bit integer dimensions.
Definition peak_common_size.hpp:273
PixelFormat
Enum listing all supported pixel formats and their internal IDs.
Definition peak_common_pixel_format.hpp:44
Definition peak_image_view.hpp:31
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:34
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:33
Enum holding the possible pixel format names.
Definition peak_image_view.hpp:33
size_t dataSize
Definition peak_image_view.hpp:37
peak::common::PixelFormat pixelFormat
Definition peak_image_view.hpp:35
peak::common::Size size
Definition peak_image_view.hpp:34
void * dataPtr
Definition peak_image_view.hpp:36