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 toBool(lst): return [Scalar(bool(v.x)) for v in lst]
118 def toVec4(lst): return [v.toFloat().toVec4() for v in lst]
119 def toVec3(lst): return [v.toFloat().toVec3() for v in lst]
120 def toVec2(lst): return [v.toFloat().toVec2() for v in lst]
121 def toIVec4(lst): return [v.toInt().toVec4() for v in lst]
122 def toIVec3(lst): return [v.toInt().toVec3() for v in lst]
123 def toIVec2(lst): return [v.toInt().toVec2() for v in lst]
124 def toBVec4(lst): return [v.toBool().toVec4() for v in lst]
125 def toBVec3(lst): return [v.toBool().toVec3() for v in lst]
126 def toBVec2(lst): return [v.toBool().toVec2() for v in lst]
127 def toMat2(lst): return [v.toMat2() for v in lst]
128 def toMat3(lst): return [v.toMat3() for v in lst]
129 def toMat4(lst): return [v.toMat4() for v in lst]
134 def __init__(self):
137 def uniformVec4(self, count, mn, mx):
144 def uniformBVec4(self, count):
150 # def uniform(self,
154 def glslSign(a): return 0.0 if (a == 0) else +1.0 if (a > 0.0) else -1.0
155 def glslMod(x, y): return x - y*math.floor(x/y)
156 def glslClamp(x, mn, mx): return mn if (x < mn) else mx if (x > mx) else x
160 def unary(func): return lambda val: val.applyUnary(func)
163 def binary(func): return lambda a, b: (b.expandVec(a)).applyBinary(func, a.expandVec(b))
166 def frac(val): return val.applyUnary(lambda x: x - math.floor(x))
169 def exp2(val): return val.applyUnary(lambda x: math.pow(2.0, x))
172 def log2(val): return val.applyUnary(lambda x: math.log(x, 2.0))
175 def rsq(val): return val.applyUnary(lambda x: 1.0 / math.sqrt(x))
178 def sign(val): return val.applyUnary(glslSign)
181 def isEqual(a, b): return Scalar(a.isEqual(b))
184 def isNotEqual(a, b): return Scalar(not a.isEqual(b))
187 def step(a, b): return (b.expandVec(a)).applyBinary(lambda edge, x: [1.0, 0.0][x < edge], a.expandVec(b))
190 def length(a): return a.length()
193 def distance(a, b): return a.distance(b)
196 def dot(a, b): return a.dot(b)
199 def cross(a, b): return a.cross(b)
202 def normalize(a): return a.normalize()
205 def boolAny(a): return a.boolAny()
208 def boolAll(a): return a.boolAll()
211 def boolNot(a): return a.boolNot()
216 def __init__(self, x):
219 def applyUnary(self, func): return Scalar(func(self.x))
220 def applyBinary(self, func, other): return Scalar(func(self.x, other.x))
222 def isEqual(self, other): assert isinstance(other, Scalar); return (self.x == other.x)
224 def expandVec(self, val): return val
225 def toScalar(self): return Scalar(self.x)
226 def toVec2(self): return Vec2(self.x, self.x)
227 def toVec3(self): return Vec3(self.x, self.x, self.x)
228 def toVec4(self): return Vec4(self.x, self.x, self.x, self.x)
229 def toMat2(self): return self.toVec2().toMat2()
230 def toMat3(self): return self.toVec3().toMat3()
231 def toMat4(self): return self.toVec4().toMat4()
233 def toFloat(self): return Scalar(float(self.x))
234 def toInt(self): return Scalar(int(self.x))
235 def toBool(self): return Scalar(bool(self.x))
237 def getNumScalars(self): return 1
238 def getScalars(self): return [self.x]
240 def typeString(self):
250 def vec4Swizzle(self):
253 def __str__(self):
256 def length(self):
259 def distance(self, v):
263 def dot(self, v):
267 def normalize(self):
270 def __neg__(self):
273 def __add__(self, val):
277 def __sub__(self, val):
280 def __mul__(self, val):
292 def __div__(self, val):
306 def fromScalarList(lst):
313 def isEqual(self, other):
317 def length(self):
320 def normalize(self):
323 def swizzle(self, indexList):
328 def __init__(self):
332 def __init__(self, x, y):
337 def applyUnary(self, func): return Vec2(func(self.x), func(self.y))
338 def applyBinary(self, func, other): return Vec2(func(self.x, other.x), func(self.y, other.y))
340 def expandVec(self, val): return val.toVec2()
341 def toScalar(self): return Scalar(self.x)
342 def toVec2(self): return Vec2(self.x, self.y)
343 def toVec3(self): return Vec3(self.x, self.y, 0.0)
344 def toVec4(self): return Vec4(self.x, self.y, 0.0, 0.0)
345 def toMat2(self): return Mat2(float(self.x), 0.0, 0.0, float(self.y));
347 def toFloat(self): return Vec2(float(self.x), float(self.y))
348 def toInt(self): return Vec2(int(self.x), int(self.y))
349 def toBool(self): return Vec2(bool(self.x), bool(self.y))
351 def getNumScalars(self): return 2
352 def getScalars(self): return [self.x, self.y]
354 def typeString(self):
364 def vec4Swizzle(self):
367 def __str__(self):
377 def distance(self, v):
381 def dot(self, v):
385 def __neg__(self):
388 def __add__(self, val):
396 def __sub__(self, val):
399 def __mul__(self, val):
405 def __div__(self, val):
412 def boolAny(self): return Scalar(self.x or self.y)
413 def boolAll(self): return Scalar(self.x and self.y)
414 def boolNot(self): return Vec2(not self.x, not self.y)
417 def __init__(self, x, y, z):
423 def applyUnary(self, func): return Vec3(func(self.x), func(self.y), func(self.z))
424 def applyBinary(self, func, other): return Vec3(func(self.x, other.x), func(self.y, other.y), func(self.z, other.z))
426 def expandVec(self, val): return val.toVec3()
427 def toScalar(self): return Scalar(self.x)
428 def toVec2(self): return Vec2(self.x, self.y)
429 def toVec3(self): return Vec3(self.x, self.y, self.z)
430 def toVec4(self): return Vec4(self.x, self.y, self.z, 0.0)
431 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));
433 def toFloat(self): return Vec3(float(self.x), float(self.y), float(self.z))
434 def toInt(self): return Vec3(int(self.x), int(self.y), int(self.z))
435 def toBool(self): return Vec3(bool(self.x), bool(self.y), bool(self.z))
437 def getNumScalars(self): return 3
438 def getScalars(self): return [self.x, self.y, self.z]
440 def typeString(self):
450 def vec4Swizzle(self):
453 def __str__(self):
463 def distance(self, v):
467 def dot(self, v):
471 def cross(self, v):
477 def __neg__(self):
480 def __add__(self, val):
488 def __sub__(self, val):
491 def __mul__(self, val):
497 def __div__(self, val):
503 def boolAny(self): return Scalar(self.x or self.y or self.z)
504 def boolAll(self): return Scalar(self.x and self.y and self.z)
505 def boolNot(self): return Vec3(not self.x, not self.y, not self.z)
508 def __init__(self, x, y, z, w):
515 def applyUnary(self, func): return Vec4(func(self.x), func(self.y), func(self.z), func(self.w))
516 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))
518 def expandVec(self, val): return val.toVec4()
519 def toScalar(self): return Scalar(self.x)
520 def toVec2(self): return Vec2(self.x, self.y)
521 def toVec3(self): return Vec3(self.x, self.y, self.z)
522 def toVec4(self): return Vec4(self.x, self.y, self.z, self.w)
523 def toMat2(self): return Mat2(float(self.x), float(self.y), float(self.z), float(self.w))
524 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));
526 def toFloat(self): return Vec4(float(self.x), float(self.y), float(self.z), float(self.w))
527 def toInt(self): return Vec4(int(self.x), int(self.y), int(self.z), int(self.w))
528 def toBool(self): return Vec4(bool(self.x), bool(self.y), bool(self.z), bool(self.w))
530 def getNumScalars(self): return 4
531 def getScalars(self): return [self.x, self.y, self.z, self.w]
533 def typeString(self):
543 def vec4Swizzle(self):
546 def __str__(self):
556 def distance(self, v):
560 def dot(self, v):
564 def __neg__(self):
567 def __add__(self, val):
575 def __sub__(self, val):
578 def __mul__(self, val):
584 def __div__(self, val):
590 def boolAny(self): return Scalar(self.x or self.y or self.z or self.w)
591 def boolAll(self): return Scalar(self.x and self.y and self.z and self.w)
592 def boolNot(self): return Vec4(not self.x, not self.y, not self.z, not self.w)
596 def __init__ (self, numCols, numRows, scalars):
603 def identity (numCols, numRows):
610 def get (self, colNdx, rowNdx):
615 def set (self, colNdx, rowNdx, scalar):
620 def toMatrix (self, numCols, numRows):
627 def toMat2 (self): return self.toMatrix(2, 2)
628 def toMat2x3 (self): return self.toMatrix(2, 3)
629 def toMat2x4 (self): return self.toMatrix(2, 4)
630 def toMat3x2 (self): return self.toMatrix(3, 2)
631 def toMat3 (self): return self.toMatrix(3, 3)
632 def toMat3x4 (self): return self.toMatrix(3, 4)
633 def toMat4x2 (self): return self.toMatrix(4, 2)
634 def toMat4x3 (self): return self.toMatrix(4, 3)
635 def toMat4 (self): return self.toMatrix(4, 4)
637 def typeString(self):
643 def __str__(self):
646 def isTypeEqual (self, other):
649 def isEqual(self, other):
653 def compMul(self, val):
658 def __init__(self, m00, m01, m10, m11):
662 def __init__(self, m00, m01, m02, m10, m11, m12, m20, m21, m22):
668 def __init__(self, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33):