/* * hsvmerge2 - 2-way merge between two raster images by HSV values */ //#include Qt stuff int main( int argc, char** argv ) { int hW, sW, vW; QString one, two, merge; // FIXME: fill these from command line if ( hW ) { hW = hW % 360; if ( hW == 0 ) hW = 360; } // FIXME: load images One and Two int h1, h2, s1, s2, v1, v2; int r1, r2; // "score" derived from HSV values and weights for( int x = 0 ; ; ) // FIXME { for( int y = 0 ; ; ) // FIXME { // FIXME: get hsv values from both images at this spot r1 = r2 = 0; if ( hW ) { // Start by getting a distance between 0 and 180. r1 = abs( hW - h1 ); r2 = abs( hW - h2 ); if ( r1 > 180 ) r1 = 360 - r1; if ( r2 > 180 ) r2 = 360 - r2; // Subtract from 180 so low distance means high result. r1 = 180 - r1; r2 = 180 - r2; } if ( sW ) { r1 += s1 * sW; r2 += s2 * sW; } if ( vW ) { r1 += v1 * vW; r2 += v2 * vW; } if ( r1 > r2 ) { // FIXME: put pixel One into merge } else { // FIXME: put pixel Two into merge } } } // FIXME: write merge to file }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 7653 | Sam Stafford |
A couple of image compositing utilities outlined on the flight home (inspired by some difficulties I had with multiple exposure photography whilst on vacation). |