Imaging Control 4 C++ Library  1.3.0
ImageType Struct Reference

Represents an image type, including pixel format and image dimensions. More...

Public Member Functions

 ImageType () noexcept
 Constructs an invalid image type.
 
 ImageType (PixelFormat pixel_format) noexcept
 Constructs an image type, specifying only a pixel format. More...
 
 ImageType (PixelFormat pixel_format, uint32_t width, uint32_t height) noexcept
 Constructs an image type, specifying pixel format, width and height. More...
 
PixelFormat pixel_format () const noexcept
 Returns the pixel format of this image type. More...
 
uint32_t width () const noexcept
 Returns the width of this image type. More...
 
uint32_t height () const noexcept
 Returns the height of this image type. More...
 
bool operator== (const ImageType &op2) const noexcept
 Checks whether two image types are equal. More...
 
bool operator!= (const ImageType &op2) const noexcept
 Checks whether two image types are not equal. More...
 
ImageType with_pixel_format (PixelFormat new_format) const noexcept
 Creates a new image type based on this with a modified pixel format. More...
 
ImageType with_size (uint32_t new_width, uint32_t new_height) const noexcept
 Creates a new image type based on this with modified dimensions. More...
 

Detailed Description

Represents an image type, including pixel format and image dimensions.

Using a partially-specified image type is allowed when defining the buffer format of a sink. The sink will fill the other fields with data from the device automatically.

Constructor & Destructor Documentation

◆ ImageType() [1/2]

ImageType ( PixelFormat  pixel_format)
inlinenoexcept

Constructs an image type, specifying only a pixel format.

Width and height remain unspecified.

Parameters
[in]pixel_formatThe pixel format of the image

◆ ImageType() [2/2]

ImageType ( PixelFormat  pixel_format,
uint32_t  width,
uint32_t  height 
)
inlinenoexcept

Constructs an image type, specifying pixel format, width and height.

Parameters
[in]pixel_formatThe pixel format of the image
[in]widthThe width of the image in pixels
[in]heightThe height of the image in pixels

Member Function Documentation

◆ height()

uint32_t height ( ) const
inlinenoexcept

Returns the height of this image type.

Returns
The height of this image type, or 0 if the height is not specified.

◆ operator!=()

bool operator!= ( const ImageType op2) const
inlinenoexcept

Checks whether two image types are not equal.

Parameters
op2Other image type
Returns
true if this image type is different from op2, otherwise false.

◆ operator==()

bool operator== ( const ImageType op2) const
inlinenoexcept

Checks whether two image types are equal.

Parameters
op2Other image type
Returns
true if this image type is equal to op2, otherwise false.

◆ pixel_format()

PixelFormat pixel_format ( ) const
inlinenoexcept

Returns the pixel format of this image type.

Returns
The pixel format of this image type, or PixelFormat::Unspecified if the pixel format is not specified.

◆ width()

uint32_t width ( ) const
inlinenoexcept

Returns the width of this image type.

Returns
The width of this image type, or 0 if the height is not specified.

◆ with_pixel_format()

ImageType with_pixel_format ( PixelFormat  new_format) const
inlinenoexcept

Creates a new image type based on this with a modified pixel format.

Parameters
new_formatThe pixel format to set in the new image type
Returns
A new image type based on this with pixel format new_format

◆ with_size()

ImageType with_size ( uint32_t  new_width,
uint32_t  new_height 
) const
inlinenoexcept

Creates a new image type based on this with modified dimensions.

Parameters
new_widthThe width to set in the new image type
new_heightThe height to set in the new image type
Returns
A new image type based on this with dimensions new_width x new_height