IDS peak genericC++ v1.17.0
Loading...
Searching...
No Matches
peak::core::ImageView Class Reference

Implementation of the peak::common::IImageView interface for viewing image pixel data from arbitrary sources. More...

#include <peak/image_view/peak_image_view.hpp>

Inheritance diagram for peak::core::ImageView:
peak::common::IImageView

Public Member Functions

 ImageView (const std::shared_ptr< Buffer > &buffer)
 Construct an ImageView from a Buffer.
 ImageView (const std::shared_ptr< Buffer > &buffer, MetadataExtractionMode mode)
 Construct an ImageView from a Buffer and controls how metadata is extracted via the specified update mode.
 ImageView (const std::shared_ptr< BufferPart > &part)
 Construct an ImageView from a BufferPart.
 ImageView (const std::shared_ptr< BufferPart > &part, MetadataExtractionMode mode)
 Construct an ImageView from a BufferPart and controls how metadata is extracted via the specified update mode.
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).
PEAK_COMMON_NO_DISCARD uint8_t * GetData () override
 Returns a pointer to the start of the first line that contains valid image data (read-write).
PEAK_COMMON_NO_DISCARD std::size_t GetLineStartOffset () const override
 Returns the byte offset to the first pixel of a line.
PEAK_COMMON_NO_DISCARD std::size_t GetSizeInBytes () const override
 Returns the number of bytes in a single image row.
PEAK_COMMON_NO_DISCARD peak::common::PixelFormat GetPixelFormat () const override
 PixelFormat of the contained image.
PEAK_COMMON_NO_DISCARD peak::common::PixelFormatInfo GetPixelFormatInfo () const override
 Information object for the PixelFormat of the contained image.
PEAK_COMMON_NO_DISCARD peak::common::Size GetSize () const override
 Get the dimensions of the image. I.e. Width, Height, etc.
PEAK_COMMON_NO_DISCARD uint32_t GetWidth () const override
 Width of the image in pixels.
PEAK_COMMON_NO_DISCARD uint32_t GetHeight () const override
 Height of the image in pixels.
PEAK_COMMON_NO_DISCARD size_t GetBitsPerPixel () const override
 The amount of bits in one pixel.
PEAK_COMMON_NO_DISCARD size_t GetBytesPerLine () const override
 The amount of bytes per line.
PEAK_COMMON_NO_DISCARD std::shared_ptr< peak::common::Metadata > GetMetadata () override
 The metadata object belonging to the image.
PEAK_COMMON_NO_DISCARD std::shared_ptr< const peak::common::Metadata > GetMetadata () const override
 The metadata object belonging to the image.
PEAK_COMMON_NO_DISCARD std::shared_ptr< peak::core::Buffer > GetParentBuffer () const
 The parent buffer object, the image view was created from.
Public Member Functions inherited from peak::common::IImageView
virtual ~IImageView ()=default

Detailed Description

Implementation of the peak::common::IImageView interface for viewing image pixel data from arbitrary sources.

This interface defines a standard way to access image properties and raw pixel data, enabling interoperability with different image processing libraries or backends.

Note
This object does not own the image memory. Lifetime management must be handled externally.
Since
1.12

Constructor & Destructor Documentation

◆ ImageView() [1/4]

peak::core::ImageView::ImageView ( const std::shared_ptr< Buffer > & buffer)
inlineexplicit

Construct an ImageView from a Buffer.

Metadata is extracted using MetadataExtractionMode::Minimal.

Parameters
bufferShared pointer to the source Buffer containing image data.
Note
The Buffer must remain valid and must not be queued for the lifetime of the ImageView.
Since
1.12

◆ ImageView() [2/4]

peak::core::ImageView::ImageView ( const std::shared_ptr< Buffer > & buffer,
MetadataExtractionMode mode )
inline

Construct an ImageView from a Buffer and controls how metadata is extracted via the specified update mode.

Parameters
bufferShared pointer to the source Buffer containing image data.
modeThe metadata extraction mode controlling how much metadata is parsed. See MetadataExtractionMode for details.
Note
The Buffer must remain valid and must not be queued for the lifetime of the ImageView.
Since
1.15

◆ ImageView() [3/4]

peak::core::ImageView::ImageView ( const std::shared_ptr< BufferPart > & part)
inlineexplicit

Construct an ImageView from a BufferPart.

Metadata is extracted using MetadataExtractionMode::Minimal.

Parameters
partShared pointer to the source BufferPart containing image data.
Note
The Buffer must remain valid and must not be queued for the lifetime of the ImageView.
Since
1.12

◆ ImageView() [4/4]

peak::core::ImageView::ImageView ( const std::shared_ptr< BufferPart > & part,
MetadataExtractionMode mode )
inline

Construct an ImageView from a BufferPart and controls how metadata is extracted via the specified update mode.

Parameters
partShared pointer to the source BufferPart containing image data.
modeThe metadata extraction mode controlling how much metadata is parsed. See MetadataExtractionMode for details.
Note
The parent Buffer must remain valid and must not be queued for the lifetime of the ImageView.
Since
1.15

Member Function Documentation

◆ GetBitsPerPixel()

size_t peak::core::ImageView::GetBitsPerPixel ( ) const
inlineoverridevirtual

The amount of bits in one pixel.

Since
1.12

Implements peak::common::IImageView.

◆ GetBytesPerLine()

size_t peak::core::ImageView::GetBytesPerLine ( ) const
inlineoverridevirtual

The amount of bytes per line.

Since
1.12

Implements peak::common::IImageView.

◆ GetData() [1/2]

const uint8_t * peak::core::ImageView::GetData ( ) const
inlineoverridevirtual

Returns a pointer to the start of the first line that contains valid image data (read-only).

Returns
Pointer to data.
Since
1.12

Implements peak::common::IImageView.

◆ GetData() [2/2]

uint8_t * peak::core::ImageView::GetData ( )
inlineoverridevirtual

Returns a pointer to the start of the first line that contains valid image data (read-write).

Returns
Pointer to data.
Since
1.12

Implements peak::common::IImageView.

◆ GetHeight()

uint32_t peak::core::ImageView::GetHeight ( ) const
inlineoverridevirtual

Height of the image in pixels.

Since
1.12

Implements peak::common::IImageView.

◆ GetLineStartOffset()

std::size_t peak::core::ImageView::GetLineStartOffset ( ) const
inlineoverridevirtual

Returns the byte offset to the first pixel of a line.

Returns
Line offset in Bytes.
Since
1.14

Implements peak::common::IImageView.

◆ GetMetadata() [1/2]

std::shared_ptr< const peak::common::Metadata > peak::core::ImageView::GetMetadata ( ) const
inlineoverridevirtual

The metadata object belonging to the image.

Since
1.12

Implements peak::common::IImageView.

◆ GetMetadata() [2/2]

std::shared_ptr< peak::common::Metadata > peak::core::ImageView::GetMetadata ( )
inlineoverridevirtual

The metadata object belonging to the image.

Since
1.12

Implements peak::common::IImageView.

◆ GetParentBuffer()

std::shared_ptr< peak::core::Buffer > peak::core::ImageView::GetParentBuffer ( ) const
inline

The parent buffer object, the image view was created from.

If the image was created from a buffer part, the parent buffer is the same as returned by BufferPart::ParentBuffer.

Returns
Parent buffer
Exceptions
InternalErrorExceptionAn internal error has occurred.
Since
1.13

◆ GetPixelFormat()

peak::common::PixelFormat peak::core::ImageView::GetPixelFormat ( ) const
inlineoverridevirtual

PixelFormat of the contained image.

Since
1.12

Implements peak::common::IImageView.

◆ GetPixelFormatInfo()

peak::common::PixelFormatInfo peak::core::ImageView::GetPixelFormatInfo ( ) const
inlineoverridevirtual

Information object for the PixelFormat of the contained image.

Since
1.12

Implements peak::common::IImageView.

◆ GetSize()

peak::common::Size peak::core::ImageView::GetSize ( ) const
inlineoverridevirtual

Get the dimensions of the image. I.e. Width, Height, etc.

Since
1.12

Implements peak::common::IImageView.

◆ GetSizeInBytes()

std::size_t peak::core::ImageView::GetSizeInBytes ( ) const
inlineoverridevirtual

Returns the number of bytes in a single image row.

Returns
Bytes per line, including any padding.
Since
1.12

Implements peak::common::IImageView.

◆ GetWidth()

uint32_t peak::core::ImageView::GetWidth ( ) const
inlineoverridevirtual

Width of the image in pixels.

Since
1.12

Implements peak::common::IImageView.


The documentation for this class was generated from the following files: