Tag Parser: TagParser::Size Class Reference

Tag Parser 12.5.2 C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags

Loading...
Searching...
No Matches
Public Member Functions | List of all members
TagParser::Size Class Reference

The Size class defines the size of a two-dimensional object using integer point precision. More...

`#include <size.h>`

## Public Member Functions
constexpr | Size ()
| Constructs a new Size.
constexpr | Size (std::uint32_t width, std::uint32_t height)
| Constructs a new Size of the specified width and height.
constexpr std::uint32_t | width () const
| Returns the width.
constexpr std::uint32_t | height () const
| Returns the height.
void | setWidth (std::uint32_t value)
| Sets the width.
void | setHeight (std::uint32_t value)
| Sets the height.
constexpr std::uint32_t | resolution () const
| Returns the resolution of the current instance (product of with and height).
std::string_view | abbreviation () const
| Returns an abbreviation for the current instance, eg.
bool constexpr | isNull () const
| Returns an indication whether both the width and height is 0.
bool constexpr | operator== (const Size &other) const
| Returns whether this instance equals other.
bool constexpr | operator>= (const Size &other) const
| Returns whether this instance is greater than other.
std::string | toString () const
| Returns the string representation of the current size.

## Detailed Description

The Size class defines the size of a two-dimensional object using integer point precision.

Definition at line 17 of file size.h.

## Constructor & Destructor Documentation

## ◆ Size() [1/2]

TagParser::Size::Size | ( |  | ) |
| constexpr

Constructs a new Size.

Definition at line 42 of file size.h.

## ◆ Size() [2/2]

TagParser::Size::Size | ( | std::uint32_t | width,
|  | std::uint32_t | height )
| constexpr

Constructs a new Size of the specified width and height.

Definition at line 51 of file size.h.

## Member Function Documentation

## ◆ abbreviation()

std::string_view TagParser::Size::abbreviation | ( |  | ) | const

Returns an abbreviation for the current instance, eg.

720p for sizes greater than 960×720 and 1080p for sizes greater than 1440×1080.

Remarks
  The width thresolds are for 4:3 resolutions so both, 4:3 and 16:9 "720p" is considered as such.

Definition at line 17 of file size.cpp.

## ◆ height()

std::uint32_t TagParser::Size::height | ( |  | ) | const
| constexpr

Returns the height.

Definition at line 68 of file size.h.

## ◆ isNull()

bool TagParser::Size::isNull | ( |  | ) | const
| constexpr

Returns an indication whether both the width and height is 0.

Definition at line 100 of file size.h.

## ◆ operator==()

bool TagParser::Size::operator== | ( | const Size & | other | ) | const
| constexpr

Returns whether this instance equals other.

Definition at line 108 of file size.h.

## ◆ operator>=()

bool TagParser::Size::operator>= | ( | const Size & | other | ) | const
| constexpr

Returns whether this instance is greater than other.

Remarks
  Both dimensions must be greater. This operator does not take the resolution() into account.

Definition at line 117 of file size.h.

## ◆ resolution()

std::uint32_t TagParser::Size::resolution | ( |  | ) | const
| constexpr

Returns the resolution of the current instance (product of with and height).

Definition at line 92 of file size.h.

## ◆ setHeight()

void TagParser::Size::setHeight | ( | std::uint32_t | value | ) |
| inline

Sets the height.

Definition at line 84 of file size.h.

## ◆ setWidth()

void TagParser::Size::setWidth | ( | std::uint32_t | value | ) |
| inline

Sets the width.

Definition at line 76 of file size.h.

## ◆ toString()

std::string TagParser::Size::toString | ( |  | ) | const
| inline

Returns the string representation of the current size.

Definition at line 125 of file size.h.

## ◆ width()

std::uint32_t TagParser::Size::width | ( |  | ) | const
| constexpr

Returns the width.

Definition at line 60 of file size.h.

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

- size.h
- size.cpp