#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ui/gfx/color_transform.h"
#include <algorithm>
#include <cmath>
#include <list>
#include <memory>
#include <sstream>
#include <utility>
#include "base/logging.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkM44.h"
#include "third_party/skia/modules/skcms/skcms.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/icc_profile.h"
#include "ui/gfx/skia_color_space_util.h"
abs;
copysign;
endl;
exp;
log;
max;
min;
pow;
sqrt;
namespace gfx {
namespace {
static constexpr float kHLGRefMaxLumNits = …;
static constexpr float kPQRefMaxLumNits = …;
static constexpr float kLr = …;
static constexpr float kLg = …;
static constexpr float kLb = …;
bool IsHlgPqUnifiedTonemapEnabled() { … }
bool IsHlgPqSdrRelative() { … }
struct SkShaderUniforms { … };
void InitStringStream(std::stringstream* ss) { … }
std::string Str(float f) { … }
SkM44 Invert(const SkM44& t) { … }
float FromLinear(ColorSpace::TransferID id, float v) { … }
float ToLinear(ColorSpace::TransferID id, float v) { … }
}
BASE_FEATURE(…);
BASE_FEATURE(…);
class ColorTransformMatrix;
class ColorTransformSkTransferFn;
class ColorTransformFromLinear;
class ColorTransformNull;
class ColorTransformStep { … };
class ColorTransformInternal : public ColorTransform { … };
class ColorTransformNull : public ColorTransformStep { … };
class ColorTransformMatrix : public ColorTransformStep { … };
class ColorTransformPerChannelTransferFn : public ColorTransformStep { … };
class ColorTransformPiecewiseHDR : public ColorTransformPerChannelTransferFn { … };
class ColorTransformSkTransferFn : public ColorTransformPerChannelTransferFn { … };
class ColorTransformHLG_OETF : public ColorTransformPerChannelTransferFn { … };
class ColorTransformPQFromLinear : public ColorTransformPerChannelTransferFn { … };
class ColorTransformHLG_InvOETF : public ColorTransformPerChannelTransferFn { … };
class ColorTransformPQToLinear : public ColorTransformPerChannelTransferFn { … };
class ColorTransformFromLinear : public ColorTransformPerChannelTransferFn { … };
class ColorTransformToLinear : public ColorTransformPerChannelTransferFn { … };
class ColorTransformHLG_OOTF : public ColorTransformStep { … };
class ColorTransformHLG_RefOOTF : public ColorTransformStep { … };
class ColorTransformToneMapInRec2020Linear : public ColorTransformStep { … };
class ColorTransformSrcNitsToSdrRelative : public ColorTransformStep { … };
class ColorTransformSdrToDstNitsRelative : public ColorTransformStep { … };
void ColorTransformInternal::AppendColorSpaceToColorSpaceTransform(
const ColorSpace& src,
const ColorSpace& dst,
const Options& options) { … }
ColorTransformInternal::ColorTransformInternal(const ColorSpace& src,
const ColorSpace& dst,
const Options& options)
: … { … }
sk_sp<SkRuntimeEffect> ColorTransformInternal::GetSkRuntimeEffect() const { … }
sk_sp<SkData> ColorTransformInternal::GetSkShaderUniforms(
const RuntimeOptions& options) const { … }
ColorTransformInternal::~ColorTransformInternal() { … }
void ColorTransformInternal::Simplify() { … }
std::unique_ptr<ColorTransform> ColorTransform::NewColorTransform(
const ColorSpace& src,
const ColorSpace& dst) { … }
std::unique_ptr<ColorTransform> ColorTransform::NewColorTransform(
const ColorSpace& src,
const ColorSpace& dst,
const Options& options) { … }
ColorTransform::ColorTransform() { … }
ColorTransform::~ColorTransform() { … }
}