Thursday, July 2, 2009

2nd July

Working out taking colour average difference. using combination of code used in Practical 10  of CS6114 Digital Video Compression and Delivery and the example found on this website. http://theolagendijk.wordpress.com/2006/07/01/taking-color-average-from-image/ specifically this part.

import flash.display.BitmapData;

var image:MovieClip = this["image"];
image._x = 100;
image._y = 100;
image._visible = true;

var bitmap:BitmapData = new BitmapData(image._width,image._height,false);
bitmap.draw(image);

var sumColorR:Number = 0;
var sumColorG:Number = 0;
var sumColorB:Number = 0;
var count:Number = 0;

for(var h:Number = 0; h < number =" 0;" number =" bitmap.getPixel(w,">>> 16;
sumColorG += (col & 0×00FF00) >>> 8;
sumColorB += (col & 0×0000FF);
count++;
}
}

It is hoped that once I have this working, I will be be able to attach filters and use more suitable methods of difference detection.

Have also begun preliminary interface design

No comments:

Post a Comment