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):
287 def __sub__(self, val):
290 def __mul__(self, val):
302 def __div__(self, val):
315 def __init__(self, x):
319 def typeString(self):
322 def abs(self):
325 def __neg__(self):
328 def __add__(self, val):
331 def __sub__(self, val):
334 def __mul__(self, val):
337 def __div__(self, val):
342 def fromScalarList(lst):
349 def isEqual(self, other):
353 def length(self):
356 def normalize(self):
359 def swizzle(self, indexList):
364 def __init__(self):
368 def __init__(self, x, y):
373 def applyUnary(self, func): return Vec2(func(self.x), func(self.y))
374 def applyBinary(self, func, other): return Vec2(func(self.x, other.x), func(self.y, other.y))
376 def expandVec(self, val): return val.toVec2()
377 def toScalar(self): return Scalar(self.x)
378 def toVec2(self): return Vec2(self.x, self.y)
379 def toVec3(self): return Vec3(self.x, self.y, 0.0)
380 def toVec4(self): return Vec4(self.x, self.y, 0.0, 0.0)
381 def toUVec2(self): return UVec2(self.x, self.y)
382 def toUVec3(self): return UVec3(self.x, self.y, 0.0)
383 def toUVec4(self): return UVec4(self.x, self.y, 0.0, 0.0)
384 def toMat2(self): return Mat2(float(self.x), 0.0, 0.0, float(self.y));
386 def toFloat(self): return Vec2(float(self.x), float(self.y))
387 def toInt(self): return Vec2(int(self.x), int(self.y))
388 def toUint(self): return UVec2(int(self.x), int(self.y))
389 def toBool(self): return Vec2(bool(self.x), bool(self.y))
391 def getNumScalars(self): return 2
392 def getScalars(self): return [self.x, self.y]
394 def typeString(self):
404 def vec4Swizzle(self):
407 def __str__(self):
417 def distance(self, v):
421 def dot(self, v):
425 def abs(self):
431 def __neg__(self):
434 def __add__(self, val):
442 def __sub__(self, val):
445 def __mul__(self, val):
451 def __div__(self, val):
458 def boolAny(self): return Scalar(self.x or self.y)
459 def boolAll(self): return Scalar(self.x and self.y)
460 def boolNot(self): return Vec2(not self.x, not self.y)
463 def __init__(self, x, y):
468 def typeString(self):
471 def __str__(self):
474 def abs(self):
478 def __init__(self, x, y, z):
484 def applyUnary(self, func): return Vec3(func(self.x), func(self.y), func(self.z))
485 def applyBinary(self, func, other): return Vec3(func(self.x, other.x), func(self.y, other.y), func(self.z, other.z))
487 def expandVec(self, val): return val.toVec3()
488 def toScalar(self): return Scalar(self.x)
489 def toVec2(self): return Vec2(self.x, self.y)
490 def toVec3(self): return Vec3(self.x, self.y, self.z)
491 def toVec4(self): return Vec4(self.x, self.y, self.z, 0.0)
492 def toUVec2(self): return UVec2(self.x, self.y)
493 def toUVec3(self): return UVec3(self.x, self.y, self.z)
494 def toUVec4(self): return UVec4(self.x, self.y, self.z, 0.0)
495 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));
497 def toFloat(self): return Vec3(float(self.x), float(self.y), float(self.z))
498 def toInt(self): return Vec3(int(self.x), int(self.y), int(self.z))
499 def toUint(self): return UVec3(int(self.x), int(self.y), int(self.z))
500 def toBool(self): return Vec3(bool(self.x), bool(self.y), bool(self.z))
502 def getNumScalars(self): return 3
503 def getScalars(self): return [self.x, self.y, self.z]
505 def typeString(self):
515 def vec4Swizzle(self):
518 def __str__(self):
528 def distance(self, v):
532 def dot(self, v):
536 def cross(self, v):
542 def abs(self):
548 def __neg__(self):
551 def __add__(self, val):
559 def __sub__(self, val):
562 def __mul__(self, val):
568 def __div__(self, val):
576 def boolAny(self): return Scalar(self.x or self.y or self.z)
577 def boolAll(self): return Scalar(self.x and self.y and self.z)
578 def boolNot(self): return Vec3(not self.x, not self.y, not self.z)
581 def __init__(self, x, y, z):
586 def typeString(self):
589 def __str__(self):
592 def abs(self):
596 def __init__(self, x, y, z, w):
603 def applyUnary(self, func): return Vec4(func(self.x), func(self.y), func(self.z), func(self.w))
604 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))
606 def expandVec(self, val): return val.toVec4()
607 def toScalar(self): return Scalar(self.x)
608 def toVec2(self): return Vec2(self.x, self.y)
609 def toVec3(self): return Vec3(self.x, self.y, self.z)
610 def toVec4(self): return Vec4(self.x, self.y, self.z, self.w)
611 def toUVec2(self): return UVec2(self.x, self.y)
612 def toUVec3(self): return UVec3(self.x, self.y, self.z)
613 def toUVec4(self): return UVec4(self.x, self.y, self.z, self.w)
614 def toMat2(self): return Mat2(float(self.x), float(self.y), float(self.z), float(self.w))
615 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));
617 def toFloat(self): return Vec4(float(self.x), float(self.y), float(self.z), float(self.w))
618 def toInt(self): return Vec4(int(self.x), int(self.y), int(self.z), int(self.w))
619 def toUint(self): return UVec4(int(self.x), int(self.y), int(self.z), int(self.w))
620 def toBool(self): return Vec4(bool(self.x), bool(self.y), bool(self.z), bool(self.w))
622 def getNumScalars(self): return 4
623 def getScalars(self): return [self.x, self.y, self.z, self.w]
625 def typeString(self):
635 def vec4Swizzle(self):
638 def __str__(self):
648 def distance(self, v):
652 def dot(self, v):
656 def abs(self):
662 def __neg__(self):
665 def __add__(self, val):
673 def __sub__(self, val):
676 def __mul__(self, val):
682 def __div__(self, val):
690 def boolAny(self): return Scalar(self.x or self.y or self.z or self.w)
691 def boolAll(self): return Scalar(self.x and self.y and self.z and self.w)
692 def boolNot(self): return Vec4(not self.x, not self.y, not self.z, not self.w)
695 def __init__(self, x, y, z, w):
700 def typeString(self):
703 def __str__(self):
706 def abs(self):
711 def __init__ (self, numCols, numRows, scalars):
718 def fromScalar (numCols, numRows, scalar):
726 def identity (numCols, numRows):
729 def get (self, colNdx, rowNdx):
734 def set (self, colNdx, rowNdx, scalar):
739 def toMatrix (self, numCols, numRows):
746 def toMat2 (self): return self.toMatrix(2, 2)
747 def toMat2x3 (self): return self.toMatrix(2, 3)
748 def toMat2x4 (self): return self.toMatrix(2, 4)
749 def toMat3x2 (self): return self.toMatrix(3, 2)
750 def toMat3 (self): return self.toMatrix(3, 3)
751 def toMat3x4 (self): return self.toMatrix(3, 4)
752 def toMat4x2 (self): return self.toMatrix(4, 2)
753 def toMat4x3 (self): return self.toMatrix(4, 3)
754 def toMat4 (self): return self.toMatrix(4, 4)
756 def typeString(self):
762 def __str__(self):
765 def isTypeEqual (self, other):
768 def isEqual(self, other):
772 def compMul(self, val):
777 def __init__(self, m00, m01, m10, m11):
781 def __init__(self, m00, m01, m02, m10, m11, m12, m20, m21, m22):
787 def __init__(self, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33):