avcpp
3.2.1
Wrapper for the FFmpeg that simplify usage from C++ projects.
Toggle main menu visibility
Loading...
Searching...
No Matches
pixelformat.h
Go to the documentation of this file.
1
#pragma once
2
9
10
#include <string>
11
#include <iostream>
12
13
#include "
averror.h
"
14
#include "
ffmpeg.h
"
15
16
extern
"C"
{
17
#include <libavutil/pixfmt.h>
18
#include <libavutil/pixdesc.h>
19
}
20
21
// We need not to be back compatible:
22
#ifdef PixelFormat
23
#undef PixelFormat
24
#endif
25
26
namespace
av
{
27
40
class
PixelFormat
:
public
PixSampleFmtWrapper
<PixelFormat, AVPixelFormat>
41
{
42
public
:
44
using
Parent
=
PixSampleFmtWrapper<PixelFormat, AVPixelFormat>
;
45
using
Parent::Parent;
46
50
PixelFormat
() =
default
;
56
explicit
PixelFormat
(
const
char
*
name
)
noexcept
;
62
explicit
PixelFormat
(
const
std::string&
name
)
noexcept
;
63
64
// Info functions
72
const
char
*
name
(
OptionalErrorCode
ec =
throws
())
const
;
73
82
const
AVPixFmtDescriptor*
descriptor
(
OptionalErrorCode
ec =
throws
())
const
;
83
91
int
bitsPerPixel
(
OptionalErrorCode
ec =
throws
())
const
;
92
100
size_t
planesCount
(
OptionalErrorCode
ec =
throws
())
const
;
101
108
PixelFormat
swapEndianness
() const noexcept;
109
110
// See FF_LOSS_xxx flags
120
size_t
convertionLoss
(
PixelFormat
dstFmt,
bool
srcHasAlpha = false) const noexcept;
121
};
122
123
}
// namespace av
124
averror.h
Error codes, error categories and the OptionalErrorCode convention.
av::OptionalErrorCode
Carries the caller's choice between exceptions and error codes.
Definition
averror.h:96
av::PixelFormat::bitsPerPixel
int bitsPerPixel(OptionalErrorCode ec=throws()) const
Bits needed for one pixel.
av::PixelFormat::Parent
PixSampleFmtWrapper< PixelFormat, AVPixelFormat > Parent
The wrapper this type builds on.
Definition
pixelformat.h:44
av::PixelFormat::name
const char * name(OptionalErrorCode ec=throws()) const
Name of the format.
av::PixelFormat::PixelFormat
PixelFormat(const char *name) noexcept
Look a pixel format up by name.
av::PixelFormat::convertionLoss
size_t convertionLoss(PixelFormat dstFmt, bool srcHasAlpha=false) const noexcept
What a conversion to another format would lose.
av::PixelFormat::descriptor
const AVPixFmtDescriptor * descriptor(OptionalErrorCode ec=throws()) const
FFmpeg description of the format.
av::PixelFormat::swapEndianness
PixelFormat swapEndianness() const noexcept
The same format with the opposite byte order.
av::PixelFormat::PixelFormat
PixelFormat()=default
Create an unset format, equivalent to AV_PIX_FMT_NONE.
av::PixelFormat::PixelFormat
PixelFormat(const std::string &name) noexcept
Look a pixel format up by name.
av::PixelFormat::planesCount
size_t planesCount(OptionalErrorCode ec=throws()) const
Number of image planes.
ffmpeg.h
FFmpeg types re-exported for the public API and small value wrappers.
av
Root namespace of the library.
Definition
audioresampler.h:19
PixSampleFmtWrapper< PixelFormat, AVPixelFormat >::PixSampleFmtWrapper
constexpr PixSampleFmtWrapper()=default
avcpp
pixelformat.h
Generated by
1.18.0