IDS peak genericC++ v1.17.0
Loading...
Searching...
No Matches
peak_image_view.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
10
15
16#include <memory>
17
21namespace peak
22{
23namespace core
24{
25class Buffer;
26class BufferPart;
27
28namespace detail
29{
39} // namespace detail
40
50{
56
65};
66
67
83{
84public:
96 explicit ImageView(const std::shared_ptr<Buffer>& buffer);
97
110 ImageView(const std::shared_ptr<Buffer>& buffer, MetadataExtractionMode mode);
111
123 explicit ImageView(const std::shared_ptr<BufferPart>& part);
124
137 ImageView(const std::shared_ptr<BufferPart>& part, MetadataExtractionMode mode);
138
145 PEAK_COMMON_NO_DISCARD const uint8_t* GetData() const override;
146
153 PEAK_COMMON_NO_DISCARD uint8_t* GetData() override;
154
161 PEAK_COMMON_NO_DISCARD std::size_t GetLineStartOffset() const override;
162
169 PEAK_COMMON_NO_DISCARD std::size_t GetSizeInBytes() const override;
170
177
184
191
197 PEAK_COMMON_NO_DISCARD uint32_t GetWidth() const override;
198
204 PEAK_COMMON_NO_DISCARD uint32_t GetHeight() const override;
205
211 PEAK_COMMON_NO_DISCARD size_t GetBitsPerPixel() const override;
212
218 PEAK_COMMON_NO_DISCARD size_t GetBytesPerLine() const override;
219
225 PEAK_COMMON_NO_DISCARD std::shared_ptr<peak::common::Metadata> GetMetadata() override;
226
232 PEAK_COMMON_NO_DISCARD std::shared_ptr<const peak::common::Metadata> GetMetadata() const override;
233
246 PEAK_COMMON_NO_DISCARD std::shared_ptr<peak::core::Buffer> GetParentBuffer() const;
247
248private:
249 explicit ImageView(const detail::ExtractedPayload& payload, std::shared_ptr<peak::common::Metadata> metadata);
250 std::shared_ptr<peak::common::Metadata> m_metadata;
251 std::weak_ptr<peak::core::Buffer> m_parentBuffer;
252 const detail::ExtractedPayload m_payload;
253};
254
255} // namespace core
256} // namespace peak
Interface for viewing image pixel data from arbitrary sources.
Definition peak_common_iimageview.hpp:37
Provides information and utility functions for pixel formats.
Definition peak_common_pixel_format.hpp:234
Represents a GenTL buffer module.
Definition peak_buffer.hpp:85
Represents a buffer part.
Definition peak_buffer_part.hpp:58
PEAK_COMMON_NO_DISCARD uint32_t GetHeight() const override
Height of the image in pixels.
Definition peak_image_view_impl.hpp:405
PEAK_COMMON_NO_DISCARD std::size_t GetSizeInBytes() const override
Returns the number of bytes in a single image row.
Definition peak_image_view_impl.hpp:380
PEAK_COMMON_NO_DISCARD std::size_t GetLineStartOffset() const override
Returns the byte offset to the first pixel of a line.
Definition peak_image_view_impl.hpp:375
PEAK_COMMON_NO_DISCARD size_t GetBytesPerLine() const override
The amount of bytes per line.
Definition peak_image_view_impl.hpp:415
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:390
PEAK_COMMON_NO_DISCARD size_t GetBitsPerPixel() const override
The amount of bits in one pixel.
Definition peak_image_view_impl.hpp:410
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:430
PEAK_COMMON_NO_DISCARD uint32_t GetWidth() const override
Width of the image in pixels.
Definition peak_image_view_impl.hpp:400
PEAK_COMMON_NO_DISCARD const uint8_t * GetData() const override
Returns a pointer to the start of the first line that contains valid image data (read-only).
Definition peak_image_view_impl.hpp:365
ImageView(const std::shared_ptr< Buffer > &buffer)
Construct an ImageView from a Buffer.
Definition peak_image_view_impl.hpp:338
PEAK_COMMON_NO_DISCARD peak::common::PixelFormat GetPixelFormat() const override
PixelFormat of the contained image.
Definition peak_image_view_impl.hpp:385
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:395
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:420
detail::SizeT< uint32_t > Size
Size with unsigned 32-bit integer dimensions.
Definition peak_common_size.hpp:268
PixelFormat
Enum listing all supported pixel formats and their internal IDs.
Definition peak_common_pixel_format.hpp:59
Definition peak_image_view.hpp:29
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:32
MetadataExtractionMode
Controls how metadata is extracted when constructing an ImageView.
Definition peak_image_view.hpp:50
@ Minimal
Definition peak_image_view.hpp:55
@ Extended
Definition peak_image_view.hpp:64
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_buffer.hpp:29
#define PEAK_COMMON_NO_DISCARD
Definition peak_common_defines.h:89
Enum holding the possible pixel format names.
Definition peak_image_view.hpp:31
size_t bytesPerLine
Definition peak_image_view.hpp:36
size_t lineStartOffset
Definition peak_image_view.hpp:37
size_t dataSize
Definition peak_image_view.hpp:35
peak::common::PixelFormat pixelFormat
Definition peak_image_view.hpp:33
peak::common::Size size
Definition peak_image_view.hpp:32
void * dataPtr
Definition peak_image_view.hpp:34