6#include <Common/primitive_type.h>
27 SdlEnumType sdlEnum(
"math-image-op");
28 sdlEnum.description(
"The mathematical operation used on images.");
30 sdlEnum.addEntry(EnumType::Add,
"add");
31 sdlEnum.addEntry(EnumType::Subtract,
"sub");
32 sdlEnum.addEntry(EnumType::Multiply,
"mul");
33 sdlEnum.addEntry(EnumType::Divide,
"div");
34 sdlEnum.addEntry(EnumType::Power,
"pow");
35 sdlEnum.addEntry(EnumType::Absolute,
"abs");
36 sdlEnum.addEntry(EnumType::Clamp,
"clamp");
61 std::shared_ptr<Image> m_operandImage;
62 float64 m_scalarInput0;
63 float64 m_scalarInput1;
64 std::shared_ptr<Image> m_imageInput0;
65 std::shared_ptr<Image> m_imageInput1;
70 ClassType clazz(
"math");
71 clazz.docName(
"Math Image");
73 "This image applies mathematical modifications on other images, such as addition and "
75 clazz.baseOn<
Image>();
78 mathOp.description(
"The mathematical operation used.");
81 clazz.addField(mathOp);
84 operandImage.
description(
"The target image that is going to be operated on.");
86 clazz.addField(operandImage);
90 "First scalar input for the specified mathematical operation. This will only be used if "
91 "no image input is provided. Using scalar input is also more efficient than specifying "
92 "the scalar as a constant image input.");
95 clazz.addField(scalarInput0);
99 "Second scalar input for the specified mathematical operation. This will only be used if "
100 "no image input is provided. Using scalar input is also more efficient than specifying "
101 "the scalar as a constant image input.");
104 clazz.addField(scalarInput1);
107 imageInput0.
description(
"First input for the specified mathematical operation.");
109 clazz.addField(imageInput0);
112 imageInput1.
description(
"Second input for the specified mathematical operation.");
114 clazz.addField(imageInput1);
Information about the world being cooked.
Definition CookingContext.h:24
Definition MathImage.h:42
MathImage & setInputImage1(std::shared_ptr< Image > input)
Definition MathImage.cpp:409
MathImage & setScalarInput1(float64 value)
Definition MathImage.cpp:397
MathImage & setScalarInput0(float64 value)
Definition MathImage.cpp:391
MathImage & setOperation(EMathImageOp op)
Definition MathImage.cpp:379
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< MathImage >)
Definition MathImage.h:68
MathImage()
Definition MathImage.cpp:301
MathImage & setOperandImage(std::shared_ptr< Image > operand)
Definition MathImage.cpp:385
std::shared_ptr< TTexture< math::Spectrum > > genColorTexture(const CookingContext &ctx) override
Definition MathImage.cpp:346
std::shared_ptr< TTexture< Image::ArrayType > > genNumericTexture(const CookingContext &ctx) override
Definition MathImage.cpp:313
MathImage & setInputImage0(std::shared_ptr< Image > input)
Definition MathImage.cpp:403
Definition TSdlEnumField.h:23
SDL enum implementation with common features. Enum value and string mapping are done in a brute-force...
Definition TSdlGeneralEnum.h:26
SDL binding type for a canonical SDL resource class.
Definition TSdlOwnerClass.h:23
A field class that binds a floating point member variable.
Definition TSdlReal.h:21
A value that points to a SDL resource.
Definition TSdlReference.h:21
TSdlReference & optional()
Definition TSdlReference.ipp:214
TSdlReference & required()
Definition TSdlReference.ipp:228
TSdlReference & description(std::string descriptionStr)
Definition TSdlReference.ipp:206
TSdlValue & description(std::string descriptionStr)
Definition TSdlValue.ipp:95
TSdlValue & optional()
Definition TSdlValue.ipp:103
TSdlValue & defaultTo(T defaultValue)
Definition TSdlValue.ipp:71
The root for all renderer implementations.
Definition EEngineProject.h:6
EMathImageOp
Definition MathImage.h:15
#define PH_DEFINE_SDL_ENUM(...)
Define a SDL enum with function-like syntax.
Definition sdl_interface.h:142