vector<double>
-GammaTransferFunction::make_lut (double from, double to, int bit_depth, bool inverse) const
+GammaTransferFunction::make_double_lut(double from, double to, int bit_depth, bool inverse) const
{
int const bit_length = int(std::pow(2.0f, bit_depth));
auto lut = vector<double>(bit_length);
bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override;
protected:
- std::vector<double> make_lut (double from, double to, int bit_depth, bool inverse) const override;
+ std::vector<double> make_double_lut(double from, double to, int bit_depth, bool inverse) const override;
private:
double _gamma;
vector<double>
-IdentityTransferFunction::make_lut (double from, double to, int bit_depth, bool) const
+IdentityTransferFunction::make_double_lut(double from, double to, int bit_depth, bool) const
{
int const bit_length = int(std::pow(2.0f, bit_depth));
auto lut = vector<double>(bit_length);
bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override;
protected:
- std::vector<double> make_lut (double from, double to, int bit_depth, bool inverse) const override;
+ std::vector<double> make_double_lut(double from, double to, int bit_depth, bool inverse) const override;
};
vector<double>
-ModifiedGammaTransferFunction::make_lut (double from, double to, int bit_depth, bool inverse) const
+ModifiedGammaTransferFunction::make_double_lut(double from, double to, int bit_depth, bool inverse) const
{
int const bit_length = int(std::pow(2.0f, bit_depth));
auto lut = vector<double>(bit_length);
bool about_equal (std::shared_ptr<const TransferFunction>, double epsilon) const override;
protected:
- std::vector<double> make_lut (double from, double to, int bit_depth, bool inverse) const override;
+ std::vector<double> make_double_lut(double from, double to, int bit_depth, bool inverse) const override;
private:
double _power;
public:
PiecewiseLUT2(std::shared_ptr<const TransferFunction> fn, double boundary, int low_bits, int high_bits, bool inverse)
: _boundary(boundary)
- , _low(fn->lut(0, boundary, low_bits, inverse))
- , _high(fn->lut(boundary, 1, high_bits, inverse))
+ , _low(fn->double_lut(0, boundary, low_bits, inverse))
+ , _high(fn->double_lut(boundary, 1, high_bits, inverse))
, _low_scale(static_cast<int>(std::pow(2.0f, low_bits)) - 1)
, _high_scale(static_cast<int>(std::pow(2.0f, high_bits)) - 1)
{
int* xyz_y = xyz_image->data (1);
int* xyz_z = xyz_image->data (2);
- auto lut_in = conversion.out()->lut(0, 1, 12, false);
- auto lut_out = conversion.in()->lut(0, 1, 16, true);
+ auto lut_in = conversion.out()->double_lut(0, 1, 12, false);
+ auto lut_out = conversion.in()->double_lut(0, 1, 16, true);
boost::numeric::ublas::matrix<double> const matrix = conversion.xyz_to_rgb ();
double fast_matrix[9] = {
int* xyz_y = xyz_image->data (1);
int* xyz_z = xyz_image->data (2);
- auto lut_in = conversion.out()->lut(0, 1, 12, false);
- auto lut_out = conversion.in()->lut(0, 1, 16, true);
+ auto lut_in = conversion.out()->double_lut(0, 1, 12, false);
+ auto lut_out = conversion.in()->double_lut(0, 1, 16, true);
auto const matrix = conversion.xyz_to_rgb ();
double fast_matrix[9] = {
double x, y, z;
} d;
- auto lut_in = conversion.in()->lut(0, 1, 12, false);
+ auto lut_in = conversion.in()->double_lut(0, 1, 12, false);
auto lut_out = make_inverse_gamma_lut(conversion.out());
/* This is is the product of the RGB to XYZ matrix, the Bradford transform and the DCI companding */
vector<double>
-SGamut3TransferFunction::make_lut (double from, double to, int bit_depth, bool inverse) const
+SGamut3TransferFunction::make_double_lut(double from, double to, int bit_depth, bool inverse) const
{
int const bit_length = int(std::pow(2.0f, bit_depth));
auto lut = vector<double>(bit_length);
bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override;
protected:
- std::vector<double> make_lut (double from, double to, int bit_depth, bool inverse) const override;
+ std::vector<double> make_double_lut(double from, double to, int bit_depth, bool inverse) const override;
};
vector<double> const&
-TransferFunction::lut (double from, double to, int bit_depth, bool inverse) const
+TransferFunction::double_lut(double from, double to, int bit_depth, bool inverse) const
{
boost::mutex::scoped_lock lm (_mutex);
return i->second;
}
- _luts[descriptor] = make_lut(from, to, bit_depth, inverse);
+ _luts[descriptor] = make_double_lut(from, to, bit_depth, inverse);
return _luts[descriptor];
}
virtual ~TransferFunction () {}
/** @return A look-up table (of size 2^bit_depth) */
- std::vector<double> const& lut (double from, double to, int bit_depth, bool inverse) const;
+ std::vector<double> const& double_lut(double from, double to, int bit_depth, bool inverse) const;
virtual bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const = 0;
protected:
- virtual std::vector<double> make_lut (double from, double to, int bit_depth, bool inverse) const = 0;
+ virtual std::vector<double> make_double_lut(double from, double to, int bit_depth, bool inverse) const = 0;
private:
struct LUTDescriptor {
static void
check_gamma (shared_ptr<const TransferFunction> tf, int bit_depth, bool inverse, float gamma)
{
- auto lut = tf->lut(0, 1, bit_depth, inverse);
+ auto lut = tf->double_lut(0, 1, bit_depth, inverse);
int const count = rint (pow (2.0, bit_depth));
for (int i = 0; i < count; ++i) {
static void
check_modified_gamma (shared_ptr<const TransferFunction> tf, int bit_depth, bool inverse, double power, double threshold, double A, double B)
{
- auto lut = tf->lut(0, 1, bit_depth, inverse);
+ auto lut = tf->double_lut(0, 1, bit_depth, inverse);
int const count = rint (pow (2.0, bit_depth));
for (int i = 0; i < count; ++i) {