int main(int ac, char** av) { if (strcmp(av[1], "index") == 0) { do_index("../pic/india/trekearth.new/trekearth"); } else if (strcmp(av[1], "tile") == 0) { struct mozaic_info mi; struct index_info ii; mi.tile_im = NULL; index_load(&ii, "../pic/india/trekearth.new/trekearth"); /* index_load(&ii, "../pic/kiosked"); */ /* do_tile("../pic/roland_15/main.jpg", &ii, &mi); */ do_tile("../pic/roland_14/main_gimped.jpg", &ii, &mi); /* do_tile("../pic/face_1/main.jpg", &ii, &mi); */ do_make(&ii, &mi); do_edit(&ii, &mi); cvSaveImage("/tmp/tile.jpg", mi.tile_im, NULL); do_save_mozaic(&mi, "/tmp/mozaic.til"); cvReleaseImage(&mi.tile_im); cvReleaseImage(&mi.ycc_im); free(mi.tile_arr); index_free(&ii); } return 0; }
/*}}}*/ static void inner(int level_to_do, int level, struct node *cursor, int I, int J, struct range *rangez, struct tower_table *table, FILE *out) {/*{{{*/ int i, j; for (i=0; i<2; i++) { for (j=0; j<2; j++) { if (cursor->c[i][j]) { inner(level_to_do, level+1, cursor->c[i][j], (I<<1)+i, (J<<1)+j, rangez, table, out); } } } if (level == level_to_do) { if (!rangez || ((I >= rangez->x0) && (I <= rangez->x1) && (J >= rangez->y0) && (J <= rangez->y1))) { do_tile(I, J, cursor, table, out); } } }