ImFusion SDK 4.3
CastWrapper< CastT > Class Template Reference

#include <ImFusion/ImageMath/Poly/CastWrapper.h>

Cast expression. More...

+ Inheritance diagram for CastWrapper< CastT >:

Detailed Description

template<typename CastT>
class ImFusion::ImageMath::internal::CastWrapper< CastT >

Cast expression.

Public Member Functions

 CastWrapper (std::shared_ptr< ExprBase > operand)
 
std::unique_ptr< ExprBaseclone () const override
 Clone the current expression. May not return nullptr.
 
std::unique_ptr< ExprBasesubstituteVariableWithImg (const SharedImage &variable) const override
 
std::unique_ptr< ExprBasesubstituteVariableWithImg (const SharedImageSet &variable) const override
 Substitute all variables with variable.
 
void evalImpl (Array< SharedImage, void > &img) const override
 
void evalImpl (Array< SharedImageSet, void > &img) const override
 Implementation functionality used in eval()
 
std::unique_ptr< ExprBaseconvertToSharedImgExpr (std::size_t index) const override
 Convert a SharedImageSet expression to a SharedImage expression.
 
int numImgs () const override
 Return number of images of this expression.
 
ImageDescriptor imgDesc () const override
 Return ImageDescriptor of this expression. This reference is expected to remain the same while the class exists.
 
ExprType exprType () const override
 Return the ImFusion image type, i.e. NoImage, SharedImage, SharedImageSet.
 
DeviceStrategy deviceStrategy () const override
 Return DeviceStrategy of this expression.
 
GlExprInterfaceoperand () override
 
const GlExprInterfaceoperand () const override
 
- Public Member Functions inherited from ExprBase
ImageDescriptor imgDesc () const
 Return ImageDescriptor of the expression (forwards to the ExprInterface)
 
int numImgs () const
 Return the number of images of the expression (forwards to the ExprInterface)
 
template<typename T, typename ImgType = void>
auto evaluateIntoImage (bool clearShiftScale=false) const
 Evaluate expression into an image.
 
void eval (Array< SharedImage, void > &img, const SharedImage *variable) const
 
void eval (Array< SharedImage, void > &img) const
 Evaluate into SharedImage.
 
void eval (Array< SharedImageSet, void > &img, const SharedImageSet *variable) const
 Evaluate into SharedImageSet. Variable leafs will be substituted with variable.
 
void eval (Array< SharedImageSet, void > &img) const
 Evaluate into SharedImageSet.
 
internal::GlExprInterfaceglExprInterface ()
 
const internal::GlExprInterfaceglExprInterface () const
 
ExprInterfaceexprInterface ()
 
const ExprInterfaceexprInterface () const
 
template<typename Op>
reduction_type reduce (std::vector< vec4i > *arg=nullptr) const
 
std::unique_ptr< ExprBaseforceCPU () const
 Forces CPU execution.
 
std::unique_ptr< ExprBaseforceGPU () const
 Forces GPU execution.
 
std::unique_ptr< ExprBasechannelSwizzle (const std::vector< std::size_t > &indices) const
 
template<typename CastT>
std::unique_ptr< ExprBasecast () const
 
 ADD_REDUCTION_OP_DEF (sum, add)
 
 ADD_REDUCTION_OP_DEF (prod, mult)
 
 ADD_ARG_REDUCTION_OP_DEF (min, min)
 
 ADD_ARG_REDUCTION_OP_DEF (max, max)
 
Eigen::Matrix< double, Eigen::Dynamic, 1 > mean () const
 
Eigen::Matrix< double, Eigen::Dynamic, 1 > l1Norm () const
 
Eigen::Matrix< double, Eigen::Dynamic, 1 > squaredl2Norm () const
 
Eigen::Matrix< double, Eigen::Dynamic, 1 > l2Norm () const
 
Eigen::Matrix< double, Eigen::Dynamic, 1 > lpNorm (double p) const
 
Eigen::Matrix< double, Eigen::Dynamic, 1 > lInfNorm () const
 
- Public Member Functions inherited from CastWrapperGl
 CastWrapperGl (CastType castT)
 
template<typename T>
 CastWrapperGl (T)
 
std::string evalString (bool tagAndAssign=true) const override
 Print expression.
 
void tagAndAssignNames (std::unordered_map< internal::TaggingIndex, const void * > &taggedLeaves, std::unordered_map< std::type_index, int > &countPerLeafType, const std::string &prefix) const override
 We need to tag leaves and tell unique leaves that they are responsible to define the uniforms and set the shader arguments.
 
void getUniformDefinitionList (std::string &definitionList, const std::vector< int > &indices, const std::string &prefix) const override
 Collect uniform/sampler definitions.
 
void getVariableDefinitionList (std::string &definitionList, const std::vector< int > &indices, const std::string &prefix) const override
 Collect variable definitions.
 
int setArguments (GL::Program &p, const std::vector< int > &indices, const std::string &prefix) const override
 Set uniform/sampler arguments.
 
std::vector< internal::GlExprInterface * > children () override
 Used for traversing the expression tree. Contains the immediate children of node.
 
std::vector< const internal::GlExprInterface * > children () const override
 Used for traversing the expression tree. Contains the immediate children of node.
 
- Public Member Functions inherited from GlExprInterface
ExprInterfaceexprInterface ()
 Get image descriptor of the wrapped expression.
 
const ExprInterfaceexprInterface () const
 
virtual bool setMagFilter (ImageMath::MagFilter mag)
 Set interpolation behaviour of the current leaf (only)
 
virtual bool setWrap (ImageMath::Wrap wrap)
 Set interpolation behaviour of the current leaf (only)
 
bool setMagFilterRecursive (ImageMath::MagFilter mag)
 Set interpolation behaviour of the current leaf and all of its children.
 
bool setWrapRecursive (ImageMath::Wrap wrap)
 Set wrap behaviour of the current leaf and all of its children.
 

Additional Inherited Members

- Public Types inherited from ExprBase
enum class  ExprType { Scalar = 0 , SharedImage = 1 , SharedImageSet = 2 , Variable = 3 }
 
- Public Types inherited from CastWrapperGl
enum class  CastType {
  Bool , Char , UChar , Short ,
  UShort , Int , UInt , Float ,
  Double
}
 
- Protected Member Functions inherited from CastWrapperGl
template<typename T>
IMFUSION_EXPORT_NO_SDK CastType castType ()
 Helper function for getting a CastType from a C++ type.
 
GlExprInterfaceoperand ()
 
const GlExprInterfaceoperand () const
 
template<>
CastWrapperGl::CastType IMFUSION_EXPORT_NO_SDK castType ()
 
template<>
CastWrapperGl::CastType IMFUSION_EXPORT_NO_SDK castType ()
 
template<>
CastWrapperGl::CastType IMFUSION_EXPORT_NO_SDK castType ()
 
template<>
CastWrapperGl::CastType IMFUSION_EXPORT_NO_SDK castType ()
 
template<>
CastWrapperGl::CastType IMFUSION_EXPORT_NO_SDK castType ()
 
template<>
CastWrapperGl::CastType IMFUSION_EXPORT_NO_SDK castType ()
 
template<>
CastWrapperGl::CastType IMFUSION_EXPORT_NO_SDK castType ()
 
template<>
CastWrapperGl::CastType IMFUSION_EXPORT_NO_SDK castType ()
 
template<>
CastWrapperGl::CastType IMFUSION_EXPORT_NO_SDK castType ()
 
- Protected Attributes inherited from CastWrapperGl
CastType m_castT
 

Member Function Documentation

◆ clone()

template<typename CastT>
std::unique_ptr< ExprBase > clone ( ) const
inlineoverridevirtual

Clone the current expression. May not return nullptr.

Implements ExprBase.

◆ substituteVariableWithImg() [1/2]

template<typename CastT>
std::unique_ptr< ExprBase > substituteVariableWithImg ( const SharedImage & variable) const
inlineoverridevirtual

Substitute all variables with variable

Implements ExprBase.

◆ substituteVariableWithImg() [2/2]

template<typename CastT>
std::unique_ptr< ExprBase > substituteVariableWithImg ( const SharedImageSet & variable) const
inlineoverridevirtual

Substitute all variables with variable.

Implements ExprBase.

◆ evalImpl() [1/2]

template<typename CastT>
void evalImpl ( Array< SharedImage, void > & img) const
inlineoverridevirtual

Implementation functionality used in eval()

Implements ExprBase.

◆ evalImpl() [2/2]

template<typename CastT>
void evalImpl ( Array< SharedImageSet, void > & img) const
inlineoverridevirtual

Implementation functionality used in eval()

Implements ExprBase.

◆ convertToSharedImgExpr()

template<typename CastT>
std::unique_ptr< ExprBase > convertToSharedImgExpr ( std::size_t index) const
inlineoverridevirtual

Convert a SharedImageSet expression to a SharedImage expression.

Implements ExprBase.

◆ numImgs()

template<typename CastT>
int numImgs ( ) const
inlineoverridevirtual

Return number of images of this expression.

Implements ExprInterface.

◆ imgDesc()

template<typename CastT>
ImageDescriptor imgDesc ( ) const
inlineoverridevirtual

Return ImageDescriptor of this expression. This reference is expected to remain the same while the class exists.

Implements ExprInterface.

◆ exprType()

template<typename CastT>
ExprType exprType ( ) const
inlineoverridevirtual

Return the ImFusion image type, i.e. NoImage, SharedImage, SharedImageSet.

Implements ExprBase.

◆ deviceStrategy()

template<typename CastT>
DeviceStrategy deviceStrategy ( ) const
inlineoverridevirtual

Return DeviceStrategy of this expression.

Implements ExprInterface.

◆ operand() [1/2]

template<typename CastT>
GlExprInterface & operand ( )
inlineoverridevirtual

Implements UnaryWrapperBase.

◆ operand() [2/2]

template<typename CastT>
const GlExprInterface & operand ( ) const
inlineoverridevirtual

Implements UnaryWrapperBase.


The documentation for this class was generated from the following files:
Search Tab / S to search, Esc to close