Create an object:

var myObject = new Object()

Then add the image and the brightness, which you can compute externally:

myObject.image = image
myObject.brightness = brightness

Then store the image in an array

myArray[index] = myObject

Once you've downloaded and processed all of the images then sort

myArray.sort(f)

Where f simply compares the brightness

function f(a, b) {
        return a.brightness-b.brightness
}

Here's an example which shows it working:

Attachment: Brightness Sort.qtz
Description: application/quartzcomposer



.xX

On Aug 3, 2008, at 1:58 PM, aienn wrote:


On Aug 4, 2008, at 12:12 AM, Alessandro Sabatelli wrote:

You can store the average brightness along with the image and then return the sorted list of images from JS.

Yep, I already figured out the JS and averaging stuff, but how exactly do I store the average brightness along with the image, as you're suggesting?

a.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to