Hi CWright!
The code below seems to do the do.
a|x
Begin forwarded message:
From: Alex Drinkwater <[email protected]>
Date: 2 March 2009 12:53:50 GMT
To: Tom Butterworth <[email protected]>
Subject: Re: Creating Constant Color Inside CIFilter
Hiya Tom,
thanks very much for getting back to me.
On 2 Mar 2009, at 12:35, Tom Butterworth wrote:
A CIFilter needn't have an image input. I use the following to
generate a solid grey image:
Image Kernel:
kernel vec4 image(float seed)
{
return vec4(seed, seed, seed, 1.0);
}
Filter Function:
function __image main(__number seed) {
return image.apply(null, null, seed);
}
Is that the sort of thing you mean?
Yep, that's the kind of thing I had in mind.
I think the problem with this approach is that you end up with an
image that needs to be cropped. Or am I wrong?
I did manage to write some code that seemed to do the job though:
////////////////////////////////
///// JavaScript //////
////////////////////////////////
function __image main(__index Size, __color Color) {
// create color-block
var blockColor = Filter.CIConstantColorGenerator(Color);
// Crop color-block
var rect = new Vec(0, 0, Size, Size);
var outImg = Filter.CICrop(colorBlock, rect);
// Output
return outImg;
}
////////////////////////////////
Which seems to do the job, without actually using a filter kernel
at all.
Don't know if this method is a good way of going about it though.
Cheers,
a|x
Cheers - Tom
On 2 Mar 2009, at 12:07, Alex Drinkwater wrote:
Just wondering if it's possible to create a constant color image
of a specified size using JavaScript in a CIFilter patch.
I've been working on some patches that generate patterns based on
xy coordinates, and have been feeding a cropped Constant Color
patch into the CIFilter to create the initial texture. I'm just
wondering if it would be possible to to tidy things up a bit and
eliminate the need to do this, by actually creating the base
image inside the CIFilter patch itself.
a|x
http://machinesdontcare.wordpress.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list (Quartzcomposer-
[email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/
bangnoise%40gmail.com
This email sent to [email protected]
_______________________________________________
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]