small image->2d structure

hello everyone i would like to post my request here:

small image->2d structure

it is supossed to collect vertex position X Y and RGB values or Luminance or Saturation Values:

PIXEL x Val y Val RGB Val

i would sample an 120X96 image and get a 2d structure

please could you try and make such a thing?

thanks bern

bernardo's picture
trying with some javascript

well i spent the afternoon workin on this:

var temp = new Object();
 
var points = new Object();
 
function (__structure pointsWhite, __number pixelX, __number pixelY, __number normX, __number normY, __number currentIndexF) main ( __number rgbValue, __number currentIndex, __number iterations, __index numX, __index numY, __number targetWidth, __number targetHeight, __number imageScaler)
{
   var i = 0;
       var result = new Object();
   var normX = currentIndex % numX;
   var normY = Math.floor(currentIndex / numX);
   result.normX = ((normX + 0.5) / numX - 0.5) * targetWidth;
   result.normY = ((normY + 0.5) / numY - 0.5) * targetHeight;
   result.pixelX = normX * imageScaler;
   result.pixelY = normY * imageScaler;
   result.currentIndexF = currentIndex;
   return result;
 
   if (rgbValue > 0)
      {    
         px = normX;     // Point X
         py = normY;     // Point Y
         points[1] = Array(px,py,0);  // Point XYZ
         var result = new Object();
      }
 
      result.pointsWhite = points;
   return result;
 
 
 
}

but i still can get the javascript patch to selfupdate rapidly enough and i wanna make an ouput dinamic structure. I tryied to upate with an lfo and passing it to an image pixel patch with a conditional but it is too slow.

can you help? sorry for the english

thanks to memo for some of the code

bernardo's picture
a favor

can anyone post an example on how to build a custom patch in XCODE

thank you

nevermind found it: http://developer.apple.com/documentation/GraphicsImaging/Conceptual/Quar...

franz's picture
interesting source reading....

hi, consider having a look at this: http://www.planetclegg.com/projects/VideoPeggyMisc.html

then i guess skip the serial part ( and replace with a QC-structure output ? ) It shouldn't be that hard if you got some coding skills, as that plugin does exactly what you need (and more). If you ever manage to build such a thing, please consider posting it here someday...

bernardo's picture
allright

i am looking at it now!! i´ll be back soon... with some crazy wacked results.

b.

bernardo's picture
close enough to crazy

ok so i am getting closer to crazyness and could use some help thanks b. not a programmer Mr Christopher HELP!

bernardo's picture
Re: close enough to crazy

yes yes and back again. this time to really end it....