RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
rawspeed_test::anonymous_namespace{SplineTest.cpp} Namespace Reference

Classes

class  IdentityTest
class  CalculateStepsEdgesTest
class  CalculateStepsTest
class  ConstantTest
class  AbstractReferenceTest
class  SinReferenceTest
class  ReferenceTest

Typedefs

using identityType
using IntegerIdentityTest = IdentityTest<uint16_t>
using DoubleIdentityTest = IdentityTest<double>
using calculateStepsType = std::tuple<int, std::vector<int>>
using DoubleCalculateStepsTest = CalculateStepsTest<double>
using IntegerCalculateStepsTest = CalculateStepsTest<int>
using constantType = std::tuple<int, int>
using IntegerConstantTest = ConstantTest<uint16_t>
using DoubleConstantTest = ConstantTest<double>
using referenceType = std::tuple<int, long double>
using Sin2PiRefTest = ReferenceTest<SinReferenceTest<2, 1>>
using SinPiRefTest = ReferenceTest<SinReferenceTest<1, 1>>

Functions

 TEST (SplineStaticTest, DefaultIsUshort16)
 TEST (SplineDeathTest, AtLeastTwoPoints)
 TEST (SplineDeathTest, XIsFullRange)
 TEST (SplineDeathTest, YIsLimited)
 TEST (SplineDeathTest, XIsStrictlyIncreasing)
 TEST (SplineDeathTest, ClampUshort16Min)
 TEST (SplineDeathTest, ClampUshort16Max)
 INSTANTIATE_TEST_SUITE_P (IntegerIdentityTest, IntegerIdentityTest, ::testing::ValuesIn(identityValues))
 TEST_P (IntegerIdentityTest, ValuesAreLinearlyInterpolated)
 TEST_P (IntegerIdentityTest, SegmentCoeffients)
 INSTANTIATE_TEST_SUITE_P (DoubleIdentityTest, DoubleIdentityTest, ::testing::ValuesIn(identityValues))
 TEST_P (DoubleIdentityTest, ValuesAreLinearlyInterpolated)
 TEST_P (DoubleIdentityTest, SegmentCoeffients)
template<typename T>
lerp (T v0, T v1, T t)
template<typename T = int>
requires std::is_arithmetic_v<T>
std::vector< T > calculateSteps (int numCp)
 TEST (CalculateStepsEdgesTest, IdentityTest)
 INSTANTIATE_TEST_SUITE_P (CalculateStepsEdgesTest, CalculateStepsEdgesTest, ::testing::Range(0, 254))
 TEST_P (CalculateStepsEdgesTest, Count)
 TEST_P (CalculateStepsEdgesTest, EdgesAreProper)
 INSTANTIATE_TEST_SUITE_P (CalculateStepsTest, DoubleCalculateStepsTest, ::testing::ValuesIn(calculateStepsValues))
 TEST_P (DoubleCalculateStepsTest, Count)
 TEST_P (DoubleCalculateStepsTest, GotExpectedOutput)
 INSTANTIATE_TEST_SUITE_P (CalculateStepsTest, IntegerCalculateStepsTest, ::testing::ValuesIn(calculateStepsValues))
 TEST_P (IntegerCalculateStepsTest, Count)
 TEST_P (IntegerCalculateStepsTest, GotExpectedOutput)
 INSTANTIATE_TEST_SUITE_P (IntegerConstantTest, IntegerConstantTest, constantValues)
 TEST_P (IntegerConstantTest, AllValuesAreEqual)
 TEST_P (IntegerConstantTest, SegmentCoeffients)
 INSTANTIATE_TEST_SUITE_P (DoubleConstantTest, DoubleConstantTest, constantValues)
 TEST_P (DoubleConstantTest, AllValuesAreEqual)
 TEST_P (DoubleConstantTest, SegmentCoeffients)
 INSTANTIATE_TEST_SUITE_P (Sin2Pi, Sin2PiRefTest, ::testing::ValuesIn(sin2PiRefValues))
 TEST_P (Sin2PiRefTest, NearlyMatchesReference)
 INSTANTIATE_TEST_SUITE_P (SinPi, SinPiRefTest, ::testing::ValuesIn(sinPiRefValues))
 TEST_P (SinPiRefTest, NearlyMatchesReference)

Variables

const identityType identityValues []
const calculateStepsType calculateStepsValues []
constexpr auto NumExtraSteps = 3
const auto constantValues
const referenceType sin2PiRefValues []
const referenceType sinPiRefValues []

Typedef Documentation

◆ calculateStepsType

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::calculateStepsType = std::tuple<int, std::vector<int>>

Definition at line 296 of file SplineTest.cpp.

◆ constantType

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::constantType = std::tuple<int, int>

Definition at line 356 of file SplineTest.cpp.

◆ DoubleCalculateStepsTest

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::DoubleCalculateStepsTest = CalculateStepsTest<double>

Definition at line 328 of file SplineTest.cpp.

◆ DoubleConstantTest

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::DoubleConstantTest = ConstantTest<double>

Definition at line 422 of file SplineTest.cpp.

◆ DoubleIdentityTest

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::DoubleIdentityTest = IdentityTest<double>

Definition at line 232 of file SplineTest.cpp.

◆ identityType

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::identityType
Initial value:
std::tuple<std::array<rawspeed::iPoint2D, 2>,
std::vector<std::array<double, 4>>>

Definition at line 179 of file SplineTest.cpp.

◆ IntegerCalculateStepsTest

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::IntegerCalculateStepsTest = CalculateStepsTest<int>

Definition at line 345 of file SplineTest.cpp.

◆ IntegerConstantTest

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::IntegerConstantTest = ConstantTest<uint16_t>

Definition at line 413 of file SplineTest.cpp.

◆ IntegerIdentityTest

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::IntegerIdentityTest = IdentityTest<uint16_t>

Definition at line 223 of file SplineTest.cpp.

◆ referenceType

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::referenceType = std::tuple<int, long double>

Definition at line 458 of file SplineTest.cpp.

◆ Sin2PiRefTest

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::Sin2PiRefTest = ReferenceTest<SinReferenceTest<2, 1>>

Definition at line 507 of file SplineTest.cpp.

◆ SinPiRefTest

using rawspeed_test::anonymous_namespace{SplineTest.cpp}::SinPiRefTest = ReferenceTest<SinReferenceTest<1, 1>>

Definition at line 531 of file SplineTest.cpp.

Function Documentation

◆ calculateSteps()

template<typename T = int>
requires std::is_arithmetic_v<T>
std::vector< T > rawspeed_test::anonymous_namespace{SplineTest.cpp}::calculateSteps ( int numCp)

Definition at line 249 of file SplineTest.cpp.

References assert(), calculateSteps(), rawspeed::implicit_cast(), lerp(), and x.

Referenced by rawspeed_test::anonymous_namespace{SplineTest.cpp}::ConstantTest< uint16_t >::calculateEdges(), rawspeed_test::anonymous_namespace{SplineTest.cpp}::ReferenceTest< SinReferenceTest< 2, 1 > >::calculateReference(), calculateSteps(), rawspeed_test::anonymous_namespace{SplineTest.cpp}::CalculateStepsEdgesTest::SetUp(), rawspeed_test::anonymous_namespace{SplineTest.cpp}::CalculateStepsTest< double >::SetUp(), and TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ INSTANTIATE_TEST_SUITE_P() [1/9]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::INSTANTIATE_TEST_SUITE_P ( CalculateStepsEdgesTest ,
CalculateStepsEdgesTest ,
::testing::Range(0, 254)  )

◆ INSTANTIATE_TEST_SUITE_P() [2/9]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::INSTANTIATE_TEST_SUITE_P ( CalculateStepsTest ,
DoubleCalculateStepsTest ,
::testing::ValuesIn(calculateStepsValues)  )

References calculateStepsValues.

◆ INSTANTIATE_TEST_SUITE_P() [3/9]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::INSTANTIATE_TEST_SUITE_P ( CalculateStepsTest ,
IntegerCalculateStepsTest ,
::testing::ValuesIn(calculateStepsValues)  )

References calculateStepsValues.

◆ INSTANTIATE_TEST_SUITE_P() [4/9]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::INSTANTIATE_TEST_SUITE_P ( DoubleConstantTest ,
DoubleConstantTest ,
constantValues  )

References constantValues.

◆ INSTANTIATE_TEST_SUITE_P() [5/9]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::INSTANTIATE_TEST_SUITE_P ( DoubleIdentityTest ,
DoubleIdentityTest ,
::testing::ValuesIn(identityValues)  )

References identityValues.

◆ INSTANTIATE_TEST_SUITE_P() [6/9]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::INSTANTIATE_TEST_SUITE_P ( IntegerConstantTest ,
IntegerConstantTest ,
constantValues  )

References constantValues.

◆ INSTANTIATE_TEST_SUITE_P() [7/9]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::INSTANTIATE_TEST_SUITE_P ( IntegerIdentityTest ,
IntegerIdentityTest ,
::testing::ValuesIn(identityValues)  )

References identityValues.

◆ INSTANTIATE_TEST_SUITE_P() [8/9]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::INSTANTIATE_TEST_SUITE_P ( Sin2Pi ,
Sin2PiRefTest ,
::testing::ValuesIn(sin2PiRefValues)  )

References sin2PiRefValues.

◆ INSTANTIATE_TEST_SUITE_P() [9/9]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::INSTANTIATE_TEST_SUITE_P ( SinPi ,
SinPiRefTest ,
::testing::ValuesIn(sinPiRefValues)  )

References sinPiRefValues.

◆ lerp()

template<typename T>
T rawspeed_test::anonymous_namespace{SplineTest.cpp}::lerp ( T v0,
T v1,
T t )

Definition at line 243 of file SplineTest.cpp.

References lerp().

Referenced by calculateSteps(), and lerp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TEST() [1/8]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST ( CalculateStepsEdgesTest ,
IdentityTest  )

Definition at line 268 of file SplineTest.cpp.

References calculateSteps(), TEST(), and x.

Here is the call graph for this function:

◆ TEST() [2/8]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST ( SplineDeathTest ,
AtLeastTwoPoints  )

Definition at line 60 of file SplineTest.cpp.

References s, and TEST().

Here is the call graph for this function:

◆ TEST() [3/8]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST ( SplineDeathTest ,
ClampUshort16Max  )

Definition at line 159 of file SplineTest.cpp.

References s, and TEST().

Here is the call graph for this function:

◆ TEST() [4/8]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST ( SplineDeathTest ,
ClampUshort16Min  )

Definition at line 140 of file SplineTest.cpp.

References s, and TEST().

Here is the call graph for this function:

◆ TEST() [5/8]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST ( SplineDeathTest ,
XIsFullRange  )

Definition at line 82 of file SplineTest.cpp.

References s, and TEST().

Here is the call graph for this function:

◆ TEST() [6/8]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST ( SplineDeathTest ,
XIsStrictlyIncreasing  )

Definition at line 112 of file SplineTest.cpp.

References s, and TEST().

Here is the call graph for this function:

◆ TEST() [7/8]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST ( SplineDeathTest ,
YIsLimited  )

Definition at line 97 of file SplineTest.cpp.

References s, and TEST().

Here is the call graph for this function:

◆ TEST() [8/8]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST ( SplineStaticTest ,
DefaultIsUshort16  )

Definition at line 54 of file SplineTest.cpp.

References TEST().

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TEST_P() [1/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( CalculateStepsEdgesTest ,
Count  )

Definition at line 288 of file SplineTest.cpp.

◆ TEST_P() [2/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( CalculateStepsEdgesTest ,
EdgesAreProper  )

Definition at line 291 of file SplineTest.cpp.

◆ TEST_P() [3/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( DoubleCalculateStepsTest ,
Count  )

Definition at line 331 of file SplineTest.cpp.

◆ TEST_P() [4/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( DoubleCalculateStepsTest ,
GotExpectedOutput  )

Definition at line 335 of file SplineTest.cpp.

◆ TEST_P() [5/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( DoubleConstantTest ,
AllValuesAreEqual  )

Definition at line 425 of file SplineTest.cpp.

◆ TEST_P() [6/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( DoubleConstantTest ,
SegmentCoeffients  )

Definition at line 431 of file SplineTest.cpp.

◆ TEST_P() [7/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( DoubleIdentityTest ,
SegmentCoeffients  )

Definition at line 241 of file SplineTest.cpp.

◆ TEST_P() [8/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( DoubleIdentityTest ,
ValuesAreLinearlyInterpolated  )

Definition at line 235 of file SplineTest.cpp.

References x.

◆ TEST_P() [9/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( IntegerCalculateStepsTest ,
Count  )

Definition at line 348 of file SplineTest.cpp.

◆ TEST_P() [10/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( IntegerCalculateStepsTest ,
GotExpectedOutput  )

Definition at line 352 of file SplineTest.cpp.

◆ TEST_P() [11/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( IntegerConstantTest ,
AllValuesAreEqual  )

Definition at line 416 of file SplineTest.cpp.

◆ TEST_P() [12/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( IntegerConstantTest ,
SegmentCoeffients  )

Definition at line 420 of file SplineTest.cpp.

◆ TEST_P() [13/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( IntegerIdentityTest ,
SegmentCoeffients  )

Definition at line 230 of file SplineTest.cpp.

◆ TEST_P() [14/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( IntegerIdentityTest ,
ValuesAreLinearlyInterpolated  )

Definition at line 226 of file SplineTest.cpp.

References x.

◆ TEST_P() [15/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( Sin2PiRefTest ,
NearlyMatchesReference  )

Definition at line 529 of file SplineTest.cpp.

◆ TEST_P() [16/16]

rawspeed_test::anonymous_namespace{SplineTest.cpp}::TEST_P ( SinPiRefTest ,
NearlyMatchesReference  )

Definition at line 551 of file SplineTest.cpp.

Variable Documentation

◆ calculateStepsValues

const calculateStepsType rawspeed_test::anonymous_namespace{SplineTest.cpp}::calculateStepsValues[]
Initial value:
= {
make_tuple(0, std::vector<int>{0, 65535}),
make_tuple(1, std::vector<int>{0, 32768, 65535}),
make_tuple(2, std::vector<int>{0, 21845, 43690, 65535}),
make_tuple(3, std::vector<int>{0, 16384, 32768, 49151, 65535}),
make_tuple(4, std::vector<int>{0, 13107, 26214, 39321, 52428, 65535}),
make_tuple(5, std::vector<int>{0, 10923, 21845, 32768, 43690, 54613, 65535}),
make_tuple(6, std::vector<int>{0, 9362, 18724, 28086, 37449, 46811, 56173, 65535}),
make_tuple(7, std::vector<int>{0, 8192, 16384, 24576, 32768, 40959, 49151, 57343, 65535}),
make_tuple(8, std::vector<int>{0, 7282, 14563, 21845, 29127, 36408, 43690, 50972, 58253, 65535}),
}

Definition at line 314 of file SplineTest.cpp.

Referenced by INSTANTIATE_TEST_SUITE_P(), and INSTANTIATE_TEST_SUITE_P().

◆ constantValues

const auto rawspeed_test::anonymous_namespace{SplineTest.cpp}::constantValues
Initial value:
=
::testing::Combine(::testing::ValuesIn(calculateSteps(NumExtraSteps)),
::testing::Range(0, 1 + NumExtraSteps))

Definition at line 409 of file SplineTest.cpp.

Referenced by INSTANTIATE_TEST_SUITE_P(), and INSTANTIATE_TEST_SUITE_P().

◆ identityValues

const identityType rawspeed_test::anonymous_namespace{SplineTest.cpp}::identityValues[]
Initial value:
= {
make_tuple(std::array<rawspeed::iPoint2D, 2>{{{0, 0}, {65535, 65535}}},
std::vector<std::array<double, 4>>{{{0.0, 1.0, 0.0, 0.0}}}),
make_tuple(
std::array<rawspeed::iPoint2D, 2>{{{0, 65535}, {65535, 0}}},
std::vector<std::array<double, 4>>{{{65535.0, -1.0, 0.0, 0.0}}})}

Definition at line 216 of file SplineTest.cpp.

Referenced by INSTANTIATE_TEST_SUITE_P(), and INSTANTIATE_TEST_SUITE_P().

◆ NumExtraSteps

auto rawspeed_test::anonymous_namespace{SplineTest.cpp}::NumExtraSteps = 3
constexpr

Definition at line 408 of file SplineTest.cpp.

◆ sin2PiRefValues

const referenceType rawspeed_test::anonymous_namespace{SplineTest.cpp}::sin2PiRefValues[]
Initial value:
= {
make_tuple(0, 1.0E-00),
make_tuple(1, 1.0E+01),
make_tuple(2, 1.0E-00),
make_tuple(3, 1.0E-01),
make_tuple(4, 1.0E-02),
make_tuple(5, 1.0E-02),
make_tuple(6, 1.0E-02),
make_tuple(7, 1.0E-02),
make_tuple(8, 1.0E-03),
make_tuple(9, 1.0E-03),
make_tuple(10, 1.0E-03),
make_tuple(11, 1.0E-03),
make_tuple(12, 1.0E-03),
make_tuple(13, 1.0E-03),
make_tuple(14, 1.0E-04),
}

Definition at line 508 of file SplineTest.cpp.

Referenced by INSTANTIATE_TEST_SUITE_P().

◆ sinPiRefValues

const referenceType rawspeed_test::anonymous_namespace{SplineTest.cpp}::sinPiRefValues[]
Initial value:
= {
make_tuple(0, 1.0E-00),
make_tuple(1, 1.0E-01),
make_tuple(2, 1.0E-02),
make_tuple(3, 1.0E-02),
make_tuple(4, 1.0E-03),
make_tuple(5, 1.0E-03),
make_tuple(6, 1.0E-03),
make_tuple(7, 1.0E-04),
make_tuple(8, 1.0E-04),
make_tuple(9, 1.0E-04),
make_tuple(10, 1.0E-04),
make_tuple(11, 1.0E-04),
make_tuple(12, 1.0E-05),
}

Definition at line 532 of file SplineTest.cpp.

Referenced by INSTANTIATE_TEST_SUITE_P().