43 p->use_base_color_space &&
44 av_cmp_q(p->alternate_hdr_headroom, p->base_hdr_headroom) != 0;
47#define XMP_GAIN_MAP_TEMPLATE \
48 "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"XMP Core 5.5.0\">\n" \
49 " <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n" \
50 " <rdf:Description rdf:about=\"\"\n" \
51 " xmlns:hdrgm=\"" FF_GAIN_MAP_XMP_NAMESPACE "\"\n" \
52 " hdrgm:Version=\"1.0\"\n" \
53 " hdrgm:GainMapMin=\"%g\"\n" \
54 " hdrgm:GainMapMax=\"%g\"\n" \
55 " hdrgm:Gamma=\"%g\"\n" \
56 " hdrgm:OffsetSDR=\"%g\"\n" \
57 " hdrgm:OffsetHDR=\"%g\"\n" \
58 " hdrgm:HDRCapacityMin=\"%g\"\n" \
59 " hdrgm:HDRCapacityMax=\"%g\"\n" \
60 " hdrgm:BaseRenditionIsHDR=\"%s\"/>\n" \
65 "XMP buffer too small for template and values");
75 const struct AVGainMapChannel *
const ch = &p->channels[0];
79 AVRational hdr_cap_max = p->alternate_hdr_headroom;
81 const int base_is_hdr =
av_cmp_q(p->base_hdr_headroom,
82 p->alternate_hdr_headroom) > 0;
94 base_is_hdr ?
"True" :
"False");
simple assert() macros that are a bit more flexible than ISO C assert().
common internal and external API header
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
int ff_gain_map_params_check_xmp(const AVGainMapParams *p)
Returns 1 if the gain map parameters are compatible with the XMP-based encoding, or 0 otherwise.
int ff_gain_map_params_to_xmp(const AVGainMapParams *p, char *buf)
Serialize an AVGainMapParams as an Ultra HDR XMP packet.
#define XMP_GAIN_MAP_TEMPLATE
Serialization of AVGainMapParams into the metadata blobs that image formats carry it in,...
#define FF_GAIN_MAP_XMP_MAX_LEN
#define FF_GAIN_MAP_VERSION
int av_gain_map_params_validate(const AVGainMapParams *p)
Returns >= 0 if the given AVGainMapParams struct contains valid data; or a negative AVERROR otherwise...
int av_gain_map_channels_identical(const AVGainMapParams *p)
Returns 1 if all channels of the gain map have identical parameters, 0 otherwise.
#define FFSWAP(type, a, b)
Memory handling functions.
Utilities for rational number calculation.
Parameters describing how to combine a gain map rendition with its base rendition to recover the alte...
Rational number (pair of numerator and denominator).