Archive for November, 2009


The 27 Permutions Of The RGB Channels

Sometimes it’s nice to do something really simple.

Core Image Filter Kernels:

	The 27 permutations of the RGB channels.
	toneburst 2009

kernel vec4 RRR(sampler image) { return sample(image, samplerCoord(image)).rrra; }
kernel vec4 RRG(sampler image) { return sample(image, samplerCoord(image)).rrga; }
kernel vec4 RRB(sampler image) { return sample(image, samplerCoord(image)).rrba; }
kernel vec4 RGG(sampler image) { return sample(image, samplerCoord(image)).rgga; }
kernel vec4 RGB(sampler image) { return sample(image, samplerCoord(image)).rgba; }
kernel vec4 RGR(sampler image) { return sample(image, samplerCoord(image)).rgra; }
kernel vec4 RBR(sampler image) { return sample(image, samplerCoord(image)).rbra; }
kernel vec4 RBG(sampler image) { return sample(image, samplerCoord(image)).rbga; }
kernel vec4 RBB(sampler image) { return sample(image, samplerCoord(image)).rbba; }

kernel vec4 GRR(sampler image) { return sample(image, samplerCoord(image)).grra; }
kernel vec4 GRG(sampler image) { return sample(image, samplerCoord(image)).grga; }
kernel vec4 GRB(sampler image) { return sample(image, samplerCoord(image)).grba; }
kernel vec4 GGR(sampler image) { return sample(image, samplerCoord(image)).ggra; }
kernel vec4 GGG(sampler image) { return sample(image, samplerCoord(image)).ggga; }
kernel vec4 GGB(sampler image) { return sample(image, samplerCoord(image)).ggba; }
kernel vec4 GBR(sampler image) { return sample(image, samplerCoord(image)).gbra; }
kernel vec4 GBG(sampler image) { return sample(image, samplerCoord(image)).gbga; }
kernel vec4 GBB(sampler image) { return sample(image, samplerCoord(image)).gbba; }

kernel vec4 BRR(sampler image) { return sample(image, samplerCoord(image)).brra; }
kernel vec4 BRG(sampler image) { return sample(image, samplerCoord(image)).brga; }
kernel vec4 BRB(sampler image) { return sample(image, samplerCoord(image)).brba; }
kernel vec4 BGR(sampler image) { return sample(image, samplerCoord(image)).bgra; }
kernel vec4 BGG(sampler image) { return sample(image, samplerCoord(image)).bgga; }
kernel vec4 BGB(sampler image) { return sample(image, samplerCoord(image)).bgba; }
kernel vec4 BBR(sampler image) { return sample(image, samplerCoord(image)).bbra; }
kernel vec4 BBG(sampler image) { return sample(image, samplerCoord(image)).bbga; }
kernel vec4 BBB(sampler image) { return sample(image, samplerCoord(image)).bbba; }

Filter Function javascript:

	The 27 permutations of the RGB channels.
	toneburst 2009

function __image main(__image Image, __index Permutation) {
	switch(Permutation) {
		case  0: return RRR.apply(Image.definition, null, Image); break;
		case  1: return RRG.apply(Image.definition, null, Image); break;
		case  2: return RRB.apply(Image.definition, null, Image); break;
		case  3: return RGG.apply(Image.definition, null, Image); break;
		case  4: return RGB.apply(Image.definition, null, Image); break;
		case  5: return RGR.apply(Image.definition, null, Image); break;
		case  6: return RBR.apply(Image.definition, null, Image); break;
		case  7: return RBG.apply(Image.definition, null, Image); break;
		case  8: return RBB.apply(Image.definition, null, Image); break;
		case  9: return GRR.apply(Image.definition, null, Image); break;
		case 10: return GRG.apply(Image.definition, null, Image); break;
		case 11: return GRB.apply(Image.definition, null, Image); break;
		case 12: return GGR.apply(Image.definition, null, Image); break;
		case 13: return GGG.apply(Image.definition, null, Image); break;
		case 14: return GGB.apply(Image.definition, null, Image); break;
		case 15: return GBR.apply(Image.definition, null, Image); break;
		case 16: return GBG.apply(Image.definition, null, Image); break;
		case 17: return GBB.apply(Image.definition, null, Image); break;
		case 18: return BRR.apply(Image.definition, null, Image); break;
		case 19: return BRG.apply(Image.definition, null, Image); break;
		case 20: return BRB.apply(Image.definition, null, Image); break;
		case 21: return BGR.apply(Image.definition, null, Image); break;
		case 22: return BGG.apply(Image.definition, null, Image); break;
		case 23: return BGB.apply(Image.definition, null, Image); break;
		case 24: return BBR.apply(Image.definition, null, Image); break;
		case 25: return BBG.apply(Image.definition, null, Image); break;
		case 26: return BBB.apply(Image.definition, null, Image); break;

Time Cube Experiments

Quick grabs. Explanation to follow.


The Original And Best…

Just by way of illustrating how far my R-E emulation has to go to match the real thing:

See if you can spot which bits are genuine analogue Scan-Processor, and which are later digital additions.

Thanks so much to Brian O’Reilly for sharing this stuff. I’m hoping we’re going to see more from the archives soon.


OpenCL Sort-Of Rutt-Etra

OK, this one needs some explanation. I know it looks almost exactly like vade’s Rutt-Etra plugin, but this one takes a slightly different approach. It’s essentially a slightly reworked version of the Apple OpenCL Text Extrusion example QTZ. I thought I’d try messing around with putting the resulting mesh inside a Kineme Polygon Mode patch (from GL Tools). I initially tried setting it to render only the raw vertices as points. You can see what that looked like in the video in the previous post.

Then, I thought I’d try rendering the mesh in Wireframe mode. Initially, there was a problem with long lines connecting the end of each row to the beginning of the next. I fixed this by stealing vade’s trick of reversing the direction of the vertices of each line. I then had to compensate for this by reversing every other line of the original input image. I actually did this with a CIFilter (thanks to cwright for showing me the error of my ways with the GLSL mod() function), though I’m sure it could be done also in the OpenCL kernel.

This later version has Point and Line modes, colour and monochrome, and some other bits and options.


OpenCL Sort-Of Particles


Time Grid

AN intermediate form, soon to evolve into something more interesting, time-permitting.


November 2009
« Oct   Feb »


Blog Stats

  • 491,796 hits