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):
309 def __sub__(self, val):
312 def __mul__(self, val):
324 def __div__(self, val):
337 def __init__(self, x):
341 def typeString(self):
344 def abs(self):
347 def __neg__(self):
350 def __add__(self, val):
353 def __sub__(self, val):
356 def __mul__(self, val):
359 def __div__(self, val):
364 def fromScalarList(lst):
371 def isEqual(self, other):
375 def length(self):
378 def normalize(self):
381 def swizzle(self, indexList):
386 def __init__(self):
389 def __eq__(self, other):
392 def __ne__(self, other):
396 def __init__(self, x, y):
401 def applyUnary(self, func): return Vec2(func(self.x), func(self.y))
402 def applyBinary(self, func, other): return Vec2(func(self.x, other.x), func(self.y, other.y))
404 def expandVec(self, val): return val.toVec2()
405 def toScalar(self): return Scalar(self.x)
406 def toVec2(self): return Vec2(self.x, self.y)
407 def toVec3(self): return Vec3(self.x, self.y, 0.0)
408 def toVec4(self): return Vec4(self.x, self.y, 0.0, 0.0)
409 def toUVec2(self): return UVec2(self.x, self.y)
410 def toUVec3(self): return UVec3(self.x, self.y, 0.0)
411 def toUVec4(self): return UVec4(self.x, self.y, 0.0, 0.0)
412 def toMat2(self): return Mat2(float(self.x), 0.0, 0.0, float(self.y));
414 def toFloat(self): return Vec2(float(self.x), float(self.y))
415 def toInt(self): return Vec2(int(self.x), int(self.y))
416 def toUint(self): return UVec2(int(self.x), int(self.y))
417 def toBool(self): return Vec2(bool(self.x), bool(self.y))
419 def getNumScalars(self): return 2
420 def getScalars(self): return [self.x, self.y]
422 def typeString(self):
432 def vec4Swizzle(self):
435 def __str__(self):
445 def distance(self, v):
449 def dot(self, v):
453 def abs(self):
459 def __neg__(self):
462 def __add__(self, val):
470 def __sub__(self, val):
473 def __mul__(self, val):
479 def __div__(self, val):
486 def boolAny(self): return Scalar(self.x or self.y)
487 def boolAll(self): return Scalar(self.x and self.y)
488 def boolNot(self): return Vec2(not self.x, not self.y)
491 def __init__(self, x, y):
496 def typeString(self):
499 def __str__(self):
502 def abs(self):
506 def __init__(self, x, y, z):
512 def applyUnary(self, func): return Vec3(func(self.x), func(self.y), func(self.z))
513 def applyBinary(self, func, other): return Vec3(func(self.x, other.x), func(self.y, other.y), func(self.z, other.z))
515 def expandVec(self, val): return val.toVec3()
516 def toScalar(self): return Scalar(self.x)
517 def toVec2(self): return Vec2(self.x, self.y)
518 def toVec3(self): return Vec3(self.x, self.y, self.z)
519 def toVec4(self): return Vec4(self.x, self.y, self.z, 0.0)
520 def toUVec2(self): return UVec2(self.x, self.y)
521 def toUVec3(self): return UVec3(self.x, self.y, self.z)
522 def toUVec4(self): return UVec4(self.x, self.y, self.z, 0.0)
523 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));
525 def toFloat(self): return Vec3(float(self.x), float(self.y), float(self.z))
526 def toInt(self): return Vec3(int(self.x), int(self.y), int(self.z))
527 def toUint(self): return UVec3(int(self.x), int(self.y), int(self.z))
528 def toBool(self): return Vec3(bool(self.x), bool(self.y), bool(self.z))
530 def getNumScalars(self): return 3
531 def getScalars(self): return [self.x, self.y, self.z]
533 def typeString(self):
543 def vec4Swizzle(self):
546 def __str__(self):
556 def distance(self, v):
560 def dot(self, v):
564 def cross(self, v):
570 def abs(self):
576 def __neg__(self):
579 def __add__(self, val):
587 def __sub__(self, val):
590 def __mul__(self, val):
596 def __div__(self, val):
604 def boolAny(self): return Scalar(self.x or self.y or self.z)
605 def boolAll(self): return Scalar(self.x and self.y and self.z)
606 def boolNot(self): return Vec3(not self.x, not self.y, not self.z)
609 def __init__(self, x, y, z):
614 def typeString(self):
617 def __str__(self):
620 def abs(self):
624 def __init__(self, x, y, z, w):
631 def applyUnary(self, func): return Vec4(func(self.x), func(self.y), func(self.z), func(self.w))
632 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))
634 def expandVec(self, val): return val.toVec4()
635 def toScalar(self): return Scalar(self.x)
636 def toVec2(self): return Vec2(self.x, self.y)
637 def toVec3(self): return Vec3(self.x, self.y, self.z)
638 def toVec4(self): return Vec4(self.x, self.y, self.z, self.w)
639 def toUVec2(self): return UVec2(self.x, self.y)
640 def toUVec3(self): return UVec3(self.x, self.y, self.z)
641 def toUVec4(self): return UVec4(self.x, self.y, self.z, self.w)
642 def toMat2(self): return Mat2(float(self.x), float(self.y), float(self.z), float(self.w))
643 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));
645 def toFloat(self): return Vec4(float(self.x), float(self.y), float(self.z), float(self.w))
646 def toInt(self): return Vec4(int(self.x), int(self.y), int(self.z), int(self.w))
647 def toUint(self): return UVec4(int(self.x), int(self.y), int(self.z), int(self.w))
648 def toBool(self): return Vec4(bool(self.x), bool(self.y), bool(self.z), bool(self.w))
650 def getNumScalars(self): return 4
651 def getScalars(self): return [self.x, self.y, self.z, self.w]
653 def typeString(self):
663 def vec4Swizzle(self):
666 def __str__(self):
676 def distance(self, v):
680 def dot(self, v):
684 def abs(self):
690 def __neg__(self):
693 def __add__(self, val):
701 def __sub__(self, val):
704 def __mul__(self, val):
710 def __div__(self, val):
718 def boolAny(self): return Scalar(self.x or self.y or self.z or self.w)
719 def boolAll(self): return Scalar(self.x and self.y and self.z and self.w)
720 def boolNot(self): return Vec4(not self.x, not self.y, not self.z, not self.w)
723 def __init__(self, x, y, z, w):
728 def typeString(self):
731 def __str__(self):
734 def abs(self):
739 def __init__ (self, numCols, numRows, scalars):
746 def fromScalar (numCols, numRows, scalar):
754 def identity (numCols, numRows):
757 def get (self, colNdx, rowNdx):
762 def set (self, colNdx, rowNdx, scalar):
767 def toMatrix (self, numCols, numRows):
774 def toMat2 (self): return self.toMatrix(2, 2)
775 def toMat2x3 (self): return self.toMatrix(2, 3)
776 def toMat2x4 (self): return self.toMatrix(2, 4)
777 def toMat3x2 (self): return self.toMatrix(3, 2)
778 def toMat3 (self): return self.toMatrix(3, 3)
779 def toMat3x4 (self): return self.toMatrix(3, 4)
780 def toMat4x2 (self): return self.toMatrix(4, 2)
781 def toMat4x3 (self): return self.toMatrix(4, 3)
782 def toMat4 (self): return self.toMatrix(4, 4)
784 def typeString(self):
790 def __str__(self):
793 def isTypeEqual (self, other):
796 def isEqual(self, other):
800 def compMul(self, val):
805 def __init__(self, m00, m01, m10, m11):
809 def __init__(self, m00, m01, m02, m10, m11, m12, m20, m21, m22):
815 def __init__(self, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33):