<languageVersion : 1.0;>

kernel Pixelate
<	vendor : "MIT Media Laboratory";
	namespace : "filters";
	version : 1;
	description : "Scratch Pixelate";
>
{
	parameter float pixelSize
	<
		minValue: 1.0;
		maxValue: 100.0;
		defaultValue: 1.0;
	>;

	input image4 src;
	output pixel4 dst;

	void evaluatePixel() {
		float2 p = floor(outCoord() / pixelSize) * pixelSize;
		dst = sampleNearest(src, p);
	}
}
