include/PixelFormat.h

include/PixelFormat.h

Namespaces

Name
ACL

Types

Name
enum uint32_tPixelFormat { kUnknown = 0, kNv12 = ACL::makeFourCC(‘N’, ‘V’, ‘1’, ‘2’), kUyvy = ACL::makeFourCC(‘U’, ‘Y’, ‘V’, ‘Y’), kP010 = ACL::makeFourCC(‘P’, ‘0’, ‘1’, ‘0’), kP016 = ACL::makeFourCC(‘P’, ‘0’, ‘1’, ‘6’), kP210 = ACL::makeFourCC(‘P’, ‘2’, ‘1’, ‘0’), kP216 = ACL::makeFourCC(‘P’, ‘2’, ‘1’, ‘6’), kRgba =
ACL::makeFourCC(‘R’, ‘G’, ‘B’, ‘A’), kV210 = ACL::makeFourCC(‘V’, ‘2’, ‘1’, ‘0’), kRgba64Le =
ACL::makeFourCC(‘R’, ‘G’, ‘B’, 64)}
Enumeration of FourCC formats.

Functions

Name
std::ostream &operator«(std::ostream & stream, PixelFormat pixelFormat)
Add the string representation of a PixelFormat to the output stream.

Types Documentation

enum PixelFormat

EnumeratorValueDescription
kUnknown0
kNv12ACL::makeFourCC(‘N’, ‘V’, ‘1’, ‘2’)
kUyvyACL::makeFourCC(‘U’, ‘Y’, ‘V’, ‘Y’)
kP010ACL::makeFourCC(‘P’, ‘0’, ‘1’, ‘0’)
kP016ACL::makeFourCC(‘P’, ‘0’, ‘1’, ‘6’)
kP210ACL::makeFourCC(‘P’, ‘2’, ‘1’, ‘0’)
kP216ACL::makeFourCC(‘P’, ‘2’, ‘1’, ‘6’)
kRgba=
ACL::makeFourCC(‘R’, ‘G’, ‘B’, ‘A’)
kV210ACL::makeFourCC(‘V’, ‘2’, ‘1’, ‘0’)
kRgba64Le=
ACL::makeFourCC(‘R’, ‘G’, ‘B’, 64)

Enumeration of FourCC formats.

Functions Documentation

function operator«

std::ostream & operator<<(
    std::ostream & stream,
    PixelFormat pixelFormat
)

Add the string representation of a PixelFormat to the output stream.

Parameters:

  • pixelFormat The PixelFormat to get as a string

Return: The ostream with the string representation of the PixelFormat appended

Source code

// Copyright (c) 2023, Edgeware AB. All rights reserved.

#pragma once

#include <cstdint>
#include <ostream>

namespace ACL {

constexpr uint32_t makeFourCC(char a, char b, char c, char d) {
    return static_cast<uint32_t>(a) + (static_cast<uint32_t>(b) << 8) + (static_cast<uint32_t>(c) << 16) +
           (static_cast<uint32_t>(d) << 24);
}

} // namespace ACL

enum PixelFormat : uint32_t {
    kUnknown = 0,                                // Unknown format
    kNv12 = ACL::makeFourCC('N', 'V', '1', '2'), // 4:2:0 format with Y plane followed by UVUVUV.. plane
    kUyvy = ACL::makeFourCC('U', 'Y', 'V', 'Y'), // 4:2:2 format with packed UYVY macropixels
    kP010 = ACL::makeFourCC('P', '0', '1', '0'), // 4:2:0 P016 with data in the 10 MSB
    kP016 = ACL::makeFourCC('P', '0', '1', '6'), // 4:2:0 format with 16 bit words, Y plane followed by UVUVUV.. plane
    kP210 = ACL::makeFourCC('P', '2', '1', '0'), // 4:2:2 P216 with data in the 10 MSB
    kP216 = ACL::makeFourCC('P', '2', '1', '6'), // 4:2:2 format with 16 bit words, Y plane followed by UVUVUV.. plane
    kRgba =
        ACL::makeFourCC('R', 'G', 'B', 'A'), // 4:4:4:4 RGB format, 8 bit per channel, ordered RGBARGBARG.. in memory
    kV210 = ACL::makeFourCC('V', '2', '1', '0'), // 4:2:2 packed format with 10 bit per component
    kRgba64Le =
        ACL::makeFourCC('R', 'G', 'B', 64) // 16 bit per component, ordered as RGBA in memory with little endian words.
};

std::ostream& operator<<(std::ostream& stream, PixelFormat pixelFormat);

Updated on 2024-01-25 at 12:02:05 +0100