SeExpr
Classes | Namespaces | Macros | Typedefs | Functions | Variables
ExprBuiltins.cpp File Reference
#include <cassert>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <algorithm>
#include <cfloat>
#include "ExprFunc.h"
#include "ExprNode.h"
#include "Vec.h"
#include "Curve.h"
#include "ExprBuiltins.h"
#include "Platform.h"
#include "Noise.h"
#include "Interpreter.h"

Go to the source code of this file.

Classes

struct  SeExpr2::VoronoiPointData
 
class  SeExpr2::CachedVoronoiFunc
 
struct  SeExpr2::CurveData< T >
 
class  SeExpr2::CurveFuncX
 
class  SeExpr2::CCurveFuncX
 
class  SeExpr2::GetVar
 
struct  SeExpr2::GetVar::Data
 
struct  SeExpr2::GetVar::Assign< d >
 
class  SeExpr2::PrintFuncX
 
struct  SeExpr2::PrintFuncX::Data
 

Namespaces

 SeExpr2
 

Macros

#define FUNCADOC(name, func)   define3(name, ExprFunc(::func), func##_docstring)
 
#define FUNCDOC(func)   define3(#func, ExprFunc(::func), func##_docstring)
 
#define FUNCDOC(func)   define3(#func, ExprFunc(SeExpr2::func), func##_docstring)
 
#define FUNCNDOC(func, min, max)   define3(#func, ExprFunc(SeExpr2::func, min, max), func##_docstring)
 

Typedefs

typedef Vec3d VoronoiFunc (VoronoiPointData &data, int n, const Vec3d *args)
 

Functions

double SeExpr2::compress (double x, double lo, double hi)
 
double SeExpr2::expand (double x, double lo, double hi)
 
double SeExpr2::fit (double x, double a1, double b1, double a2, double b2)
 
double SeExpr2::gamma (double x, double g)
 
double SeExpr2::bias (double x, double b)
 
double SeExpr2::contrast (double x, double c)
 
double SeExpr2::boxstep (double x, double a)
 
double SeExpr2::linearstep (double x, double a, double b)
 
double SeExpr2::smoothstep (double x, double a, double b)
 
double SeExpr2::gaussstep (double x, double a, double b)
 
double SeExpr2::remap (double x, double source, double range, double falloff, double interp)
 
double SeExpr2::mix (double x, double y, double alpha)
 
Vec3d SeExpr2::hsiAdjust (const Vec3d &rgb, double h, double s, double i)
 
Vec3d SeExpr2::hsi (int n, const Vec3d *args)
 
Vec3d SeExpr2::midhsi (int n, const Vec3d *args)
 
Vec3d SeExpr2::rgbtohsl (const Vec3d &rgb)
 
static double SeExpr2::hslvalue (double x, double y, double H)
 
Vec3d SeExpr2::hsltorgb (const Vec3d &hsl)
 
static Vec3d SeExpr2::saturate (const Vec3d &Cin, double amt)
 
Vec3d SeExpr2::saturate (int n, const Vec3d *args)
 
double SeExpr2::hash (int n, double *args)
 
double SeExpr2::noise (int n, const Vec3d *args)
 
double SeExpr2::snoise (const Vec3d &p)
 
Vec3d SeExpr2::vnoise (const Vec3d &p)
 
Vec3d SeExpr2::cnoise (const Vec3d &p)
 
double SeExpr2::snoise4 (int n, const Vec3d *args)
 
Vec3d SeExpr2::vnoise4 (int n, const Vec3d *args)
 
Vec3d SeExpr2::cnoise4 (int n, const Vec3d *args)
 
double SeExpr2::turbulence (int n, const Vec3d *args)
 
Vec3d SeExpr2::vturbulence (int n, const Vec3d *args)
 
Vec3d SeExpr2::cturbulence (int n, const Vec3d *args)
 
double SeExpr2::fbm (int n, const Vec3d *args)
 
Vec3d SeExpr2::vfbm (int n, const Vec3d *args)
 
double SeExpr2::fbm4 (int n, const Vec3d *args)
 
Vec3d SeExpr2::vfbm4 (int n, const Vec3d *args)
 
Vec3d SeExpr2::cfbm (int n, const Vec3d *args)
 
Vec3d SeExpr2::cfbm4 (int n, const Vec3d *args)
 
double SeExpr2::cellnoise (const Vec3d &p)
 
Vec3d SeExpr2::ccellnoise (const Vec3d &p)
 
double SeExpr2::pnoise (const Vec3d &p, const Vec3d &period)
 
static Vec3d * SeExpr2::voronoi_points (VoronoiPointData &data, const Vec3d &cell, double jitter)
 
static void SeExpr2::voronoi_f1_3d (VoronoiPointData &data, const Vec3d &p, double jitter, double &f1, Vec3d &pos1)
 
static void SeExpr2::voronoi_f1f2_3d (VoronoiPointData &data, const Vec3d &p, double jitter, double &f1, Vec3d &pos1, double &f2, Vec3d &pos2)
 
Vec3d SeExpr2::voronoiFn (VoronoiPointData &data, int n, const Vec3d *args)
 
Vec3d SeExpr2::cvoronoiFn (VoronoiPointData &data, int n, const Vec3d *args)
 
Vec3d SeExpr2::pvoronoiFn (VoronoiPointData &data, int n, const Vec3d *args)
 
SeExpr2::CachedVoronoiFunc
ExprFuncSimple 
SeExpr2::voronoi (voronoiFn)
 
 CachedVoronoiFunc (VoronoiFunc *vfunc)
 
virtual ExprType prep (ExprFuncNode *node, bool scalarWanted, ExprVarEnvBuilder &envBuilder) const
 
virtual ExprFuncNode::Data * evalConstant (const ExprFuncNode *node, ArgHandle args) const
 
virtual void eval (ArgHandle args)
 
virtual ~CachedVoronoiFunc ()
 
SeExpr2::CachedVoronoiFunc
ExprFuncSimple 
SeExpr2::cvoronoi (cvoronoiFn)
 
SeExpr2::CachedVoronoiFunc
ExprFuncSimple 
SeExpr2::pvoronoi (pvoronoiFn)
 
double SeExpr2::dist (double ax, double ay, double az, double bx, double by, double bz)
 
double SeExpr2::length (const Vec3d &v)
 
double SeExpr2::hypot (double x, double y)
 
double SeExpr2::dot (const Vec3d &a, const Vec3d &b)
 
Vec3d SeExpr2::norm (const Vec3d &a)
 
Vec3d SeExpr2::cross (const Vec3d &a, const Vec3d &b)
 
double SeExpr2::angle (const Vec3d &a, const Vec3d &b)
 
Vec3d SeExpr2::ortho (const Vec3d &a, const Vec3d &b)
 
Vec3d SeExpr2::rotate (int n, const Vec3d *args)
 
Vec3d SeExpr2::up (const Vec3d &P, const Vec3d &upvec)
 
double SeExpr2::cycle (double index, double loRange, double hiRange)
 
double SeExpr2::pick (int n, double *params)
 
double SeExpr2::swatch (int n, double *params)
 
double SeExpr2::choose (int n, double *params)
 
double SeExpr2::wchoose (int n, double *params)
 
double SeExpr2::spline (int n, double *params)
 
void SeExpr2::defineBuiltins (ExprFunc::Define define, ExprFunc::Define3 define3)
 

Variables

static const char * SeExpr2::fabs_docstring = "float abs(float x)\nabsolute value of x"
 
static const char * SeExpr2::deg_docstring = "float deg(float angle)\nradians to degrees"
 
static const char * SeExpr2::rad_docstring = "float deg(float angle)\ndegrees to radians"
 
static const char * SeExpr2::cosd_docstring = "float cosd(float angle)\ncosine in degrees"
 
static const char * SeExpr2::sind_docstring = "float sind(float angle)\nsine in degrees"
 
static const char * SeExpr2::tand_docstring = "float tand(float angle)\ntangent in degrees"
 
static const char * SeExpr2::acosd_docstring = "float acosd(float angle)\narc cosine in degrees"
 
static const char * SeExpr2::asind_docstring = "float asind(float angle)\narc sine in degrees"
 
static const char * SeExpr2::atand_docstring = "float atand(float angle)\narc tangent in degrees"
 
static const char * SeExpr2::atan2d_docstring
 
static const char * SeExpr2::cos_docstring = "float cos(float angle)\ncosine in radians"
 
static const char * SeExpr2::sin_docstring = "float sin(float angle)\nsine in radians"
 
static const char * SeExpr2::tan_docstring = "float tan(float angle)\ntangent in radians"
 
static const char * SeExpr2::acos_docstring = "float acos(float angle)\narc cosine in radians"
 
static const char * SeExpr2::asin_docstring = "float asin(float angle)\narc sine in radians"
 
static const char * SeExpr2::atan_docstring = "float atan(float angle)\narc tangent in radians"
 
static const char * SeExpr2::atan2_docstring = "float atan2(float y,float x)\narc tangent in radians of y/x between -PI and PI"
 
static const char * SeExpr2::cosh_docstring = "float cosh(float angle)\nhyperbolic cosine in radians"
 
static const char * SeExpr2::sinh_docstring = "float sinh(float angle)\nhyperbolic sine in radians"
 
static const char * SeExpr2::tanh_docstring = "float tanh(float angle)\nhyperbolic tangent in radians"
 
static const char * SeExpr2::acosh_docstring = "float acosh(float angle)\nhyperbolic arc cosine in radians"
 
static const char * SeExpr2::asinh_docstring = "float asinh(float angle)\nhyperbolic arc sine in radians"
 
static const char * SeExpr2::atanh_docstring = "float atanh(float angle)\nhyperbolic arc tangent in radians"
 
static const char * SeExpr2::clamp_docstring = "float clamp(float x,float lo,float hi)\nconstrain x to range [lo,hi]"
 
static const char * SeExpr2::round_docstring = "float round(float x)\nconstrain x to range [lo,hi]"
 
static const char * SeExpr2::max_docstring = "float max(float a,float b)\ngreater of a and b"
 
static const char * SeExpr2::min_docstring = "float min(float a,float b)\nlesser of a and b"
 
static const char * SeExpr2::trunc_docstring = "float trunc(float a)\nnearest integer towards zero"
 
static const char * SeExpr2::floor_docstring = "float floor(float a)\nnext lower integer"
 
static const char * SeExpr2::ceil_docstring = "float ceil(float a)\nnext higher integer"
 
static const char * SeExpr2::invert_docstring = "float invert(float a)\nDefined as 1-x"
 
static const char * SeExpr2::cbrt_docstring = "float cbrt(float x)\ncube root"
 
static const char * SeExpr2::sqrt_docstring = "float sqrt(float x)\nsquare root"
 
static const char * SeExpr2::exp_docstring = "float exp(float x)\nE raised to the x power"
 
static const char * SeExpr2::pow_docstring = "float pow(float x)\nx to the y power, also available as ^"
 
static const char * SeExpr2::log_docstring = "float log(float x)\nNatural logarithm"
 
static const char * SeExpr2::log10_docstring = "float log10(float x)\nBase 10 logarithm"
 
static const char * SeExpr2::fmod_docstring = "float fmod(float x,float y)\nremainder of x/y (also available as % operator)"
 
static const char * SeExpr2::turbulence_docstring
 
static const char * SeExpr2::cturbulence_docstring
 
static const char * SeExpr2::vturbulence_docstring
 
static const char * SeExpr2::compress_docstring = "float compress(float x,float lo,float hi)\nRemaps x in [0,1] to [lo,hi]"
 
static const char * SeExpr2::expand_docstring = "float expand(float x,float lo,float hi)\nRemaps x in [lo,hi] to [0,1]"
 
static const char * SeExpr2::fit_docstring
 
static const char * SeExpr2::gamma_docstring = "float gamma(float x, float g)\nGamma correction of x with gamma factor g"
 
static const char * SeExpr2::bias_docstring
 
static const char * SeExpr2::contrast_docstring
 
static const char * SeExpr2::boxstep_docstring = "float boxstep(float x,float a)\n if x < a then 0 otherwise 1"
 
static const char * SeExpr2::linearstep_docstring
 
static const char * SeExpr2::smoothstep_docstring
 
static const char * SeExpr2::gaussstep_docstring
 
static const char * SeExpr2::remap_docstring
 
static const char * SeExpr2::mix_docstring = "mix(float a,float b,float alpha)\nBlend of a and b according to alpha."
 
static const char * SeExpr2::hsi_docstring
 
static const char * SeExpr2::midhsi_docstring
 
static const char * SeExpr2::rgbtohsl_docstring
 
static const char * SeExpr2::hsltorgb_docstring
 
static const char * SeExpr2::saturate_docstring
 
static const char * SeExpr2::hash_docstring
 
static const char * SeExpr2::noise_docstring
 
static const char * SeExpr2::snoise_docstring
 
static const char * SeExpr2::vnoise_docstring
 
static const char * SeExpr2::cnoise_docstring
 
static const char * SeExpr2::snoise4_docstring
 
static const char * SeExpr2::vnoise4_docstring
 
static const char * SeExpr2::cnoise4_docstring
 
static const char * SeExpr2::fbm_docstring
 
static const char * SeExpr2::vfbm_docstring = "vector vfbm(vector vint octaves=6,float lacunarity=2,float gain=.5)"
 
static const char * SeExpr2::fbm4_docstring
 
static const char * SeExpr2::vfbm4_docstring = "vector vfbm4(vector v,float time,int octaves=6,float lacunarity=2,float gain=.5)"
 
static const char * SeExpr2::cfbm_docstring = "color cfbm(vector vint octaves=6,float lacunarity=2,float gain=.5)"
 
static const char * SeExpr2::cfbm4_docstring = "color cfbm4(vector v,float time,int octaves=6,float lacunarity=2,float gain=.5)"
 
static const char * SeExpr2::cellnoise_docstring
 
static const char * SeExpr2::ccellnoise_docstring
 
static const char * SeExpr2::pnoise_docstring
 
static const char * SeExpr2::voronoi_docstring
 
static const char * SeExpr2::cvoronoi_docstring
 
static const char * SeExpr2::pvoronoi_docstring
 
VoronoiFunc_vfunc
 
static const char * SeExpr2::dist_docstring
 
static const char * SeExpr2::length_docstring
 
static const char * SeExpr2::hypot_docstring
 
static const char * SeExpr2::dot_docstring
 
static const char * SeExpr2::norm_docstring
 
static const char * SeExpr2::cross_docstring
 
static const char * SeExpr2::angle_docstring
 
static const char * SeExpr2::ortho_docstring
 
static const char * SeExpr2::rotate_docstring
 
static const char * SeExpr2::up_docstring
 
static const char * SeExpr2::cycle_docstring
 
static const char * SeExpr2::pick_docstring
 
static const char * SeExpr2::swatch_docstring
 
static const char * SeExpr2::choose_docstring
 
static const char * SeExpr2::wchoose_docstring
 
static const char * SeExpr2::spline_docstring
 
SeExpr2::CurveData SeExpr2::voronoi
 
SeExpr2::CurveFuncX SeExpr2::curve
 
static const char * SeExpr2::curve_docstring
 
SeExpr2::CCurveFuncX SeExpr2::ccurve
 
static const char * SeExpr2::ccurve_docstring
 
SeExpr2::GetVar SeExpr2::getVar
 
static const char * SeExpr2::getVar_docstring
 
SeExpr2::PrintFuncX SeExpr2::printf
 
static const char * SeExpr2::printf_docstring
 

Macro Definition Documentation

#define FUNCADOC (   name,
  func 
)    define3(name, ExprFunc(::func), func##_docstring)

Referenced by SeExpr2::defineBuiltins().

#define FUNCDOC (   func)    define3(#func, ExprFunc(::func), func##_docstring)

Referenced by SeExpr2::defineBuiltins().

#define FUNCDOC (   func)    define3(#func, ExprFunc(SeExpr2::func), func##_docstring)
#define FUNCNDOC (   func,
  min,
  max 
)    define3(#func, ExprFunc(SeExpr2::func, min, max), func##_docstring)

Referenced by SeExpr2::defineBuiltins().

Typedef Documentation

typedef Vec3d VoronoiFunc(VoronoiPointData &data, int n, const Vec3d *args)

Definition at line 1006 of file ExprBuiltins.cpp.

Function Documentation

voronoi::CachedVoronoiFunc ( VoronoiFunc vfunc)

Definition at line 1007 of file ExprBuiltins.cpp.

virtual void voronoi::eval ( ArgHandle  args)
virtual

Definition at line 1027 of file ExprBuiltins.cpp.

virtual ExprFuncNode::Data* voronoi::evalConstant ( const ExprFuncNode *  node,
ArgHandle  args 
) const
virtual

Definition at line 1023 of file ExprBuiltins.cpp.

virtual ExprType voronoi::prep ( ExprFuncNode *  node,
bool  scalarWanted,
ExprVarEnvBuilder &  envBuilder 
) const
virtual

Definition at line 1009 of file ExprBuiltins.cpp.

virtual voronoi::~CachedVoronoiFunc ( )
virtual

Definition at line 1040 of file ExprBuiltins.cpp.

Variable Documentation

VoronoiFunc* _vfunc

Definition at line 1043 of file ExprBuiltins.cpp.