Beispiel #1
0
void apply_wind (wind_dialog_struct *wds) {
	gint t1;
	hf_wrapper_struct *hfw;
	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) wds->parent_data;
	if (!hfw->hf_struct->tmp_buf)
		hf_backup(hfw->hf_struct);
	t1 = clock();
	set_watch_cursor(hfw);
	switch (wds->process) {
		case RIPPLES:
			hf_ripples (hfw->hf_struct, hfw->hf_options->img->ripples, hfw->hf_options->dist_matrix, hfw->hf_options->gauss_list);
			begin_pending_record(hfw,"Ripples",accept_fn,reset_fn);
			gtk_widget_set_sensitive(GTK_WIDGET(wds->accept) ,TRUE);
			break;
		case DUNES:
		default:
			hf_dunes (hfw->hf_struct, hfw->hf_options->img->dunes, hfw->hf_options->dist_matrix, hfw->hf_options->gauss_list);
			begin_pending_record(hfw,"Dunes",accept_fn,reset_fn);
			gtk_widget_set_sensitive(GTK_WIDGET(wds->accept) ,TRUE);
	}

// printf("TEMPS D'ÉROSION PAR LE VENT: %d\n",clock() - t1);
	(*hfw->if_modified) = TRUE;
	hfw->if_calculated = TRUE;
	unset_watch_cursor(hfw);
}
Beispiel #2
0
void apply_voronoi (hf_wrapper_struct *hfw) {

//	gint t1;
	if (!hfw->hf_struct->tmp_buf)
		hf_backup(hfw->hf_struct);
	if (!hfw->hf_struct->result_buf)
		hfw->hf_struct->result_buf = 
			(hf_type *) x_malloc(sizeof(hf_type) * hfw->hf_struct->max_x  * hfw->hf_struct->max_y, "hf_type (result_buf in apply_voronoi)");
	if (!hfw->hf_struct->tmp2_buf)
		hfw->hf_struct->tmp2_buf = 
			(hf_type *) x_malloc(sizeof(hf_type) * hfw->hf_struct->max_x  * hfw->hf_struct->max_y, "hf_type (tmp2_buf in apply_voronoi)");
//	t1 = clock();
	// Convention:
	// 1. tmp_buf: original HF
	// 2. tmp2_buf: distance HF
	// 3. result_buf: crackled HF (base level + black lines == cracks)
	// 4. hf_buf: output = crackled HF + distance HF (for lifting edges)

	set_watch_cursor(hfw);	
	hf_voronoi(hfw->hf_struct, hfw->hf_options->img->voronoi);
	
	voronoi_adjust_edges (hfw->hf_struct->result_buf, hfw->hf_struct->hf_buf, hfw->hf_struct->tmp2_buf, hfw->hf_options->img->voronoi->edges_level,  hfw->hf_struct->max_x, hfw->hf_struct->max_y);
	
	unset_watch_cursor(hfw);
// printf("TEMPS DE CRAQU�LEMENT: %d\n",clock() - t1);
}