double compress(double x, double lo, double hi)
double pnoise(const Vec3d &p, const Vec3d &period)
double dot(const Vec3d &a, const Vec3d &b)
double noise(int n, const Vec3d *args)
you may not use this file except in compliance with the License and the following modification to trademarks
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).  
< pre > Copyright Disney Inc All rights reserved Licensed under the Apache Version(the "License")
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
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)
A thread local evaluation context. Just allocate and fill in with data.
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
Factors a SeExpr into an editable expression with controls (i.e. value boxes, curve boxes)
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
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
<!-- 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
Vec3d up(const Vec3d &P, const Vec3d &upvec)
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
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
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
double atan2d(double y, double x)
A class that lets you register for the variables used by one or more expressions.
SeExpr2::CachedVoronoiFunc ExprFuncSimple pvoronoi(pvoronoiFn)
double snoise4(int n, const Vec3d *args)
clamp(0.2, 0.8)< br > $u  
int registerVariable(const std::string &name, const ExprType type)
Register a variable and return a handle.
static Context & global()
The global default context of the seexpr.
</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
<!-- 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
Context * createChildContext() const
Create a context that is a child of this context.
</b ></td >< td > apply The function on the right of the arrow is applied to the expression on the left< br > Examples
</b ></td >< td > equality
Defined as a *alpha b *alpha< br ></div >< br > float< b > boxstep</b >(float x, float a)< br > float< b >gaussstep</b >(float x
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
double remap(double x, double source, double range, double falloff, double interp)
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::CurveData voronoi
For< b ></b >< b ></b >< b ></b >< b ></b > etc
<!-- 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
When fbmScale is zero(the default)
For< b ></b >< b ></b >< b > cycle
</b ></td >< td > modulus(same as fmod function)</td ></tr >< tr >< td >< b >+ 
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" "$
For< b ></b >< b ></b >< b ></b >< b > spline
add_definitions(-DIMAGE_EDITOR_ROOT="${CMAKE_INSTALL_PREFIX}") if(ENABLE_QT5) find_package(Qt5 COMPONENTS Core Gui Widgets) include_directories($
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
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 $
VarBlock create(bool makeThreadSafe=false)
double length(const Vec3d &v)
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 $
</pre > To parallelize evaluation per a simple parallel_for can be used
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
</pre >< h3 > Binding our variable reference</h3 > If we now tried to use expressions
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
The remaining params are the same as for the fbm function< br > Voronoi types through
SeExpr2::PrintFuncX printf
</b ></td >< td > inequality</td ></tr >< tr >< td >< b > & amp
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
This is the same as the prman cellnoise function< br ></div >< br > float< b > float y< br > float< b > float y
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
double bias(double x, double b)
double smoothstep(double x, double a, double b)
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 $
fbm(vnoise($P)+ $P/4)< br ></div >< br >< h4 >< a name
The result is computed int int hiRange
install(TARGETS SeExprOp2 DESTINATION prman) foreach(SHADER_BASENAME testdisp testse) set(SHADER_FILE $
The result is computed int loRange
double expand(double x, double lo, double hi)
Defined as float g float a1
else() qt4_wrap_cpp(EDITOR_MOC_SRCS $
For< b ></b >< b ></b >< b ></b >< b ></b > will work just fine with vectors< br >< br > Arithmetic operators such as
double min(double x, double y)
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
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
The falloff shape is controlled by< i > interp</i > Numeric values or named constants may be used
Vec3d cnoise(const Vec3d &p)
Vec3d cross(const Vec3d &a, const Vec3d &b)
you may not use this file except in compliance with the License and the following modification to service marks
< br > vector< b > vturbulence</b >(vector v, int octaves = 6, float lacunarity = 2, float gain = 0.5)< br >< div style
void Noise(const T *in, T *out)
Noise with d_in dimensional domain, d_out dimensional abcissa.
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
you may not use this file except in compliance with the License and the following modification to it
The jitter param controls how irregular the pattern is(jitter=0 is like ordinary cellnoise).  
add_executable(asciiCalc2 "asciiCalculator.cpp") target_link_libraries(asciiCalc2 SeExpr2) install(TARGETS asciiCalc2 DESTINATION $
double max(double x, double y)
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
< b ></b >< br >< b ></b ></td >< td > vector constructor< br > vector component access n must be
Vec3d midhsi(int n, const Vec3d *args)
For any rgb or hsl value(except for negative s values)
include link_directories($ENV{RMANTREE}/lib) add_library(SeExprOp2 SHARED seop.cpp) target_link_libraries(SeExprOp2 prman $
pulling the curve up and values & lt
</pre > To parallelize evaluation per a simple parallel_for can be p blocked_range r
file(GLOB io_cpp "*.cpp") file(GLOB to_remove "ExprLLVMCodeGeneration.cpp") list(REMOVE_ITEM io_cpp $
</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
double hypot(double x, double y)
ExprType TypeVec(int n)
Quick way to get a vector type i.e. 3 vec is TypeVec(3)
Defined as a *alpha b *alpha< br ></div >< br > float< b > float a
double fit(double x, double a1, double b1, double a2, double b2)
This gives a more billowy appearance< br ></div >< br >< br > float< b > voronoi</b >(vector v, int type = 1, float jitter = 0.5, float fbmScale = 0, int fbmOctaves = 4, float fbmLacunarity = 2, float fbmGain = 0.5)< br > color< b >cvoronoi</b >(vector v
Vec3d vnoise(const Vec3d &p)
double *& Pointer(uint32_t variableOffset)
Get a reference to the data block pointer which can be modified.
This can be useful to scale the noise frequency for instance
double wchoose(int n, double *params)
double gamma(double x, double g)
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 > * 
set_source_files_properties("ExprBuiltins.cpp" PROPERTIES COMPILE_DEFINITIONS "__STDC_LIMIT_MACROS") include_directories($
Vec3d rgbtohsl(const Vec3d &rgb)
SeExpr2::CachedVoronoiFunc ExprFuncSimple cvoronoi(cvoronoiFn)
< 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.  
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
ParameterMap _parameters
Attribute/value pairs.
< pre > Copyright Disney Inc All rights reserved Licensed under the Apache License
include_directories(${CMAKE_BINARY_DIR}/src/SeExpr2) add_executable(asciiGraph2 "asciiGraph.cpp") target_link_libraries(asciiGraph2 SeExpr2) install(TARGETS asciiGraph2 DESTINATION $
Defined as float g float float float a2
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
For< b ></b >< b > choose
Defined as x< br >< br > float< b > remap</b >(float x, float source, float range, float falloff, int interp)< br >< div style
</pre > To parallelize evaluation per particle
Defined as float g float float b1
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
< pre > Copyright Disney Enterprises
For c from the contrast is decreased & nbsp
Base class for all controls for Expressions.
double angle(const Vec3d &a, const Vec3d &b)
double boxstep(double x, double a)
void setParameter(const std::string ¶meterName, const std::string &value)
Set a parameter. NOTE: this must be done when no threads are accessing lookupParameter for safety.
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]).  
double turbulence(int n, const Vec3d *args)
If a scalar is used in a vector context
When x is within< i > range</i > of source
</b ></td >< td > multiply
SeExpr2::CurveFuncX curve
This is the same as the prman cellnoise function< br ></div >< br > float< b > float y< br > float< b > float float z
hsi(20, 1.2, 1, $Cs -> gamma(1.2))</td ></tr ></tbody ></table >< br >< h4 >< a name
double hash(int n, double *args)
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"
</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
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" "$
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
double cellnoise(const Vec3d &p)
double gaussstep(double x, double a, double b)
< br > pow($a, 0.5)+ $b< br >< br ></div > External variables can also be overridden by local assignment.  
Vec3d cfbm(int n, const Vec3d *args)
Vec3d norm(const Vec3d &a)
</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
<!-- 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
For a multi line expression