Ejemplo n.º 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);
}
Ejemplo n.º 2
0
void mirror_vertical_callb(GtkWidget *wdg, gpointer data) {

	hf_wrapper_struct *hfw;
	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
	if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wdg))) {
		hf_commit_or_reset (hfw->hf_options);
		return;
	}
	if (!hfw->hf_options->img->mirror_vertical_dialog) {
		hfw->hf_options->img->mirror_vertical_dialog = mirror_vertical_dialog_new(data);
		gtk_container_add(GTK_CONTAINER(hfw->hf_options->img->img_dialog),
			hfw->hf_options->img->mirror_vertical_dialog );
	}
	if (hfw->hf_options->img->current_subdialog)
		gtk_widget_hide(hfw->hf_options->img->current_subdialog);
	hfw->hf_options->img->current_subdialog = hfw->hf_options->img->mirror_vertical_dialog;
	gtk_widget_show(hfw->hf_options->img->current_subdialog);
	hf_backup(hfw->hf_struct);	// We need to copy the result in the tmp_buf if we want to allow
					// the user to revert the operation by clicking repeatedly on the mirror button
	hf_vertical_mirror(hfw->hf_struct);
	begin_pending_record(hfw,"Vertical mirror",accept_fn,reset_fn);
	(*hfw->if_modified) = TRUE;
	hfw->if_calculated = TRUE;
	draw_hf(hfw);
}
Ejemplo n.º 3
0
void apply_rotate (hf_wrapper_struct *hfw) {
//	Apply anti-aliased rotation, without redrawing the HF
	gint t1;
	gboolean tiling;
	if (hfw->tiling_ptr) {
		tiling = *hfw->tiling_ptr;
//		printf("HFW->tiling_ptr in apply_rotate: %p->%p\n",hfw,hfw->tiling_ptr);
	}
	else
		tiling = TRUE;
	if (!hfw->hf_struct->tmp_buf)
		hf_backup(hfw->hf_struct);
	if (hfw->if_calculated)
		return;
	t1 = clock();
	hf_rotate(hfw->hf_struct->tmp_buf, hfw->hf_struct->hf_buf,
		hfw->hf_struct->max_x,
		hfw->hf_options->img->angle, 
		tiling,
		tiling ?
		hfw->hf_options->img->rotate_overflow_tiling : 
		hfw->hf_options->img->rotate_overflow_notiling);
//	printf("TEMPS DE ROTATION: %d; angle: %d\n",clock() - t1, hfw->hf_options->img->angle);
	begin_pending_record(hfw,"Rotate",accept_rotate_fn,reset_fn);
	gtk_widget_set_sensitive(GTK_WIDGET(hfw->hf_options->img->rotate_accept),TRUE);
	(*hfw->if_modified) = TRUE;
	hfw->if_calculated = TRUE;
}
Ejemplo n.º 4
0
void fourier_post_processing (hf_wrapper_struct *hfw) {
	begin_pending_record (hfw, _("Fourier transform"), accept_fn, reset_fn);
	commit_pending_record (hfw);
	hf_backup(hfw->hf_struct);
	hf_wrapper_display(hfw);
	*(hfw->if_modified) = TRUE;
	hfw->if_calculated = TRUE;
// printf("Fourier Post Processing\n");
}
Ejemplo n.º 5
0
void calc_slider (hf_wrapper_struct *hfw) {
	if (hfw->if_calculated)
		return;
	hf_slide(hfw->hf_struct,
		hfw->hf_options->img->slideh,
		hfw->hf_options->img->slidev);
	begin_pending_record(hfw,"Translate",accept_fn,reset_fn);
	gtk_widget_set_sensitive(GTK_WIDGET(hfw->hf_options->img->slide_accept),TRUE);
	(*hfw->if_modified) = TRUE;
	hfw->if_calculated = TRUE;
	draw_hf(hfw);
}
Ejemplo n.º 6
0
void apply_voronoi_callb (GtkWidget *wdg, gpointer data) {
	hf_wrapper_struct *hfw;
	hfw = (hf_wrapper_struct *) * (hf_wrapper_struct **) data;
	if (hfw->if_calculated)
		return;
	apply_voronoi(hfw);
	(*hfw->if_modified) = TRUE;
	hfw->if_calculated = TRUE;
	begin_pending_record(hfw,"Cracks network",accept_fn,reset_fn);
	gtk_widget_set_sensitive(GTK_WIDGET(hfw->hf_options->img->voronoi_dialog->accept),TRUE);
	draw_hf(hfw);
	hfw->if_calculated =  FALSE;
}
Ejemplo n.º 7
0
void calc_stretch(hf_wrapper_struct *hfw) {
	begin_pending_record(hfw,"Stretch",accept_fn,reset_fn);
	gtk_widget_set_sensitive(GTK_WIDGET(hfw->hf_options->img->stretch_accept),TRUE);
	(*hfw->if_modified) = TRUE;
	draw_hf(hfw);
}