![]() |
Inviwo 0.9.12-pre
Inviwo documentation
|
data structure for holding 1D transfer function data More...
#include <inviwo/core/datastructures/transferfunction.h>
Public Member Functions | |
| void | clearMask () |
| virtual void | deserialize (Deserializer &d) override |
| dvec2 | getMask () const |
| double | getMaskMax () const |
| double | getMaskMin () const |
| virtual void | interpolateAndStoreColors (std::span< vec4 > data) const override |
| TransferFunction & | operator= (const TransferFunction &rhs)=default |
| TransferFunction & | operator= (TransferFunction &&rhs) noexcept=default |
| vec4 | sample (double v) const |
| vec4 | sample (float v) const |
| virtual void | serialize (Serializer &s) const override |
| void | setMask (dvec2 mask) |
| void | setMaskMax (double maskMax) |
| void | setMaskMin (double maskMin) |
| TransferFunction (const std::vector< TFPrimitiveData > &values) | |
| TransferFunction (const std::vector< TFPrimitiveData > &values, TFPrimitiveSetType type) | |
| TransferFunction (const TransferFunction &rhs)=default | |
| TransferFunction (TransferFunction &&rhs) noexcept=default | |
| Public Member Functions inherited from inviwo::TFPrimitiveSet | |
| TFPrimitive & | add (const dvec2 &pos) |
| void | add (const std::vector< TFPrimitiveData > &primitives) |
| TFPrimitive & | add (const TFPrimitive &primitive) |
| TFPrimitive & | add (const TFPrimitiveData &data) |
| TFPrimitive & | add (double pos, const vec4 &color) |
| TFPrimitive & | add (double pos, double alpha) |
| TFPrimitive & | back () |
| const TFPrimitive & | back () const |
| iterator | begin () |
| const_iterator | begin () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
| void | clear () |
| bool | contains (const TFPrimitive *primitive) const |
| bool | empty () const |
| iterator | end () |
| const_iterator | end () const |
| TFPrimitive & | front () |
| const TFPrimitive & | front () const |
| std::vector< TFPrimitiveData > | get () const |
| TFPrimitive & | get (size_t i) |
| const TFPrimitive & | get (size_t i) const |
| std::vector< vec4 > | getColors () const |
| std::vector< double > | getPositions () const |
| std::vector< float > | getPositionsf () const |
| dvec2 | getRange () const |
| TFPrimitiveSetType | getType () const |
| std::vector< TFPrimitiveData > | getUnsorted () const |
| std::pair< std::vector< double >, std::vector< vec4 > > | getVectors () const |
| std::pair< std::vector< float >, std::vector< vec4 > > | getVectorsf () const |
| virtual void | onTFPrimitiveChange (const TFPrimitive &p) override |
| TFPrimitiveSet & | operator= (const TFPrimitiveSet &rhs) |
| TFPrimitiveSet & | operator= (TFPrimitiveSet &&rhs) noexcept |
| bool | operator== (const std::vector< TFPrimitiveData > &rhs) const |
| TFPrimitive & | operator[] (size_t i) |
| const TFPrimitive & | operator[] (size_t i) const |
| bool | remove (const TFPrimitive &primitive) |
| void | set (const_iterator begin, const_iterator end) |
| void | set (std::span< const TFPrimitiveData >) |
| void | setPosition (std::span< TFPrimitive * > primitives, double pos) |
| void | setType (TFPrimitiveSetType type) |
| size_t | size () const |
| TFPrimitiveSet (const std::vector< TFPrimitiveData > &values={}, TFPrimitiveSetType type=TFPrimitiveSetType::Relative) | |
| TFPrimitiveSet (const TFPrimitiveSet &rhs) | |
| TFPrimitiveSet (TFPrimitiveSet &&rhs) noexcept=default | |
| Public Member Functions inherited from inviwo::Observable< TFPrimitiveSetObserver > | |
| void | addObserver (TFPrimitiveSetObserver *observer) |
| bool | isObservedBy (TFPrimitiveSetObserver *observer) const |
| Observable< TFPrimitiveSetObserver > & | operator= (const Observable< TFPrimitiveSetObserver > &other) |
| void | removeObserver (TFPrimitiveSetObserver *observer) |
| virtual void | startBlockingNotifications () override final |
| virtual void | stopBlockingNotifications () override final |
| Public Member Functions inherited from inviwo::Observer | |
| Observer (const Observer &other) | |
| Observer (Observer &&other) | |
| Observer & | operator= (const Observer &other) |
| Observer & | operator= (Observer &&other) |
| void | removeObservation (ObservableInterface *observable) |
| void | removeObservations () |
| virtual | ~Observer () |
Static Public Member Functions | |
| static TransferFunction | load (const std::filesystem::path &path) |
| static void | save (const TransferFunction &tf, const std::filesystem::path &path) |
| static std::vector< TFPrimitiveData > | simplify (const std::vector< TFPrimitiveData > &points, double delta=0.01) |
Protected Member Functions | |
| virtual std::string_view | serializationItemKey () const override |
| virtual std::string_view | serializationKey () const override |
| Protected Member Functions inherited from inviwo::TFPrimitiveSet | |
| TFPrimitive & | add (std::unique_ptr< TFPrimitive > primitive) |
| vec4 | interpolateColor (double t) const |
| bool | remove (std::vector< std::unique_ptr< TFPrimitive > >::iterator it) |
| void | sort () |
| void | verifyPoint (const TFPrimitive &primitive) const |
| void | verifyPoint (const TFPrimitiveData &primitive) const |
| void | verifyPoint (double pos) const |
| Protected Member Functions inherited from inviwo::TFPrimitiveSetObservable | |
| void | notifyTFMaskChanged (const TFPrimitiveSet &set, dvec2 mask) |
| void | notifyTFPrimitiveAdded (const TFPrimitiveSet &set, TFPrimitive &p) |
| void | notifyTFPrimitiveChanged (const TFPrimitiveSet &set, const TFPrimitive &p) |
| void | notifyTFPrimitiveRemoved (const TFPrimitiveSet &set, TFPrimitive &p) |
| void | notifyTFTypeChanged (const TFPrimitiveSet &set, TFPrimitiveSetType type) |
| Protected Member Functions inherited from inviwo::Observable< TFPrimitiveSetObserver > | |
| void | forEachObserver (C callback) |
| Protected Member Functions inherited from inviwo::ObservableInterface | |
| void | addObservationHelper (Observer *observer) |
| virtual void | addObserver (Observer *observer)=0 |
| void | removeObservationHelper (Observer *observer) |
| virtual void | removeObserver (Observer *observer)=0 |
| Protected Member Functions inherited from inviwo::Observer | |
| void | addObservation (ObservableInterface *observable) |
Friends | |
| IVW_CORE_API bool | operator!= (const TransferFunction &lhs, const TransferFunction &rhs) |
| IVW_CORE_API bool | operator== (const TransferFunction &lhs, const TransferFunction &rhs) |
Additional Inherited Members | |
| Public Types inherited from inviwo::TFPrimitiveSet | |
| using | const_iterator |
| using | const_transform_t = const TFPrimitive& (*)(const TFPrimitive*) |
| using | iterator |
| using | transform_t = TFPrimitive& (*)(TFPrimitive*) |
| Protected Attributes inherited from inviwo::TFPrimitiveSet | |
| std::vector< TFPrimitive * > | sorted_ |
| std::vector< std::unique_ptr< TFPrimitive > > | values_ |
| Protected Attributes inherited from inviwo::Observer | |
| std::unordered_set< ObservableInterface * > | observables_ |
data structure for holding 1D transfer function data
|
overridevirtual |
Reimplemented from inviwo::TFPrimitiveSet.
|
overridevirtual |
Interpolate the color between all neighboring pairs of TFPrimitives and write the result to dataArray. The range of all TFPrimitives is [0,1] when TF type is relative
| data | write interpolated colors into data |
Reimplemented from inviwo::TFPrimitiveSet.
| vec4 inviwo::TransferFunction::sample | ( | double | v | ) | const |
Sample the transfer function at position v and return the respective color and opacity (rgba). The range of the transfer function is [0,1].
| v | sampling position, if v is outside the range [0,1] it is clamped to [0,1] |
| vec4 inviwo::TransferFunction::sample | ( | float | v | ) | const |
Sample the transfer function at position v and return the respective color and opacity (rgba). The range of the transfer function is [0,1].
| v | sampling position, if v is outside the range [0,1] it is clamped to [0,1] |
|
overrideprotectedvirtual |
Reimplemented from inviwo::TFPrimitiveSet.
|
overrideprotectedvirtual |
Reimplemented from inviwo::TFPrimitiveSet.
|
overridevirtual |
Reimplemented from inviwo::TFPrimitiveSet.
|
static |
Simplify a vector of TF points by removing points that can be replaced by interpolating between the previous and the next point, as long as the resulting error is less then delta. the error is the absolute maximal component wise error at the point to be removed.