// frequencies ----------------------------------------------------------------- class frequencies { PImage img; int[][] imgColors = new int[imgwidth][imgheight]; int[][] imgPixels = new int[imgwidth][imgheight]; float t, tt; int id; int hshift = 175; // HSB offset frequencies(int _id) { id = _id; loadTexture(); } // load texture image -------------------------------------------------------- void loadTexture() { img = loadImage("img_" + id + ".jpg"); println("img_" + id + ".jpg \t loaded"); // analyse(); } // pixelmap ------------------------------------------------------------------ void pixelmap(color _c, float _offset) { colorMode(RGB, 255); for(int i=0; i threshold) { stroke(_c); point (i, j, imgColors[j][i] * d + _offset); } } } } // image outline ------------------------------------------------------------- void outline(color _c) { beginShape(TRIANGLE_STRIP); stroke(_c); // left for(int j=imgmargin; j<=imgheight-imgmargin-1; j+=res) { int i = 0; vertex(vimage.p[i][j].x, vimage.p[i][j].y, imgColors[j][i] * d); } // bottom for(int i=0; i=imgmargin; j-=res) { int i = imgwidth - 1; vertex(vimage.p[i][j].x, vimage.p[i][j].y, imgColors[j][i] * d); } // top for(int i=0; i threshold) { t = imgColors[j][i] * d; tt = imgColors[j][i+res] * d; stroke(_c); texture(img); vertex(i,j,t + _offset,i,j); vertex(i+res, j, tt + _offset, i+res, j); } } endShape(); } } // analyse image ------------------------------------------------------------- void analyse() { for(int i=0; i hshift) { h = h - 255; } imgColors[i][j] = int(hshift - h); } } } }