Home | History | Annotate | Download | only in scripts

Lines Matching refs:def

33 	def __init__(self, name, description, children):
39 def __init__(self):
44 def indentTextBlock(text, indent):
51 def writeCase(f, case, indent, prefix):
65 def writeAllCases(fileName, caseList):
78 def genValues(inputs, outputs):
86 def fillTemplate(template, params):
105 def shuffled(lst):
110 def repeatToLength(lst, toLength):
115 def toFloat(lst): return [Scalar(float(v.x)) for v in lst]
116 def toInt(lst): return [Scalar(int(v.x)) for v in lst]
117 def toUint(lst): return [Uint(int(v.x)) for v in lst]
118 def toBool(lst): return [Scalar(bool(v.x)) for v in lst]
119 def toVec4(lst): return [v.toFloat().toVec4() for v in lst]
120 def toVec3(lst): return [v.toFloat().toVec3() for v in lst]
121 def toVec2(lst): return [v.toFloat().toVec2() for v in lst]
122 def toIVec4(lst): return [v.toInt().toVec4() for v in lst]
123 def toIVec3(lst): return [v.toInt().toVec3() for v in lst]
124 def toIVec2(lst): return [v.toInt().toVec2() for v in lst]
125 def toBVec4(lst): return [v.toBool().toVec4() for v in lst]
126 def toBVec3(lst): return [v.toBool().toVec3() for v in lst]
127 def toBVec2(lst): return [v.toBool().toVec2() for v in lst]
128 def toUVec4(lst): return [v.toUint().toUVec4() for v in lst]
129 def toUVec3(lst): return [v.toUint().toUVec3() for v in lst]
130 def toUVec2(lst): return [v.toUint().toUVec2() for v in lst]
131 def toMat2(lst): return [v.toMat2() for v in lst]
132 def toMat2x3(lst): return [v.toMat2x3() for v in lst]
133 def toMat2x4(lst): return [v.toMat2x4() for v in lst]
134 def toMat3x2(lst): return [v.toMat3x2() for v in lst]
135 def toMat3(lst): return [v.toMat3() for v in lst]
136 def toMat3x4(lst): return [v.toMat3x4() for v in lst]
137 def toMat4x2(lst): return [v.toMat4x2() for v in lst]
138 def toMat4x3(lst): return [v.toMat4x3() for v in lst]
139 def toMat4(lst): return [v.toMat4() for v in lst]
144 def __init__(self):
147 def uniformVec4(self, count, mn, mx):
154 def uniformBVec4(self, count):
160 # def uniform(self,
164 def glslSign(a): return 0.0 if (a == 0) else +1.0 if (a > 0.0) else -1.0
165 def glslMod(x, y): return x - y*math.floor(x/y)
166 def glslClamp(x, mn, mx): return mn if (x < mn) else mx if (x > mx) else x
170 def unary(func): return lambda val: val.applyUnary(func)
173 def binary(func): return lambda a, b: (b.expandVec(a)).applyBinary(func, a.expandVec(b))
176 def frac(val): return val.applyUnary(lambda x: x - math.floor(x))
179 def exp2(val): return val.applyUnary(lambda x: math.pow(2.0, x))
182 def log2(val): return val.applyUnary(lambda x: math.log(x, 2.0))
185 def rsq(val): return val.applyUnary(lambda x: 1.0 / math.sqrt(x))
188 def sign(val): return val.applyUnary(glslSign)
191 def isEqual(a, b): return Scalar(a.isEqual(b))
194 def isNotEqual(a, b): return Scalar(not a.isEqual(b))
197 def step(a, b): return (b.expandVec(a)).applyBinary(lambda edge, x: [1.0, 0.0][x < edge], a.expandVec(b))
200 def length(a): return a.length()
203 def distance(a, b): return a.distance(b)
206 def dot(a, b): return a.dot(b)
209 def cross(a, b): return a.cross(b)
212 def normalize(a): return a.normalize()
215 def boolAny(a): return a.boolAny()
218 def boolAll(a): return a.boolAll()
221 def boolNot(a): return a.boolNot()
224 def abs(a): return a.abs()
229 def __init__(self, x):
232 def applyUnary(self, func): return Scalar(func(self.x))
233 def applyBinary(self, func, other): return Scalar(func(self.x, other.x))
235 def isEqual(self, other): assert isinstance(other, Scalar); return (self.x == other.x)
237 def expandVec(self, val): return val
238 def toScalar(self): return Scalar(self.x)
239 def toVec2(self): return Vec2(self.x, self.x)
240 def toVec3(self): return Vec3(self.x, self.x, self.x)
241 def toVec4(self): return Vec4(self.x, self.x, self.x, self.x)
242 def toUVec2(self): return UVec2(self.x, self.x)
243 def toUVec3(self): return UVec3(self.x, self.x, self.x)
244 def toUVec4(self): return UVec4(self.x, self.x, self.x, self.x)
245 def toMat2(self): return Mat.fromScalar(2, 2, float(self.x))
246 def toMat2x3(self): return Mat.fromScalar(2, 3, float(self.x))
247 def toMat2x4(self): return Mat.fromScalar(2, 4, float(self.x))
248 def toMat3x2(self): return Mat.fromScalar(3, 2, float(self.x))
249 def toMat3(self): return Mat.fromScalar(3, 3, float(self.x))
250 def toMat3x4(self): return Mat.fromScalar(3, 4, float(self.x))
251 def toMat4x2(self): return Mat.fromScalar(4, 2, float(self.x))
252 def toMat4x3(self): return Mat.fromScalar(4, 3, float(self.x))
253 def toMat4(self): return Mat.fromScalar(4, 4, float(self.x))
255 def toFloat(self): return Scalar(float(self.x))
256 def toInt(self): return Scalar(int(self.x))
257 def toUint(self): return Uint(int(self.x))
258 def toBool(self): return Scalar(bool(self.x))
260 def getNumScalars(self): return 1
261 def getScalars(self): return [self.x]
263 def typeString(self):
273 def vec4Swizzle(self):
276 def __str__(self):
279 def __float__(self):
282 def length(self):
285 def distance(self, v):
289 def dot(self, v):
293 def normalize(self):
296 def abs(self):
302 def __neg__(self):
305 def __add__(self, val):
311 def __sub__(self, val):
314 def __mul__(self, val):
326 def __div__(self, val):
339 def __init__(self, x):
343 def typeString(self):
346 def abs(self):
349 def __neg__(self):
352 def __add__(self, val):
355 def __sub__(self, val):
358 def __mul__(self, val):
361 def __div__(self, val):
366 def fromScalarList(lst):
373 def isEqual(self, other):
377 def length(self):
380 def normalize(self):
383 def swizzle(self, indexList):
388 def __init__(self):
391 def __eq__(self, other):
394 def __ne__(self, other):
398 def __init__(self, x, y):
403 def applyUnary(self, func): return Vec2(func(self.x), func(self.y))
404 def applyBinary(self, func, other): return Vec2(func(self.x, other.x), func(self.y, other.y))
406 def expandVec(self, val): return val.toVec2()
407 def toScalar(self): return Scalar(self.x)
408 def toVec2(self): return Vec2(self.x, self.y)
409 def toVec3(self): return Vec3(self.x, self.y, 0.0)
410 def toVec4(self): return Vec4(self.x, self.y, 0.0, 0.0)
411 def toUVec2(self): return UVec2(self.x, self.y)
412 def toUVec3(self): return UVec3(self.x, self.y, 0.0)
413 def toUVec4(self): return UVec4(self.x, self.y, 0.0, 0.0)
414 def toMat2(self): return Mat2(float(self.x), 0.0, 0.0, float(self.y));
416 def toFloat(self): return Vec2(float(self.x), float(self.y))
417 def toInt(self): return Vec2(int(self.x), int(self.y))
418 def toUint(self): return UVec2(int(self.x), int(self.y))
419 def toBool(self): return Vec2(bool(self.x), bool(self.y))
421 def getNumScalars(self): return 2
422 def getScalars(self): return [self.x, self.y]
424 def typeString(self):
434 def vec4Swizzle(self):
437 def __str__(self):
447 def distance(self, v):
451 def dot(self, v):
455 def abs(self):
461 def __neg__(self):
464 def __add__(self, val):
472 def __sub__(self, val):
475 def __mul__(self, val):
481 def __div__(self, val):
488 def boolAny(self): return Scalar(self.x or self.y)
489 def boolAll(self): return Scalar(self.x and self.y)
490 def boolNot(self): return Vec2(not self.x, not self.y)
493 def __init__(self, x, y):
498 def typeString(self):
501 def __str__(self):
504 def abs(self):
508 def __init__(self, x, y, z):
514 def applyUnary(self, func): return Vec3(func(self.x), func(self.y), func(self.z))
515 def applyBinary(self, func, other): return Vec3(func(self.x, other.x), func(self.y, other.y), func(self.z, other.z))
517 def expandVec(self, val): return val.toVec3()
518 def toScalar(self): return Scalar(self.x)
519 def toVec2(self): return Vec2(self.x, self.y)
520 def toVec3(self): return Vec3(self.x, self.y, self.z)
521 def toVec4(self): return Vec4(self.x, self.y, self.z, 0.0)
522 def toUVec2(self): return UVec2(self.x, self.y)
523 def toUVec3(self): return UVec3(self.x, self.y, self.z)
524 def toUVec4(self): return UVec4(self.x, self.y, self.z, 0.0)
525 def toMat3(self): return Mat3(float(self.x), 0.0, 0.0, 0.0, float(self.y), 0.0, 0.0, 0.0, float(self.z));
527 def toFloat(self): return Vec3(float(self.x), float(self.y), float(self.z))
528 def toInt(self): return Vec3(int(self.x), int(self.y), int(self.z))
529 def toUint(self): return UVec3(int(self.x), int(self.y), int(self.z))
530 def toBool(self): return Vec3(bool(self.x), bool(self.y), bool(self.z))
532 def getNumScalars(self): return 3
533 def getScalars(self): return [self.x, self.y, self.z]
535 def typeString(self):
545 def vec4Swizzle(self):
548 def __str__(self):
558 def distance(self, v):
562 def dot(self, v):
566 def cross(self, v):
572 def abs(self):
578 def __neg__(self):
581 def __add__(self, val):
589 def __sub__(self, val):
592 def __mul__(self, val):
598 def __div__(self, val):
606 def boolAny(self): return Scalar(self.x or self.y or self.z)
607 def boolAll(self): return Scalar(self.x and self.y and self.z)
608 def boolNot(self): return Vec3(not self.x, not self.y, not self.z)
611 def __init__(self, x, y, z):
616 def typeString(self):
619 def __str__(self):
622 def abs(self):
626 def __init__(self, x, y, z, w):
633 def applyUnary(self, func): return Vec4(func(self.x), func(self.y), func(self.z), func(self.w))
634 def applyBinary(self, func, other): return Vec4(func(self.x, other.x), func(self.y, other.y), func(self.z, other.z), func(self.w, other.w))
636 def expandVec(self, val): return val.toVec4()
637 def toScalar(self): return Scalar(self.x)
638 def toVec2(self): return Vec2(self.x, self.y)
639 def toVec3(self): return Vec3(self.x, self.y, self.z)
640 def toVec4(self): return Vec4(self.x, self.y, self.z, self.w)
641 def toUVec2(self): return UVec2(self.x, self.y)
642 def toUVec3(self): return UVec3(self.x, self.y, self.z)
643 def toUVec4(self): return UVec4(self.x, self.y, self.z, self.w)
644 def toMat2(self): return Mat2(float(self.x), float(self.y), float(self.z), float(self.w))
645 def toMat4(self): return Mat4(float(self.x), 0.0, 0.0, 0.0, 0.0, float(self.y), 0.0, 0.0, 0.0, 0.0, float(self.z), 0.0, 0.0, 0.0, 0.0, float(self.w));
647 def toFloat(self): return Vec4(float(self.x), float(self.y), float(self.z), float(self.w))
648 def toInt(self): return Vec4(int(self.x), int(self.y), int(self.z), int(self.w))
649 def toUint(self): return UVec4(int(self.x), int(self.y), int(self.z), int(self.w))
650 def toBool(self): return Vec4(bool(self.x), bool(self.y), bool(self.z), bool(self.w))
652 def getNumScalars(self): return 4
653 def getScalars(self): return [self.x, self.y, self.z, self.w]
655 def typeString(self):
665 def vec4Swizzle(self):
668 def __str__(self):
678 def distance(self, v):
682 def dot(self, v):
686 def abs(self):
692 def __neg__(self):
695 def __add__(self, val):
703 def __sub__(self, val):
706 def __mul__(self, val):
712 def __div__(self, val):
720 def boolAny(self): return Scalar(self.x or self.y or self.z or self.w)
721 def boolAll(self): return Scalar(self.x and self.y and self.z and self.w)
722 def boolNot(self): return Vec4(not self.x, not self.y, not self.z, not self.w)
725 def __init__(self, x, y, z, w):
730 def typeString(self):
733 def __str__(self):
736 def abs(self):
741 def __init__ (self, numCols, numRows, scalars):
748 def fromScalar (numCols, numRows, scalar):
756 def identity (numCols, numRows):
759 def get (self, colNdx, rowNdx):
764 def set (self, colNdx, rowNdx, scalar):
769 def toMatrix (self, numCols, numRows):
776 def toMat2 (self): return self.toMatrix(2, 2)
777 def toMat2x3 (self): return self.toMatrix(2, 3)
778 def toMat2x4 (self): return self.toMatrix(2, 4)
779 def toMat3x2 (self): return self.toMatrix(3, 2)
780 def toMat3 (self): return self.toMatrix(3, 3)
781 def toMat3x4 (self): return self.toMatrix(3, 4)
782 def toMat4x2 (self): return self.toMatrix(4, 2)
783 def toMat4x3 (self): return self.toMatrix(4, 3)
784 def toMat4 (self): return self.toMatrix(4, 4)
786 def typeString(self):
792 def __str__(self):
795 def isTypeEqual (self, other):
798 def isEqual(self, other):
802 def compMul(self, val):
807 def __init__(self, m00, m01, m10, m11):
811 def __init__(self, m00, m01, m02, m10, m11, m12, m20, m21, m22):
817 def __init__(self, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33):