SeExpr

Context.cpp
Go to the documentation of this file.
1 /*
2 * Copyright Disney Enterprises, Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License
6 * and the following modification to it: Section 6 Trademarks.
7 * deleted and replaced with:
8 *
9 * 6. Trademarks. This License does not grant permission to use the
10 * trade names, trademarks, service marks, or product names of the
11 * Licensor and its affiliates, except as required for reproducing
12 * the content of the NOTICE file.
13 *
14 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
16 */
17 #include "Context.h"
18
19 using namespace SeExpr2;
20
21 Context::Context(const Context* parent) : _parent(parent) {}
22
23 void Context::setParameter(const std::string& parameterName, const std::string& value) {
24 _parameters[parameterName] = value;
25 }
26
27 Context* Context::createChildContext() const { return new Context(this); }
28
29 Context& Context::global() {
30 static Context context(0);
31 return context;
32 }
SeExpr2::compress
double compress(double x, double lo, double hi)
Definition: ExprBuiltins.cpp:92
example
For example
Definition: userdoc.txt:446
SeExpr2::pnoise
double pnoise(const Vec3d &p, const Vec3d &period)
Definition: ExprBuiltins.cpp:749
ExprColorCurve
Definition: ExprColorCurve.h:137
SeExpr2::dot
double dot(const Vec3d &a, const Vec3d &b)
Definition: ExprBuiltins.cpp:1072
ExprDeepWater
Definition: ExprDeepWater.h:248
SeExpr2::noise
double noise(int n, const Vec3d *args)
Definition: ExprBuiltins.cpp:461
trademarks
you may not use this file except in compliance with the License and the following modification to trademarks
Definition: license.txt:10
index
The result is computed int int< br >< div style="margin-left: 40px;"> Picks values randomly between loRange and hiRange based on supplied index(which is automatically hashed). &nbsp
Version
< pre > Copyright Disney Inc All rights reserved Licensed under the Apache Version(the "License")
Operators
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int float float int< br > Interpolates a ramp defined by control points at param Control points are specified by triples of parameters and interp_i Interpolation codes are float float float float< br > Interpolates a set of values to the parameter specified where yn are distributed evenly from[0...1]</p >< h4 >< a name="Misc_Functions"></a > Misc Functions</h4 >< p > void< b > you would get test[4, 5, 6]</p >< h4 >< a name="Operators"></a > Operators(listed in decreasing precedence)</h4 >< table cellpadding
f
with numParticles numAttributes A variable block contains variable names and types but doesn t care what the values are< pre > void f(const std::string &s, MyParticleData *p, int outputDim=3)
Definition: varblocks.txt:35
ExprShortEdit
Definition: ExprShortEdit.h:45
for
for(int i=0;i &lt;w;i++)
Definition: tutorial.txt:193
SeExpr2::VarBlock
A thread local evaluation context. Just allocate and fill in with data.
Definition: VarBlock.h:33
pos_i
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int float float int< br > Interpolates a ramp defined by control points at param Control points are specified by triples of parameters pos_i
Definition: userdoc.txt:459
ExprEditor
Definition: ExprEditor.h:94
EditableExpression
Factors a SeExpr into an editable expression with controls (i.e. value boxes, curve boxes)
Definition: EditableExpression.h:29
none
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are none
Definition: userdoc.txt:456
linear
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are linear
Definition: userdoc.txt:456
Masking
<!-- Copyright Disney Enterprises, Inc. All rights reserved. Licensed under the Apache License, Version 2.0(the "License");you may not use this file except in compliance with the License and the following modification to it:Section 6 Trademarks. deleted and replaced with:6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor and its affiliates, except as required for reproducing the content of the NOTICE file. You may obtain a copy of the License at http:-->< h3 > Shader XGen Paint3d Expressions</h3 >< ul >< li >< a href="#Variables"> Variables</a ></li >< li >< a href="#Color_Masking_and_Remapping_Functions"> Masking
Definition: userdoc.txt:21
SeExpr2::up
Vec3d up(const Vec3d &P, const Vec3d &upvec)
Definition: ExprBuiltins.cpp:1122
SeExpr2::map
SeExpr2::MapFuncX map
myblock
e evalMultiple & myblock
Definition: varblocks.txt:78
pos0
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float pos0
Definition: userdoc.txt:459
smooth
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are smooth
Definition: userdoc.txt:456
pos1
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int float pos1
Definition: userdoc.txt:459
SeExpr2::atan2d
double atan2d(double y, double x)
Definition: ExprBuiltins.h:37
add
</b ></td >< td > add
Definition: userdoc.txt:504
SeExpr2::VarBlockCreator
A class that lets you register for the variables used by one or more expressions.
Definition: VarBlock.h:84
ExprBrowser
Definition: ExprBrowser.h:43
SeExpr2::pvoronoi
SeExpr2::CachedVoronoiFunc ExprFuncSimple pvoronoi(pvoronoiFn)
SeExpr2::snoise4
double snoise4(int n, const Vec3d *args)
Definition: ExprBuiltins.cpp:526
clamp
clamp(0.2,&nbsp;0.8)< br > $u &nbsp
divide
</b ></td >< td > divide
Definition: userdoc.txt:500
SeExpr2::VarBlockCreator::registerVariable
int registerVariable(const std::string &name, const ExprType type)
Register a variable and return a handle.
Definition: VarBlock.h:101
SeExpr2::Context::global
static Context & global()
The global default context of the seexpr.
Definition: Context.cpp:29
pick
For< b > pick
Definition: userdoc.txt:443
SeExpr2::asind
double asind(double x)
Definition: ExprBuiltins.h:35
variables
</pre > Once we have this we need an instance to store our variable and provide a reference to that We make it because it may be useful to use the same ExprVarRef from multiple expressions ! For if you have expressions that all have access to the same variables
Definition: tutorial.txt:128
Saturation
< br > HSL is Saturation
Definition: userdoc.txt:147
accessible
<!-- Copyright Disney Enterprises, Inc. All rights reserved. Licensed under the Apache License, Version 2.0(the "License");you may not use this file except in compliance with the License and the following modification to it:Section 6 Trademarks. deleted and replaced with:6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor and its affiliates, except as required for reproducing the content of the NOTICE file. You may obtain a copy of the License at http:-->< h2 > Programmer Tutorial</h2 >< p > Getting started with SeExpr is relatively easy SeExpr gives you a way to evaluate one or many evaluations of an expression What changes between different applications of expressions is mainly the particular variables that are accessible(sometimes also the set of functions). Each application of expressions generally has it 's own subclass of Expression that gets instantiated. To get started we 're going to go through a simple application that is an ascii graphing calculator. This is located in the src/demos/asciiGraph.cpp part of the source tree.< p >< h2 >Problem Overview</h2 > We are going to write a function grapher that displays in ASCII. In particular for a given f(x) we can evaluate it at all the x 's in a window and draw the resulting y 's. For example if the user ran our program< pre > ./asciiGraph "val
SeExpr2::Context::createChildContext
Context * createChildContext() const
Create a context that is a child of this context.
Definition: Context.cpp:27
SeExpr2::rand
SeExpr2::RandFuncX rand
SeExpr2::round
double round(double x)
Definition: ExprBuiltins.h:41
Examples
</b ></td >< td > apply The function on the right of the arrow is applied to the expression on the left< br > Examples
Definition: userdoc.txt:532
equality
</b ></td >< td > equality
Definition: userdoc.txt:511
boxstep</b >
Defined as a *alpha b *alpha< br ></div >< br > float< b > boxstep</b >(float x, float a)< br > float< b >gaussstep</b >(float x
gt
For c & gt
Definition: userdoc.txt:101
val_i
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > val_i
Definition: userdoc.txt:456
SeExpr2::remap
double remap(double x, double source, double range, double falloff, double interp)
Definition: ExprBuiltins.cpp:177
linearstep</b >
Defined as a *alpha b *alpha< br ></div >< br > float< b > float float b< br > float< b > linearstep</b >(float x, float a, float b)< br > float< b >smoothstep</b >(float x
SeExpr2::voronoi
SeExpr2::CurveData voronoi
etc
For< b ></b >< b ></b >< b ></b >< b ></b > etc
Definition: userdoc.txt:443
resolveVar
<!-- Copyright Disney Enterprises, Inc. All rights reserved. Licensed under the Apache License, Version 2.0(the "License");you may not use this file except in compliance with the License and the following modification to it:Section 6 Trademarks. deleted and replaced with:6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor and its affiliates, except as required for reproducing the content of the NOTICE file. You may obtain a copy of the License at http:-->< p > You can still define resolveVar() and resolveFunc() methods in your custom expression classes
zero
When fbmScale is zero(the default)
SeExpr2::sind
double sind(double x)
Definition: ExprBuiltins.h:32
cycle
For< b ></b >< b ></b >< b > cycle
Definition: userdoc.txt:443
modulus
</b ></td >< td > modulus(same as fmod function)</td ></tr >< tr >< td >< b >+&nbsp
$P
< br > $P
Definition: userdoc.txt:79
SeExpr2::invert
double invert(double x)
Definition: ExprBuiltins.h:46
find_program
find_program(BISON_EXE bison) find_program(FLEX_EXE flex) find_program(SED_EXE sed) if((BISON_EXE STREQUAL "BISON_EXE-NOTFOUND") OR(FLEX_EXE STREQUAL "FLEX_EXE-NOTFOUND") OR(SED_EXE STREQUAL "SED_EXE-NOTFOUND")) set(parser_cpp generated/ExprParser.cpp generated/ExprParserLex.cpp) else() add_custom_command(SOURCE "ExprParserLex.l" COMMAND "flex" ARGS "-oExprParserLexIn.cpp" "$
Definition: CMakeLists.txt:31
spline
For< b ></b >< b ></b >< b ></b >< b > spline
Definition: userdoc.txt:443
add_definitions
add_definitions(-DIMAGE_EDITOR_ROOT="${CMAKE_INSTALL_PREFIX}") if(ENABLE_QT5) find_package(Qt5 COMPONENTS Core Gui Widgets) include_directories($
Definition: CMakeLists.txt:18
interp0
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int interp0
Definition: userdoc.txt:459
Intuitively
Intuitively
Definition: userdoc.txt:183
set
generated ExprParser cpp dev null OUTPUT ExprParser cpp DEPENDS y tab c ExprParser tab h set(parser_cpp ExprParser.cpp ExprParserLex.cpp) endif() file(GLOB llvm_cpp "*.cpp") if(NOT WIN32) add_library(SeExpr2 SHARED $
Definition: CMakeLists.txt:79
SeExpr2::Context
Definition: Context.h:24
SeExpr2::VarBlockCreator::create
VarBlock create(bool makeThreadSafe=false)
Definition: VarBlock.h:121
At
At
Definition: userdoc.txt:136
SeExpr2::length
double length(const Vec3d &v)
Definition: ExprBuiltins.cpp:1062
endif
endif() set(ANIMLIB_SRCS "") if(DEFINED ANIMLIB_DIR) set(CE_MOC_HDRS CE/CECurveListUI.h CE/CEDragHandlers.h CE/CEGraphCurve.h CE/CEGraphKey.h CE/CEGraphSeg.h CE/CEGraphUI.h CE/CEMainUI.h CE/CESegEditUI.h CE/CETool.h) set(CE_CPPS CE/CECurveListUI.cpp CE/CEDragHandlers.cpp CE/CEGraphCurve.cpp CE/CEGraphKey.cpp CE/CEGraphSeg.cpp CE/CEGraphUI.cpp CE/CEMainUI.cpp CE/CESegEditUI.cpp CE/CETool.cpp) if(ENABLE_QT5) qt5_wrap_cpp(CE_MOC_SRCS $
Definition: CMakeLists.txt:47
ExprControlCollection
Definition: ExprControlCollection.h:81
used
</pre > To parallelize evaluation per a simple parallel_for can be used
Definition: varblocks.txt:73
y1
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int float float int< br > Interpolates a ramp defined by control points at param Control points are specified by triples of parameters and interp_i Interpolation codes are float y1
Definition: userdoc.txt:464
expressions
</pre >< h3 > Binding our variable reference</h3 > If we now tried to use expressions
Definition: tutorial.txt:140
cellnoise</b >
Any number of seeds may be given and the result will be a random function based on all the seeds< br ></div > float< b > cellnoise</b >(vector v) float< b >cellnoise1</b >(float x)< br > float< b >cellnoise2</b >(float x
through
The remaining params are the same as for the fbm function< br > Voronoi types through
Definition: userdoc.txt:306
SeExpr2::printf
SeExpr2::PrintFuncX printf
amp
</b ></td >< td > inequality</td ></tr >< tr >< td >< b > & amp
Definition: userdoc.txt:511
val0
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float val0
Definition: userdoc.txt:459
y
This is the same as the prman cellnoise function< br ></div >< br > float< b > float y< br > float< b > float y
Definition: userdoc.txt:218
happens
the full shift happens
Definition: userdoc.txt:136
monotone
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are monotone(non-oscillating) spline</p >< p > float< b >curve</b >(float param
SeExpr2::bias
double bias(double x, double b)
Definition: ExprBuiltins.cpp:110
SeExpr2::smoothstep
double smoothstep(double x, double a, double b)
Definition: ExprBuiltins.cpp:143
Hue
< br > HSL is Hue
Definition: userdoc.txt:147
if
if(EXISTS "/usr/share/apps/cmake/modules") list(APPEND CMAKE_MODULE_PATH "/usr/share/apps/cmake/modules") endif() find_package(OpenGL) if(Qt5_FOUND OR QT4_FOUND) BuildParserScanner(ExprSpecParserLex ExprSpecParser ExprSpec editor_parser_cpp) set(EDITOR_MOC_HDRS ExprBrowser.h ExprColorCurve.h ExprColorSwatch.h ExprControlCollection.h ExprControl.h ExprCurve.h ExprDialog.h ExprEditor.h ExprFileDialog.h ExprGrapher2d.h ExprPopupDoc.h ExprShortEdit.h ExprDeepWater.h) set(EDITOR_CPPS ExprFileDialog.cpp ExprControl.cpp ExprEditor.cpp ExprMain.cpp ExprShortEdit.cpp ExprCurve.cpp ExprColorCurve.cpp ExprColorSwatch.cpp EditableExpression.cpp ExprPopupDoc.cpp ExprCompletionModel.cpp ExprDialog.cpp ExprControlCollection.cpp ExprGrapher2d.cpp ExprBrowser.cpp BasicExpression.cpp ExprDeepWater.cpp) if(ENABLE_QT5) qt5_wrap_cpp(EDITOR_MOC_SRCS $
Definition: CMakeLists.txt:16
fbm
fbm(vnoise($P)+ $P/4)< br ></div >< br >< h4 >< a name
hiRange
The result is computed int int hiRange
Definition: userdoc.txt:322
SeExpr2
Definition: Context.h:22
contrast
contrast(.7) - &gt
install
install(TARGETS SeExprOp2 DESTINATION prman) foreach(SHADER_BASENAME testdisp testse) set(SHADER_FILE $
Definition: CMakeLists.txt:26
loRange
The result is computed int loRange
Definition: userdoc.txt:322
SeExpr2::expand
double expand(double x, double lo, double hi)
Definition: ExprBuiltins.cpp:95
a1
Defined as float g float a1
Definition: userdoc.txt:162
else
else() qt4_wrap_cpp(EDITOR_MOC_SRCS $
Definition: CMakeLists.txt:45
point
At the mid point
Definition: userdoc.txt:136
$b
< br > $b
Definition: userdoc.txt:72
as
For< b ></b >< b ></b >< b ></b >< b ></b > will work just fine with vectors< br >< br > Arithmetic operators such as
Definition: userdoc.txt:443
SeExpr2::min
double min(double x, double y)
Definition: ExprBuiltins.h:43
noise</b >
This is the same as the prman cellnoise function< br ></div >< br > float< b > noise</b >(vector v)< br > float< b >noise</b >(float x
interp1
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int float float int interp1
Definition: userdoc.txt:459
used
The falloff shape is controlled by< i > interp</i > Numeric values or named constants may be used
Definition: userdoc.txt:116
SeExpr2::cnoise
Vec3d cnoise(const Vec3d &p)
Definition: ExprBuiltins.cpp:521
SeExpr2::cross
Vec3d cross(const Vec3d &a, const Vec3d &b)
Definition: ExprBuiltins.cpp:1088
marks
you may not use this file except in compliance with the License and the following modification to service marks
Definition: license.txt:10
vturbulence</b >
< br > vector< b > vturbulence</b >(vector v, int octaves &nbsp;=&nbsp;6, float lacunarity &nbsp;=&nbsp;2, float gain &nbsp;=&nbsp;0.5)< br >< div style
SeExpr2::Noise
void Noise(const T *in, T *out)
Noise with d_in dimensional domain, d_out dimensional abcissa.
Definition: Noise.cpp:163
y4
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int float float int< br > Interpolates a ramp defined by control points at param Control points are specified by triples of parameters and interp_i Interpolation codes are float float float float y4
Definition: userdoc.txt:464
it
you may not use this file except in compliance with the License and the following modification to it
Definition: license.txt:10
to
For c from to
Definition: userdoc.txt:101
is
The jitter param controls how irregular the pattern is(jitter=0 is like ordinary cellnoise). &nbsp
add_executable
add_executable(asciiCalc2 "asciiCalculator.cpp") target_link_libraries(asciiCalc2 SeExpr2) install(TARGETS asciiCalc2 DESTINATION $
Definition: CMakeLists.txt:22
SeExpr2::Expression
main expression class
Definition: Expression.h:76
SeExpr2::max
double max(double x, double y)
Definition: ExprBuiltins.h:42
mix</b >
Defined as float g float float float float b2< div style="margin-left: 40px;"> Linear remapping of[a1..x..b1] to[a2..x..b2]< br ></div > float< b > mix</b >(float a, float b, float alpha)< div style
be
< b ></b >< br >< b ></b ></td >< td > vector constructor< br > vector component access n must be
Definition: userdoc.txt:484
SeExpr2::midhsi
Vec3d midhsi(int n, const Vec3d *args)
Definition: ExprBuiltins.cpp:247
value
For any rgb or hsl value(except for negative s values)
link_directories
include link_directories($ENV{RMANTREE}/lib) add_library(SeExprOp2 SHARED seop.cpp) target_link_libraries(SeExprOp2 prman $
Definition: CMakeLists.txt:22
lt
pulling the curve up and values & lt
Definition: userdoc.txt:157
ExprPopupDoc
Definition: ExprPopupDoc.h:23
r
</pre > To parallelize evaluation per a simple parallel_for can be p blocked_range r
Definition: varblocks.txt:76
file
file(GLOB io_cpp "*.cpp") file(GLOB to_remove "ExprLLVMCodeGeneration.cpp") list(REMOVE_ITEM io_cpp $
Definition: CMakeLists.txt:17
evaluation
</pre >< h3 > Binding our variable reference</h3 > If we now tried to use the variable would still not be found by our expressions To make it bindable we need to override the resolveVar() function as follows</pre >< h3 > Variable setting</h3 > Next we need to make a way of setting the variable As the controlling code will use the expression evaluation
Definition: tutorial.txt:141
SeExpr2::hypot
double hypot(double x, double y)
Definition: ExprBuiltins.cpp:1067
SeExpr2::TypeVec
ExprType TypeVec(int n)
Quick way to get a vector type i.e. 3 vec is TypeVec(3)
Definition: ExprType.h:230
at
the full shift and at
Definition: userdoc.txt:136
SeExpr2::deg
double deg(double angle)
Definition: ExprBuiltins.h:29
a
Defined as a *alpha b *alpha< br ></div >< br > float< b > float a
Definition: userdoc.txt:174
SeExpr2::fit
double fit(double x, double a1, double b1, double a2, double b2)
Definition: ExprBuiltins.cpp:101
voronoi</b >
This gives a more billowy appearance< br ></div >< br >< br > float< b > voronoi</b >(vector v, int type &nbsp;=&nbsp;1, float jitter &nbsp;=&nbsp;0.5, float fbmScale &nbsp;=&nbsp;0, int fbmOctaves &nbsp;=&nbsp;4, float fbmLacunarity &nbsp;=&nbsp;2, float fbmGain &nbsp;=&nbsp;0.5)< br > color< b >cvoronoi</b >(vector v
SeExpr2::vnoise
Vec3d vnoise(const Vec3d &p)
Definition: ExprBuiltins.cpp:511
SeExpr2::VarBlock::Pointer
double *& Pointer(uint32_t variableOffset)
Get a reference to the data block pointer which can be modified.
Definition: VarBlock.h:57
instance
This can be useful to scale the noise frequency for instance
Definition: userdoc.txt:78
SeExpr2::wchoose
double wchoose(int n, double *params)
Definition: ExprBuiltins.cpp:1219
BasicExpression
Definition: BasicExpression.h:30
style
"margin-left: 40px style
Definition: userdoc.txt:70
SeExpr2::gamma
double gamma(double x, double g)
Definition: ExprBuiltins.cpp:107
$a
< br > $a
Definition: userdoc.txt:71
ExprDialog
Definition: ExprDialog.h:44
ExprCompletionModel
Definition: ExprCompletionModel.h:30
exponentiation
e g $P[0]</td ></tr >< tr >< td >< b ></b ></td >< td > exponentiation(same as pow function)</td ></tr >< tr >< td >< b >!</b ></td >< td >logical NOT</td ></tr >< tr >< td >< b >~</b ></td >< td >inversion(i.e. ~ $A gives the same result as 1- $A)</td ></tr >< tr >< td >< b > *&nbsp
set_source_files_properties
set_source_files_properties("ExprBuiltins.cpp" PROPERTIES COMPILE_DEFINITIONS "__STDC_LIMIT_MACROS") include_directories($
Definition: CMakeLists.txt:21
SeExpr2::rgbtohsl
Vec3d rgbtohsl(const Vec3d &rgb)
Definition: ExprBuiltins.cpp:285
SeExpr2::cvoronoi
SeExpr2::CachedVoronoiFunc ExprFuncSimple cvoronoi(cvoronoiFn)
Lightness
< br > HSL is Lightness(all in range[0..1])< br > These functions have also been extended to support rgb and hsl values outside of the range[0..1] in a reasonable way. &nbsp
affiliates
you may not use this file except in compliance with the License and the following modification to service or product names of the Licensor and its affiliates
Definition: license.txt:10
SeExpr2::Context::_parameters
ParameterMap _parameters
Attribute/value pairs.
Definition: Context.h:68
License
< pre > Copyright Disney Inc All rights reserved Licensed under the Apache License
Definition: license.txt:2
include_directories
include_directories(${CMAKE_BINARY_DIR}/src/SeExpr2) add_executable(asciiGraph2 "asciiGraph.cpp") target_link_libraries(asciiGraph2 SeExpr2) install(TARGETS asciiGraph2 DESTINATION $
Definition: CMakeLists.txt:16
SeExpr2::Context::Context
Context(const Context &)
a2
Defined as float g float float float a2
Definition: userdoc.txt:162
y3
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int float float int< br > Interpolates a ramp defined by control points at param Control points are specified by triples of parameters and interp_i Interpolation codes are float float float y3
Definition: userdoc.txt:464
choose
For< b ></b >< b > choose
Definition: userdoc.txt:443
p
static const int p[514]
Definition: NoiseTables.h:20
remap</b >
Defined as x< br >< br > float< b > remap</b >(float x, float source, float range, float falloff, int interp)< br >< div style
particle
</pre > To parallelize evaluation per particle
Definition: varblocks.txt:73
b1
Defined as float g float float b1
Definition: userdoc.txt:162
y2
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int float float int< br > Interpolates a ramp defined by control points at param Control points are specified by triples of parameters and interp_i Interpolation codes are float float y2
Definition: userdoc.txt:464
Enterprises
< pre > Copyright Disney Enterprises
Definition: license.txt:2
ExprFileDialog
Definition: ExprFileDialog.h:42
nbsp
For c from the contrast is decreased & nbsp
Definition: userdoc.txt:101
ExprControl
Base class for all controls for Expressions.
Definition: ExprControl.h:54
SeExpr2::angle
double angle(const Vec3d &a, const Vec3d &b)
Definition: ExprBuiltins.cpp:1095
SeExpr2::boxstep
double boxstep(double x, double a)
Definition: ExprBuiltins.cpp:128
SeExpr2::Context::setParameter
void setParameter(const std::string &parameterName, const std::string &value)
Set a parameter. NOTE: this must be done when no threads are accessing lookupParameter for safety.
Definition: Context.cpp:23
components
If a scalar is used in a vector it is replicated into the three components(e.g. 0.5 becomes[0.5, 0.5, 0.5]). &nbsp
ExprCurve
Definition: ExprCurve.h:116
SeExpr2::turbulence
double turbulence(int n, const Vec3d *args)
Definition: ExprBuiltins.cpp:551
context
If a scalar is used in a vector context
Definition: userdoc.txt:436
source
When x is within< i > range</i > of source
Definition: userdoc.txt:111
multiply
</b ></td >< td > multiply
Definition: userdoc.txt:500
SeExpr2::curve
SeExpr2::CurveFuncX curve
z
This is the same as the prman cellnoise function< br ></div >< br > float< b > float y< br > float< b > float float z
Definition: userdoc.txt:218
hsi
hsi(20,&nbsp;1.2,&nbsp;1,&nbsp;$Cs &nbsp;-&gt;&nbsp;gamma(1.2))</td ></tr ></tbody ></table >< br >< h4 >< a name
SeExpr2::hash
double hash(int n, double *args)
Definition: ExprBuiltins.cpp:409
printf</b >
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int float float int< br > Interpolates a ramp defined by control points at param Control points are specified by triples of parameters and interp_i Interpolation codes are float float float float< br > Interpolates a set of values to the parameter specified where yn are distributed evenly from[0...1]</p >< h4 >< a name="Misc_Functions"></a > Misc Functions</h4 >< p > void< b > printf</b >(string format,[param0, param1,...])< br > Prints a string to stdout that is formatted as given. Formatting parameters possible are %f for float(takes first component of vector argument) or %v for vector. For example if you wrote printf("test %f %v"
x
</pre >< h3 > A simple variable reference</h3 > This is not a very interesting subclass of expression until we add some additional variables Variables on some applications may be very dynamic In this we only need x
Definition: tutorial.txt:108
add_custom_command
ExprParserLex l OUTPUT ExprParserLexIn cpp DEPENDS ExprParserLex l add_custom_command(SOURCE "ExprParserLexIn.cpp" COMMAND "sed" ARGS -e "'s/SeExprwrap(n)/SeExprwrap()/g'" -e "'s/yy/SeExpr2/g'" -e "'s/YY/SeExprYY/g'" ExprParserLexIn.cpp|tee ExprParserLex.cpp ${CMAKE_CURRENT_SOURCE_DIR}/generated/ExprParserLex.cpp >/dev/null OUTPUT ExprParserLex.cpp DEPENDS ExprParserLexIn.cpp) add_custom_command(SOURCE "ExprParser.y" COMMAND "bison" ARGS "--defines" "--verbose" "--fixed-output-files" "-p" "SeExpr2" "$
Definition: CMakeLists.txt:50
b
Between a and b
Definition: userdoc.txt:180
val1
For applying the gamma function to a map adjusts the gamma of all three color channels< br >< br >< h4 >< a name="Curve_Functions"></a > Curve Functions</h4 >< p > Interpolation of parameter values to a set of control points is governed by the following functions</p >< p > color< b > and interp_i Interpolation codes are float float int float float val1
Definition: userdoc.txt:459
SeExpr2::cellnoise
double cellnoise(const Vec3d &p)
Definition: ExprBuiltins.cpp:727
SeExpr2::gaussstep
double gaussstep(double x, double a, double b)
Definition: ExprBuiltins.cpp:160
pow
< br > pow($a, 0.5)+ $b< br >< br ></div > External variables can also be overridden by local assignment. &nbsp
SeExpr2::cfbm
Vec3d cfbm(int n, const Vec3d *args)
Definition: ExprBuiltins.cpp:721
SeExpr2::norm
Vec3d norm(const Vec3d &a)
Definition: ExprBuiltins.cpp:1077
example
</pre > Once we have this we need an instance to store our variable and provide a reference to that We make it because it may be useful to use the same ExprVarRef from multiple expressions ! For example
Definition: tutorial.txt:128
Context.h
Color
<!-- Copyright Disney Enterprises, Inc. All rights reserved. Licensed under the Apache License, Version 2.0(the "License");you may not use this file except in compliance with the License and the following modification to it:Section 6 Trademarks. deleted and replaced with:6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor and its affiliates, except as required for reproducing the content of the NOTICE file. You may obtain a copy of the License at http:-->< h3 > Shader XGen Paint3d Expressions</h3 >< ul >< li >< a href="#Variables"> Variables</a ></li >< li >< a href="#Color_Masking_and_Remapping_Functions"> Color
Definition: userdoc.txt:21
expression
For a multi line expression
Definition: userdoc.txt:551