Lumiera  0.pre.03
»edit your freedom«
test-rand-ontology.cpp File Reference

Go to the source code of this file.

Description

Implementation of fake data processing to verify invocation logic.

The emulated »media computations« work on TestFrame data buffers, which can be filled with deterministically generated pseudo-random data, that can be verified afterwards. Computations manipulate or combine individual data points, and mark the result again with a valid checksum. Hash-chaining computations are used in order to ensure that the resulting data values depend on all input- and parameter values, and the exact order of processing. All computations are reproducible, and thus a test can verify a computation carried out within the context of the Render-Engine code.

Definition in file test-rand-ontology.cpp.

#include "steam/engine/test-rand-ontology.hpp"
#include "lib/hash-combine.hpp"
#include "lib/iter-zip.hpp"
#include <cmath>

Functions

void combineFrames (TestFrame *out, TestFrame const *srcA, TestFrame const *srcB, double mix)
 mix two random data frames by a parameter-controlled proportion More...
 
void duplicateMultichan (TestFrame *outArry, TestFrame *inArry, uint chanCnt)
 create an identical clone copy of the planar multi channel frame array More...
 
void generateFrame (TestFrame *buff, size_t frameNr=0, uint flavour=0)
 produce sequences of frames with (reproducible) random data More...
 
void generateMultichan (TestFrame *buffArry, uint chanCnt, size_t frameNr=0, uint flavour=0)
 produce planar multi channel output of random data frames More...
 
void manipulateFrame (TestFrame *out, TestFrame const *in, uint64_t param)
 »process« random frame date by hash-chaining with a parameter. More...
 
void manipulateMultichan (TestFrame *buffArry, uint chanCnt, uint64_t param)
 »process« a planar multi channel array of data frames in-place. More...
 

Variables

const string DUMMY_FUN_ID {"dummyFun(TestFrame)"}
 
lib::Depend< TestRandOntology > testRand
 Storage for the Singleton-Accessor/Factory. More...
 

Namespaces

 steam
 Steam-Layer implementation namespace root.
 
 steam::engine
 Lumiera's render engine core and operational control.
 

Function Documentation

◆ generateFrame()

void generateFrame ( TestFrame buff,
size_t  frameNr,
uint  flavour 
)

produce sequences of frames with (reproducible) random data

Parameters
buffa sufficiently sized allocation to place the result data into
frameNrthe frame of the »source feed« to generate (determines actual random data)
flavoura further seed parameter to determine the actual (reproducibly) random data

Definition at line 56 of file test-rand-ontology.cpp.

References steam::engine::test::generateFrame().

Referenced by steam::engine::test::generateFrame(), and NodeDevel_test::processing_generateFrame().

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

◆ generateMultichan()

void generateMultichan ( TestFrame buffArry,
uint  chanCnt,
size_t  frameNr,
uint  flavour 
)

produce planar multi channel output of random data frames

Parameters
chanCntsize of the array of frames to generate
buffArrypointer to an allocation sufficiently sized to hold TestFrame[chanCnt]
frameNrthe frame of the »source feed« to use commonly on all those frames in the output
flavoura further seed parameter used as starting offest for the output's family parameters
Remarks
this is a variation of the dummy data generator, which immediately generates a planar block of related frames with random data, all seeded with the same frameNr and consecutive family parameters, which will be offset commonly by adding the flavour parameter.

Definition at line 73 of file test-rand-ontology.cpp.

References steam::engine::test::generateMultichan().

Referenced by steam::engine::test::generateMultichan(), NodeDevel_test::processing_duplicateMultichan(), NodeDevel_test::processing_generateMultichan(), and NodeDevel_test::processing_manipulateMultichan().

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

◆ duplicateMultichan()

void duplicateMultichan ( TestFrame outArry,
TestFrame inArry,
uint  chanCnt 
)

create an identical clone copy of the planar multi channel frame array

Parameters
chanCntsize of the array of frames to clone
inArrypointer to storage holding a TestFrame[chanCnt]
outArrypointer to allocated storage sufficient to hold a clone copy of these

Definition at line 86 of file test-rand-ontology.cpp.

References steam::engine::test::duplicateMultichan().

Referenced by steam::engine::test::duplicateMultichan(), NodeDevel_test::processing_duplicateMultichan(), and NodeDevel_test::processing_manipulateMultichan().

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

◆ manipulateMultichan()

void manipulateMultichan ( TestFrame buffArry,
uint  chanCnt,
uint64_t  param 
)

»process« a planar multi channel array of data frames in-place.

Parameters
chanCntsize of the array of frames to manipulate
buffArrypointer to an array of several frames (channels)
paramparameter to control or »mark« the data manipulation (hash-combining)
Remarks
this function in-place processing of several channels in one step: data is processed in 64-bit words, by hash-chaining with param and then joining in the data items. All data buffers will be manipulated and marked with as valid with a new checksum.

Definition at line 103 of file test-rand-ontology.cpp.

References lib::hash::combine(), and steam::engine::test::manipulateMultichan().

Referenced by steam::engine::test::manipulateMultichan(), and NodeDevel_test::processing_manipulateMultichan().

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

◆ manipulateFrame()

void manipulateFrame ( TestFrame out,
TestFrame const *  in,
uint64_t  param 
)

»process« random frame date by hash-chaining with a parameter.

Parameters
outexisting allocation to place the generated TestFrame into
inallocation holding the input TestFrame data
paramparameter to control or »mark« the data manipulation (hash-combining)
Remarks
this function emulates „media data processing“: data is processed in 64-bit words, by hash-chaining with param. The generated result is marked with a valid checksum.

Definition at line 129 of file test-rand-ontology.cpp.

References lib::hash::combine(), steam::engine::test::manipulateFrame(), TestFrame::markChecksum(), and lib::zip().

Referenced by steam::engine::test::manipulateFrame(), and NodeDevel_test::processing_manipulateFrame().

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

◆ combineFrames()

void combineFrames ( TestFrame out,
TestFrame const *  srcA,
TestFrame const *  srcB,
double  mix 
)

mix two random data frames by a parameter-controlled proportion

Parameters
outexisting allocation to receive the calculated result TestFrame
srcAa buffer holding the input data for feed-A
srcBa buffer holding the input data for feed-B
mixdegree of mixing (by integer arithmetics): 100 means 100% feed-B
Remarks
this function emulates a mixing or overlaying operation: each result byte is the linear interpolation between the corresponding inputs.

Definition at line 148 of file test-rand-ontology.cpp.

References steam::engine::test::combineFrames(), TestFrame::data(), TestFrame::markChecksum(), and lib::zip().

Referenced by steam::engine::test::combineFrames(), and NodeDevel_test::processing_combineFrames().

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

Variable Documentation

◆ testRand

lib::Depend< TestRandOntology > testRand

Storage for the Singleton-Accessor/Factory.

Singleton accessor.

Definition at line 165 of file test-rand-ontology.cpp.

Referenced by NodeDevel_test::testRand_simpleUsage().