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 toBool(lst): return [Scalar(bool(v.x)) for v in lst]
96 def toVec4(lst): return [v.toFloat().toVec4() for v in lst]
97 def toVec3(lst): return [v.toFloat().toVec3() for v in lst]
98 def toVec2(lst): return [v.toFloat().toVec2() for v in lst]
99 def toIVec4(lst): return [v.toInt().toVec4() for v in lst]
100 def toIVec3(lst): return [v.toInt().toVec3() for v in lst]
101 def toIVec2(lst): return [v.toInt().toVec2() for v in lst]
102 def toBVec4(lst): return [v.toBool().toVec4() for v in lst]
103 def toBVec3(lst): return [v.toBool().toVec3() for v in lst]
104 def toBVec2(lst): return [v.toBool().toVec2() for v in lst]
105 def toMat2(lst): return [v.toMat2() for v in lst]
106 def toMat3(lst): return [v.toMat3() for v in lst]
107 def toMat4(lst): return [v.toMat4() for v in lst]
112 def __init__(self):
115 def uniformVec4(self, count, mn, mx):
122 def uniformBVec4(self, count):
128 # def uniform(self,
132 def glslSign(a): return 0.0 if (a == 0) else +1.0 if (a > 0.0) else -1.0
133 def glslMod(x, y): return x - y*math.floor(x/y)
134 def glslClamp(x, mn, mx): return mn if (x < mn) else mx if (x > mx) else x
138 def unary(func): return lambda val: val.applyUnary(func)
141 def binary(func): return lambda a, b: (b.expandVec(a)).applyBinary(func, a.expandVec(b))
144 def frac(val): return val.applyUnary(lambda x: x - math.floor(x))
147 def exp2(val): return val.applyUnary(lambda x: math.pow(2.0, x))
150 def log2(val): return val.applyUnary(lambda x: math.log(x, 2.0))
153 def rsq(val): return val.applyUnary(lambda x: 1.0 / math.sqrt(x))
156 def sign(val): return val.applyUnary(glslSign)
159 def isEqual(a, b): return Scalar(a.isEqual(b))
162 def isNotEqual(a, b): return Scalar(not a.isEqual(b))
165 def step(a, b): return (b.expandVec(a)).applyBinary(lambda edge, x: [1.0, 0.0][x < edge], a.expandVec(b))
168 def length(a): return a.length()
171 def distance(a, b): return a.distance(b)
174 def dot(a, b): return a.dot(b)
177 def cross(a, b): return a.cross(b)
180 def normalize(a): return a.normalize()
183 def boolAny(a): return a.boolAny()
186 def boolAll(a): return a.boolAll()
189 def boolNot(a): return a.boolNot()
194 def __init__(self, x):
197 def applyUnary(self, func): return Scalar(func(self.x))
198 def applyBinary(self, func, other): return Scalar(func(self.x, other.x))
200 def isEqual(self, other): assert isinstance(other, Scalar); return (self.x == other.x)
202 def expandVec(self, val): return val
203 def toScalar(self): return Scalar(self.x)
204 def toVec2(self): return Vec2(self.x, self.x)
205 def toVec3(self): return Vec3(self.x, self.x, self.x)
206 def toVec4(self): return Vec4(self.x, self.x, self.x, self.x)
207 def toMat2(self): return self.toVec2().toMat2()
208 def toMat3(self): return self.toVec3().toMat3()
209 def toMat4(self): return self.toVec4().toMat4()
211 def toFloat(self): return Scalar(float(self.x))
212 def toInt(self): return Scalar(int(self.x))
213 def toBool(self): return Scalar(bool(self.x))
215 def getNumScalars(self): return 1
216 def getScalars(self): return [self.x]
218 def typeString(self):
228 def vec4Swizzle(self):
231 def __str__(self):
234 def length(self):
237 def distance(self, v):
241 def dot(self, v):
245 def normalize(self):
248 def __neg__(self):
251 def __add__(self, val):
255 def __sub__(self, val):
258 def __mul__(self, val):
270 def __div__(self, val):
284 def fromScalarList(lst):
291 def isEqual(self, other):
295 def length(self):
298 def normalize(self):
301 def swizzle(self, indexList):
306 def __init__(self):
310 def __init__(self, x, y):
315 def applyUnary(self, func): return Vec2(func(self.x), func(self.y))
316 def applyBinary(self, func, other): return Vec2(func(self.x, other.x), func(self.y, other.y))
318 def expandVec(self, val): return val.toVec2()
319 def toScalar(self): return Scalar(self.x)
320 def toVec2(self): return Vec2(self.x, self.y)
321 def toVec3(self): return Vec3(self.x, self.y, 0.0)
322 def toVec4(self): return Vec4(self.x, self.y, 0.0, 0.0)
323 def toMat2(self): return Mat2(float(self.x), 0.0, 0.0, float(self.y));
325 def toFloat(self): return Vec2(float(self.x), float(self.y))
326 def toInt(self): return Vec2(int(self.x), int(self.y))
327 def toBool(self): return Vec2(bool(self.x), bool(self.y))
329 def getNumScalars(self): return 2
330 def getScalars(self): return [self.x, self.y]
332 def typeString(self):
342 def vec4Swizzle(self):
345 def __str__(self):
355 def distance(self, v):
359 def dot(self, v):
363 def __neg__(self):
366 def __add__(self, val):
374 def __sub__(self, val):
377 def __mul__(self, val):
383 def __div__(self, val):
390 def boolAny(self): return Scalar(self.x or self.y)
391 def boolAll(self): return Scalar(self.x and self.y)
392 def boolNot(self): return Vec2(not self.x, not self.y)
395 def __init__(self, x, y, z):
401 def applyUnary(self, func): return Vec3(func(self.x), func(self.y), func(self.z))
402 def applyBinary(self, func, other): return Vec3(func(self.x, other.x), func(self.y, other.y), func(self.z, other.z))
404 def expandVec(self, val): return val.toVec3()
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, self.z)
408 def toVec4(self): return Vec4(self.x, self.y, self.z, 0.0)
409 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));
411 def toFloat(self): return Vec3(float(self.x), float(self.y), float(self.z))
412 def toInt(self): return Vec3(int(self.x), int(self.y), int(self.z))
413 def toBool(self): return Vec3(bool(self.x), bool(self.y), bool(self.z))
415 def getNumScalars(self): return 3
416 def getScalars(self): return [self.x, self.y, self.z]
418 def typeString(self):
428 def vec4Swizzle(self):
431 def __str__(self):
441 def distance(self, v):
445 def dot(self, v):
449 def cross(self, v):
455 def __neg__(self):
458 def __add__(self, val):
466 def __sub__(self, val):
469 def __mul__(self, val):
475 def __div__(self, val):
481 def boolAny(self): return Scalar(self.x or self.y or self.z)
482 def boolAll(self): return Scalar(self.x and self.y and self.z)
483 def boolNot(self): return Vec3(not self.x, not self.y, not self.z)
486 def __init__(self, x, y, z, w):
493 def applyUnary(self, func): return Vec4(func(self.x), func(self.y), func(self.z), func(self.w))
494 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))
496 def expandVec(self, val): return val.toVec4()
497 def toScalar(self): return Scalar(self.x)
498 def toVec2(self): return Vec2(self.x, self.y)
499 def toVec3(self): return Vec3(self.x, self.y, self.z)
500 def toVec4(self): return Vec4(self.x, self.y, self.z, self.w)
501 def toMat2(self): return Mat2(float(self.x), float(self.y), float(self.z), float(self.w))
502 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));
504 def toFloat(self): return Vec4(float(self.x), float(self.y), float(self.z), float(self.w))
505 def toInt(self): return Vec4(int(self.x), int(self.y), int(self.z), int(self.w))
506 def toBool(self): return Vec4(bool(self.x), bool(self.y), bool(self.z), bool(self.w))
508 def getNumScalars(self): return 4
509 def getScalars(self): return [self.x, self.y, self.z, self.w]
511 def typeString(self):
521 def vec4Swizzle(self):
524 def __str__(self):
534 def distance(self, v):
538 def dot(self, v):
542 def __neg__(self):
545 def __add__(self, val):
553 def __sub__(self, val):
556 def __mul__(self, val):
562 def __div__(self, val):
568 def boolAny(self): return Scalar(self.x or self.y or self.z or self.w)
569 def boolAll(self): return Scalar(self.x and self.y and self.z and self.w)
570 def boolNot(self): return Vec4(not self.x, not self.y, not self.z, not self.w)
574 def __init__ (self, numCols, numRows, scalars):
581 def identity (numCols, numRows):
588 def get (self, colNdx, rowNdx):
593 def set (self, colNdx, rowNdx, scalar):
598 def toMatrix (self, numCols, numRows):
605 def toMat2 (self): return self.toMatrix(2, 2)
606 def toMat2x3 (self): return self.toMatrix(2, 3)
607 def toMat2x4 (self): return self.toMatrix(2, 4)
608 def toMat3x2 (self): return self.toMatrix(3, 2)
609 def toMat3 (self): return self.toMatrix(3, 3)
610 def toMat3x4 (self): return self.toMatrix(3, 4)
611 def toMat4x2 (self): return self.toMatrix(4, 2)
612 def toMat4x3 (self): return self.toMatrix(4, 3)
613 def toMat4 (self): return self.toMatrix(4, 4)
615 def typeString(self):
621 def __str__(self):
624 def isTypeEqual (self, other):
627 def isEqual(self, other):
631 def compMul(self, val):
636 def __init__(self, m00, m01, m10, m11):
640 def __init__(self, m00, m01, m02, m10, m11, m12, m20, m21, m22):
646 def __init__(self, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33):