// display --------------------------------------------------------------------- class display { int ls = 22; // linespace int x, y, nn; float ty; int space = 0; int w = 213; int h = screenheight-space*2+1; int open = space-1; int closed = - w -1; // frequencies in third-octave-bands String[] frequencies = {"500", "630", "800", "1000", "1250", "1600", "2000", "2500", "3150", "4000", "5000"}; String[] frequencies2 = {"447 - 562", "562 - 708", "708 - 891", "891 - 1122", "1122 - 1413", "1413 - 1778", "1778 - 2239", "2239 - 2818", "2818 - 3548", "3548 - 4467", "4467 - 5623"}; // render -------------------------------------------------------------------- void render(float _x, float _y) { colorMode (HSB, 360, 100, 100, 100); x = int(_x); y = int(_y); y += space; // background overlay(x-1, y-1); x += 20; // content title(x, y + 30); pushMatrix(); scale(.75); thumbnails(x + 12, y + 110); popMatrix(); focus(x + 45, y + 610 + nn - 280); spectrum(x + 10, y + 610 - 280); } // debug --------------------------------------------------------------------- void debug(int _x, int _y) { textFont(supernatural); textAlign(LEFT); fill(46, 100, 100); // rotation text("RXNUM \t" + rxnum, _x, _y + ls * 0); text("RZNUM \t" + rznum, _x, _y + ls * 1); // position text("NMZNUM \t" + nmznum, _x, _y + ls * 3); text("NMX \t" + nmx, _x, _y + ls * 4); text("NMY \t" + nmy, _x, _y + ls * 5); // key text("KEYCODE \t" + keyCode, _x, _y + ls * 7); text("KEY \t" + key, _x, _y + ls * 8); // screen text("WIDTH \t" + width, _x, _y + ls * 10); text("HEIGHT \t" + height, _x, _y + ls * 11); text("THRESHOLD \t" + threshold, _x, _y + ls * 13); text("OFFSET \t" + offset, _x, _y + ls * 14); } // background ---------------------------------------------------------------- void overlay(int _x, int _y) { stroke(0, 0, 30); fill(0); rect(_x, _y, w, h); } // title --------------------------------------------------------------------- void title(int _x, int _y) { textFont(supernatural); textAlign(LEFT); fill(0, 0, 100); text("DIGITAL ACOUSTIC CARTOGRAPHY", _x + 5, _y); fill(0, 0, 50); text("frequency-anatomy", _x + 5, _y + 30); text("of an automobile gear", _x + 5, _y + ls + 26); } // thumbnails ---------------------------------------------------------------- void thumbnails(int _x, int _y) { int w = img[count].img.width / 2; // thumbnail height int h = img[count].img.height / 2; // thumbnail width int offset = imgmargin -ls; // vertical space between thumbnails // frequency thumbnail image(img[count].img, _x, _y + h - offset, w, h); // mask fill(0,0,0); noStroke(); rect(_x, _y + h - offset, w, imgmargin/2); rect(_x, _y + h*2 - imgmargin/2 - offset, w, imgmargin/2); // frame noFill(); stroke(0,0,30); rect(_x, _y + h + imgmargin/2 - offset, w, h - imgmargin); // photographic thumbnail image(vimage.c, _x, _y, w, h); noFill(); stroke(0,0,30); rect(_x, _y + imgmargin/2, w, h - imgmargin); if (showmarker) { // marker for (int i=0; i 0.1) { ty -= (ty - _y) / 1.1; }; int x = _x - 45; float y = ty - 12; rectMode(CORNER); noStroke(); fill(0, 0, 10); rect(x, y, 176, 18); } }