Home | History | Annotate | Download | only in scripts

Lines Matching refs:def

11 	def __init__(self, name, description, children):
17 def __init__(self):
22 def indentTextBlock(text, indent):
29 def writeCase(f, case, indent, prefix):
43 def writeAllCases(fileName, caseList):
56 def genValues(inputs, outputs):
64 def fillTemplate(template, params):
83 def shuffled(lst):
88 def repeatToLength(lst, toLength):
93 def toFloat(lst): return [Scalar(float(v.x)) for v in lst]
94 def toInt(lst): return [Scalar(int(v.x)) for v in lst]
95 def toUint(lst): return [Uint(int(v.x)) for v in lst]
96 def toBool(lst): return [Scalar(bool(v.x)) for v in lst]
97 def toVec4(lst): return [v.toFloat().toVec4() for v in lst]
98 def toVec3(lst): return [v.toFloat().toVec3() for v in lst]
99 def toVec2(lst): return [v.toFloat().toVec2() for v in lst]
100 def toIVec4(lst): return [v.toInt().toVec4() for v in lst]
101 def toIVec3(lst): return [v.toInt().toVec3() for v in lst]
102 def toIVec2(lst): return [v.toInt().toVec2() for v in lst]
103 def toBVec4(lst): return [v.toBool().toVec4() for v in lst]
104 def toBVec3(lst): return [v.toBool().toVec3() for v in lst]
105 def toBVec2(lst): return [v.toBool().toVec2() for v in lst]
106 def toUVec4(lst): return [v.toUint().toUVec4() for v in lst]
107 def toUVec3(lst): return [v.toUint().toUVec3() for v in lst]
108 def toUVec2(lst): return [v.toUint().toUVec2() for v in lst]
109 def toMat2(lst): return [v.toMat2() for v in lst]
110 def toMat2x3(lst): return [v.toMat2x3() for v in lst]
111 def toMat2x4(lst): return [v.toMat2x4() for v in lst]
112 def toMat3x2(lst): return [v.toMat3x2() for v in lst]
113 def toMat3(lst): return [v.toMat3() for v in lst]
114 def toMat3x4(lst): return [v.toMat3x4() for v in lst]
115 def toMat4x2(lst): return [v.toMat4x2() for v in lst]
116 def toMat4x3(lst): return [v.toMat4x3() for v in lst]
117 def toMat4(lst): return [v.toMat4() for v in lst]
122 def __init__(self):
125 def uniformVec4(self, count, mn, mx):
132 def uniformBVec4(self, count):
138 # def uniform(self,
142 def glslSign(a): return 0.0 if (a == 0) else +1.0 if (a > 0.0) else -1.0
143 def glslMod(x, y): return x - y*math.floor(x/y)
144 def glslClamp(x, mn, mx): return mn if (x < mn) else mx if (x > mx) else x
148 def unary(func): return lambda val: val.applyUnary(func)
151 def binary(func): return lambda a, b: (b.expandVec(a)).applyBinary(func, a.expandVec(b))
154 def frac(val): return val.applyUnary(lambda x: x - math.floor(x))
157 def exp2(val): return val.applyUnary(lambda x: math.pow(2.0, x))
160 def log2(val): return val.applyUnary(lambda x: math.log(x, 2.0))
163 def rsq(val): return val.applyUnary(lambda x: 1.0 / math.sqrt(x))
166 def sign(val): return val.applyUnary(glslSign)
169 def isEqual(a, b): return Scalar(a.isEqual(b))
172 def isNotEqual(a, b): return Scalar(not a.isEqual(b))
175 def step(a, b): return (b.expandVec(a)).applyBinary(lambda edge, x: [1.0, 0.0][x < edge], a.expandVec(b))
178 def length(a): return a.length()
181 def distance(a, b): return a.distance(b)
184 def dot(a, b): return a.dot(b)
187 def cross(a, b): return a.cross(b)
190 def normalize(a): return a.normalize()
193 def boolAny(a): return a.boolAny()
196 def boolAll(a): return a.boolAll()
199 def boolNot(a): return a.boolNot()
202 def abs(a): return a.abs()
207 def __init__(self, x):
210 def applyUnary(self, func): return Scalar(func(self.x))
211 def applyBinary(self, func, other): return Scalar(func(self.x, other.x))
213 def isEqual(self, other): assert isinstance(other, Scalar); return (self.x == other.x)
215 def expandVec(self, val): return val
216 def toScalar(self): return Scalar(self.x)
217 def toVec2(self): return Vec2(self.x, self.x)
218 def toVec3(self): return Vec3(self.x, self.x, self.x)
219 def toVec4(self): return Vec4(self.x, self.x, self.x, self.x)
220 def toUVec2(self): return UVec2(self.x, self.x)
221 def toUVec3(self): return UVec3(self.x, self.x, self.x)
222 def toUVec4(self): return UVec4(self.x, self.x, self.x, self.x)
223 def toMat2(self): return Mat.fromScalar(2, 2, float(self.x))
224 def toMat2x3(self): return Mat.fromScalar(2, 3, float(self.x))
225 def toMat2x4(self): return Mat.fromScalar(2, 4, float(self.x))
226 def toMat3x2(self): return Mat.fromScalar(3, 2, float(self.x))
227 def toMat3(self): return Mat.fromScalar(3, 3, float(self.x))
228 def toMat3x4(self): return Mat.fromScalar(3, 4, float(self.x))
229 def toMat4x2(self): return Mat.fromScalar(4, 2, float(self.x))
230 def toMat4x3(self): return Mat.fromScalar(4, 3, float(self.x))
231 def toMat4(self): return Mat.fromScalar(4, 4, float(self.x))
233 def toFloat(self): return Scalar(float(self.x))
234 def toInt(self): return Scalar(int(self.x))
235 def toUint(self): return Uint(int(self.x))
236 def toBool(self): return Scalar(bool(self.x))
238 def getNumScalars(self): return 1
239 def getScalars(self): return [self.x]
241 def typeString(self):
251 def vec4Swizzle(self):
254 def __str__(self):
257 def __float__(self):
260 def length(self):
263 def distance(self, v):
267 def dot(self, v):
271 def normalize(self):
274 def abs(self):
280 def __neg__(self):
283 def __add__(self, val):
289 def __sub__(self, val):
292 def __mul__(self, val):
304 def __div__(self, val):
317 def __init__(self, x):
321 def typeString(self):
324 def abs(self):
327 def __neg__(self):
330 def __add__(self, val):
333 def __sub__(self, val):
336 def __mul__(self, val):
339 def __div__(self, val):
344 def fromScalarList(lst):
351 def isEqual(self, other):
355 def length(self):
358 def normalize(self):
361 def swizzle(self, indexList):
366 def __init__(self):
370 def __init__(self, x, y):
375 def applyUnary(self, func): return Vec2(func(self.x), func(self.y))
376 def applyBinary(self, func, other): return Vec2(func(self.x, other.x), func(self.y, other.y))
378 def expandVec(self, val): return val.toVec2()
379 def toScalar(self): return Scalar(self.x)
380 def toVec2(self): return Vec2(self.x, self.y)
381 def toVec3(self): return Vec3(self.x, self.y, 0.0)
382 def toVec4(self): return Vec4(self.x, self.y, 0.0, 0.0)
383 def toUVec2(self): return UVec2(self.x, self.y)
384 def toUVec3(self): return UVec3(self.x, self.y, 0.0)
385 def toUVec4(self): return UVec4(self.x, self.y, 0.0, 0.0)
386 def toMat2(self): return Mat2(float(self.x), 0.0, 0.0, float(self.y));
388 def toFloat(self): return Vec2(float(self.x), float(self.y))
389 def toInt(self): return Vec2(int(self.x), int(self.y))
390 def toUint(self): return UVec2(int(self.x), int(self.y))
391 def toBool(self): return Vec2(bool(self.x), bool(self.y))
393 def getNumScalars(self): return 2
394 def getScalars(self): return [self.x, self.y]
396 def typeString(self):
406 def vec4Swizzle(self):
409 def __str__(self):
419 def distance(self, v):
423 def dot(self, v):
427 def abs(self):
433 def __neg__(self):
436 def __add__(self, val):
444 def __sub__(self, val):
447 def __mul__(self, val):
453 def __div__(self, val):
460 def boolAny(self): return Scalar(self.x or self.y)
461 def boolAll(self): return Scalar(self.x and self.y)
462 def boolNot(self): return Vec2(not self.x, not self.y)
465 def __init__(self, x, y):
470 def typeString(self):
473 def __str__(self):
476 def abs(self):
480 def __init__(self, x, y, z):
486 def applyUnary(self, func): return Vec3(func(self.x), func(self.y), func(self.z))
487 def applyBinary(self, func, other): return Vec3(func(self.x, other.x), func(self.y, other.y), func(self.z, other.z))
489 def expandVec(self, val): return val.toVec3()
490 def toScalar(self): return Scalar(self.x)
491 def toVec2(self): return Vec2(self.x, self.y)
492 def toVec3(self): return Vec3(self.x, self.y, self.z)
493 def toVec4(self): return Vec4(self.x, self.y, self.z, 0.0)
494 def toUVec2(self): return UVec2(self.x, self.y)
495 def toUVec3(self): return UVec3(self.x, self.y, self.z)
496 def toUVec4(self): return UVec4(self.x, self.y, self.z, 0.0)
497 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));
499 def toFloat(self): return Vec3(float(self.x), float(self.y), float(self.z))
500 def toInt(self): return Vec3(int(self.x), int(self.y), int(self.z))
501 def toUint(self): return UVec3(int(self.x), int(self.y), int(self.z))
502 def toBool(self): return Vec3(bool(self.x), bool(self.y), bool(self.z))
504 def getNumScalars(self): return 3
505 def getScalars(self): return [self.x, self.y, self.z]
507 def typeString(self):
517 def vec4Swizzle(self):
520 def __str__(self):
530 def distance(self, v):
534 def dot(self, v):
538 def cross(self, v):
544 def abs(self):
550 def __neg__(self):
553 def __add__(self, val):
561 def __sub__(self, val):
564 def __mul__(self, val):
570 def __div__(self, val):
578 def boolAny(self): return Scalar(self.x or self.y or self.z)
579 def boolAll(self): return Scalar(self.x and self.y and self.z)
580 def boolNot(self): return Vec3(not self.x, not self.y, not self.z)
583 def __init__(self, x, y, z):
588 def typeString(self):
591 def __str__(self):
594 def abs(self):
598 def __init__(self, x, y, z, w):
605 def applyUnary(self, func): return Vec4(func(self.x), func(self.y), func(self.z), func(self.w))
606 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))
608 def expandVec(self, val): return val.toVec4()
609 def toScalar(self): return Scalar(self.x)
610 def toVec2(self): return Vec2(self.x, self.y)
611 def toVec3(self): return Vec3(self.x, self.y, self.z)
612 def toVec4(self): return Vec4(self.x, self.y, self.z, self.w)
613 def toUVec2(self): return UVec2(self.x, self.y)
614 def toUVec3(self): return UVec3(self.x, self.y, self.z)
615 def toUVec4(self): return UVec4(self.x, self.y, self.z, self.w)
616 def toMat2(self): return Mat2(float(self.x), float(self.y), float(self.z), float(self.w))
617 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));
619 def toFloat(self): return Vec4(float(self.x), float(self.y), float(self.z), float(self.w))
620 def toInt(self): return Vec4(int(self.x), int(self.y), int(self.z), int(self.w))
621 def toUint(self): return UVec4(int(self.x), int(self.y), int(self.z), int(self.w))
622 def toBool(self): return Vec4(bool(self.x), bool(self.y), bool(self.z), bool(self.w))
624 def getNumScalars(self): return 4
625 def getScalars(self): return [self.x, self.y, self.z, self.w]
627 def typeString(self):
637 def vec4Swizzle(self):
640 def __str__(self):
650 def distance(self, v):
654 def dot(self, v):
658 def abs(self):
664 def __neg__(self):
667 def __add__(self, val):
675 def __sub__(self, val):
678 def __mul__(self, val):
684 def __div__(self, val):
692 def boolAny(self): return Scalar(self.x or self.y or self.z or self.w)
693 def boolAll(self): return Scalar(self.x and self.y and self.z and self.w)
694 def boolNot(self): return Vec4(not self.x, not self.y, not self.z, not self.w)
697 def __init__(self, x, y, z, w):
702 def typeString(self):
705 def __str__(self):
708 def abs(self):
713 def __init__ (self, numCols, numRows, scalars):
720 def fromScalar (numCols, numRows, scalar):
728 def identity (numCols, numRows):
731 def get (self, colNdx, rowNdx):
736 def set (self, colNdx, rowNdx, scalar):
741 def toMatrix (self, numCols, numRows):
748 def toMat2 (self): return self.toMatrix(2, 2)
749 def toMat2x3 (self): return self.toMatrix(2, 3)
750 def toMat2x4 (self): return self.toMatrix(2, 4)
751 def toMat3x2 (self): return self.toMatrix(3, 2)
752 def toMat3 (self): return self.toMatrix(3, 3)
753 def toMat3x4 (self): return self.toMatrix(3, 4)
754 def toMat4x2 (self): return self.toMatrix(4, 2)
755 def toMat4x3 (self): return self.toMatrix(4, 3)
756 def toMat4 (self): return self.toMatrix(4, 4)
758 def typeString(self):
764 def __str__(self):
767 def isTypeEqual (self, other):
770 def isEqual(self, other):
774 def compMul(self, val):
779 def __init__(self, m00, m01, m10, m11):
783 def __init__(self, m00, m01, m02, m10, m11, m12, m20, m21, m22):
789 def __init__(self, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33):