aboutsummaryrefslogtreecommitdiff
path: root/pixelevents
diff options
context:
space:
mode:
authorGravatar Russell <rcoh@rcoh.(none)>2011-01-10 12:21:19 -0500
committerGravatar Russell <rcoh@rcoh.(none)>2011-01-10 12:21:19 -0500
commitcbdc42af021f898e82d3e78ce7c636d3fb5eece0 (patch)
treef36ca72463702c104dd02f026e9fbcd6de3f0da8 /pixelevents
parent1679719e7ca8ce433c5714474a32c926161dc5b8 (diff)
Some performance improvements. Faster evaluation of range-based queries with
lambda expressions. Faster exp with approximated fastexp. Some changes to the component registry.
Diffstat (limited to 'pixelevents')
-rw-r--r--pixelevents/DecayEvent.py3
-rw-r--r--pixelevents/SingleFrameEvent.py8
2 files changed, 10 insertions, 1 deletions
diff --git a/pixelevents/DecayEvent.py b/pixelevents/DecayEvent.py
index c1166d6..3767729 100644
--- a/pixelevents/DecayEvent.py
+++ b/pixelevents/DecayEvent.py
@@ -1,6 +1,7 @@
from operationscore.PixelEvent import *
import math
from util.ColorOps import *
+import util.Geo as Geo
class DecayEvent(PixelEvent):
def initEvent(self):
self.coefficient = float(abs(self['Coefficient']))
@@ -13,7 +14,7 @@ class DecayEvent(PixelEvent):
#SUBVERTING DESIGN FOR THE SAKE OF EFFICIENCY -- RUSSELL COHEN (2011-01-03-23:18)
def state(self,timeDelay):
if self.decayType == 1:
- decay = math.exp(timeDelay*-1*self.coefficient)
+ decay = Geo.approxexp(timeDelay*-1*self.coefficient)
if self.decayType == 2:
decay = self.coefficient / timeDelay
color = multiplyColor(self.color, decay)
diff --git a/pixelevents/SingleFrameEvent.py b/pixelevents/SingleFrameEvent.py
new file mode 100644
index 0000000..1c6239f
--- /dev/null
+++ b/pixelevents/SingleFrameEvent.py
@@ -0,0 +1,8 @@
+from operationscore.PixelEvent import *
+class SingleFrameEvent(PixelEvent):
+ def initEvent(self):
+ self.rendered = False
+ def state(self):
+ if !self.rendered:
+ return self['Color']
+ return None