Image format.
More...
#include <Format.h>
|
const char * | toString () const noexcept |
| Returns a string representation of a Format type.
|
|
int | getChannelCount () const noexcept |
| Get color channel count.
|
|
int | getChannelStep () const noexcept |
| Get channel step.
|
|
int | getChannelSize () const noexcept |
| Get color channel size in bits.
|
|
int | getBitDepth () const noexcept |
| Get number of bits per pixel.
|
|
int | getByteDepth () const noexcept |
| Get number of bytes per pixel.
|
|
int | computePitch (int rowWidth) const noexcept |
| Compute row size in bytes.
|
|
bool | isPadded () const noexcept |
|
bool | isBGR () const noexcept |
|
bool | isYUV () const noexcept |
|
bool | isBlock () const noexcept |
|
bool | isValid () const noexcept |
|
| Format () noexcept |
| Initializes format structure.
|
|
| Format (Type type) noexcept |
| Initializes format structure.
|
|
| operator Type () const noexcept |
| Implicit cast to Type.
|
|
|
static Format | fromString (const char *str) noexcept |
| Creates a Format object by parsing a string representation.
|
|
◆ Type
Format type enumeration.
Enumerator |
---|
Unknown | unknown format.
3 channel, 8 bit per channel, B-G-R color order format with 8 bit padding before next pixel;
|
B8G8R8X8 | 3 channel, 8 bit per channel, R-G-B color order format with 8 bit padding before next pixel;
|
R8G8B8X8 | 3 channel, 8 bit per channel, B-G-R color order format;
|
B8G8R8 | 3 channel, 8 bit per channel, R-G-B color order format;
|
R8G8B8 | 1 channel, 8 bit per channel format;
|
R8 | 1 channel, 16 bit per channel format;
|
R16 | 3 channel, 8 bit per channel format with InfraRed semantics;
|
IR_X8X8X8 | 4:2:0 planar format with a plane of 8-bit Y samples followed by interleaved 2x2 subsampled V/U 8-bit chroma samples(YYYYYYYYVUVU);
|
YUV_NV21 | 4:2:0 planar format with a plane of 8-bit Y samples followed by interleaved 2x2 subsampled U/V 8-bit chroma samples(YYYYYYYYUVUV).
|
◆ Format() [1/2]
Initializes format structure.
Sets format type to Unknown.
◆ Format() [2/2]
fsdk::Format::Format |
( |
Type | type | ) |
|
|
inlinenoexcept |
Initializes format structure.
- Parameters
-
[in] | type | type value to set. |
◆ computePitch()
int fsdk::Format::computePitch |
( |
int | rowWidth | ) |
const |
|
inlinenoexcept |
Compute row size in bytes.
- Parameters
-
[in] | rowWidth | row width in pixels. |
- Returns
- row size in bytes.
◆ fromString()
static Format fsdk::Format::fromString |
( |
const char * | str | ) |
|
|
inlinestaticnoexcept |
Creates a Format object by parsing a string representation.
- Parameters
-
str | The string representation of a format. |
- Returns
- A Format object representing the parsed format, or an object with type Unknown if the string is not recognized.
◆ getBitDepth()
int fsdk::Format::getBitDepth |
( |
| ) |
const |
|
inlinenoexcept |
Get number of bits per pixel.
- Returns
- number of bits per pixel.
◆ getByteDepth()
int fsdk::Format::getByteDepth |
( |
| ) |
const |
|
inlinenoexcept |
Get number of bytes per pixel.
- Returns
- number of bytes per pixel.
◆ getChannelCount()
int fsdk::Format::getChannelCount |
( |
| ) |
const |
|
inlinenoexcept |
Get color channel count.
- Returns
- color channel count.
- Note
- returns actual color channel count for padded formats; i.e. padding is not a channel.
◆ getChannelSize()
int fsdk::Format::getChannelSize |
( |
| ) |
const |
|
inlinenoexcept |
Get color channel size in bits.
- Returns
- color channel size in bits.
◆ getChannelStep()
int fsdk::Format::getChannelStep |
( |
| ) |
const |
|
inlinenoexcept |
Get channel step.
- Returns
- channel step.
- Note
- padding bytes are considered spare channels.
◆ isBGR()
bool fsdk::Format::isBGR |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- true if image format has 3 channels in B-G-R order, false otherwise.
- Note
- padding is ignored for padded channels.
◆ isBlock()
bool fsdk::Format::isBlock |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- true if image format is one of block types, i.e. B8G8R8X8_BLOCK.
- Note
- this currently is a stub.
◆ isPadded()
bool fsdk::Format::isPadded |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- true if image format has padding bytes.
◆ isValid()
bool fsdk::Format::isValid |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- true if image format is one of valid types, i.e. not Unknown.
◆ isYUV()
bool fsdk::Format::isYUV |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- true if image format is in YUV color encoding system.
◆ toString()
const char * fsdk::Format::toString |
( |
| ) |
const |
|
inlinenoexcept |
Returns a string representation of a Format type.
- Returns
- string for a Format type.
The documentation for this struct was generated from the following file: