ObjectMuckerEffect(GLucose glucose) {
super(glucose);
}
- public void doApply(int[] colors){
+ public void apply(int[] colors){
/*for(Strip s: model.strips){
for(int i=0; i<s.points.size(); i++){
int index = s.points.get(i).index;
color c = colors[index];
- colors[index] = color((i*22.5), saturation(c), brightness(c));
+ colors[index] = lx.hsb((i*22.5), saturation(c), brightness(c));
}
}*/
}
frames[i] = new int[model.points.size()];
}
}
- public void doApply(int[] colors) {
+ public void apply(int[] colors) {
if(fcount<maxfbuf){
for(int i=0; i<colors.length; i++){
frames[(maxfbuf-1)-fcount][i]=colors[i];
balls[ballnum].y = msg.get(1).floatValue();
}
- void run(int deltaMs){
- for(Point p: model.points){ colors[p.index]=0; }
+ void run(double deltaMs){
+ for(LXPoint p: model.points){ colors[p.index]=0; }
for(int i=1; i<balls.length; i++){
if(millis() - balls[i].lastSeen < 1000) {
- for(Point p: model.points){
+ for(LXPoint p: model.points){
int x = int(balls[i].x * 255.0);
int y = int(balls[i].y * 127.0);
if(p.x < x+4 && p.x > x-4 && p.y < y+4 && p.y > y-4) { colors[p.index] = #FF0000; }
pret = new PImage(8, 128, ARGB);
ss = new ScreenShot();
}
- void run(int deltaMs){
+ void run(double deltaMs){
int x=(1366/2)+516;
int y=768-516;
int w=8;
pret.pixels = ss.getScreenShotJNI2(x, y, w, h);
//for(int i=0; i<px.length; i++){ pret.pixels[i] = px[i]; }
//println(pret.get(10,10));
- for(Point p: model.points){
+ for(LXPoint p: model.points){
colors[p.index] = pret.get((int(p.x)/8)*8, 128-int(p.y));
}
}