Exemplo n.º 1
0
/* Resets the curve to a straight line from the minimum x & y values to the
 * maximum x & y values (i.e. from the bottom-left to the top-right corners).
 * The curve type is not changed. */
int
clip_GTK_CURVERESET(ClipMachine * cm)
{
	C_widget *ccur = _fetch_cw_arg(cm);
        CHECKCWID(ccur,GTK_CURVE);
        gtk_curve_reset(GTK_CURVE(ccur->widget));
	return 0;
err:
	return 1;
}
Exemplo n.º 2
0
void
on_button_new_clicked                  (GtkButton       *button,
                                        gpointer         user_data)
{
	gtk_curve_reset (lookup_widget(app,"curve"));
	g_free (filename);
	filename = NULL;
	
	gnome_appbar_set_status (lookup_widget(app,"appbar1"),"Curve reset.");
	gtk_window_set_title (app,"Untitled curve");
}
//
//	Video is in YV12 Colorspace
//
//
uint8_t DIA_getEqualizer(EqualizerParam *param, AVDMGenericVideoStream *in)
{
	int ret;
	uint32_t l,f;
	uint32_t max=in->getInfo()->nb_frames;
        
	incoming=in;
	// Allocate space for green-ised video
	w=in->getInfo()->width;
	h=in->getInfo()->height;
	rgbConv=new ColYuvRgb(w,h);
        rgbConv->reset(w,h);
	
	histogram=new uint32_t [256*128];
        histogramout=new uint32_t [256*128];
	
	imgdst=new ADMImage(w,h);
	imgsrc=new ADMImage(w,h);
        imgdisplay=new ADMImage(w,h);
	
        if(curframe<max) max=curframe;
        
	ADM_assert(in->getFrameNumberNoAlloc(max, &l, imgsrc,&f));
        memcpy(imgdisplay->data+w*h,imgsrc->data+w*h,(w*h)>>1);
	// init local equalizer
		
        memcpy(scaler,param->_scaler,sizeof(scaler));

	dialog=create_dialog1();
	gtk_dialog_set_alternative_button_order(GTK_DIALOG(dialog),
										A_RESET,
										GTK_RESPONSE_OK,
										GTK_RESPONSE_CANCEL,
										GTK_RESPONSE_APPLY,
										-1);
	gtk_register_dialog(dialog);
	gtk_widget_set_usize(WID(drawingarea_histin), 256,128);
    gtk_widget_set_usize(WID(drawingarea_histout), 256,128);

	float zoom = UI_calcZoomToFitScreen(GTK_WINDOW(dialog), WID(drawingarea1), w, h);

	zoomW = w * zoom;
	zoomH = h * zoom;
	rgbbuffer=new uint32_t[zoomW*zoomH];

	gtk_widget_set_usize(WID(drawingarea1), zoomW, zoomH);

	if (zoom < 1)
	{
		UI_centreCanvasWindow((GtkWindow*)dialog, WID(drawingarea1), zoomW, zoomH);
		resizer = new ADMImageResizer(w, h, zoomW, zoomH, PIX_FMT_YUV420P, PIX_FMT_RGB32);
	}

	  upload();

	gtk_signal_connect(GTK_OBJECT(WID(drawingarea1)), "expose_event",
		       GTK_SIGNAL_FUNC(draw),
		       NULL);
		       
	
	gtk_signal_connect(GTK_OBJECT(WID(gui_scale)), "value_changed",GTK_SIGNAL_FUNC(frame_changed),   NULL);
  //      gtk_signal_connect(GTK_OBJECT(WID(curve1)), "curve-type-changed",GTK_SIGNAL_FUNC(spinner),   NULL);
	
        /*

        */
        GtkWidget *curve=WID(curve1);
        gtk_curve_set_range (GTK_CURVE(curve),0,255.,0.,255.);
	
        gtk_widget_show(dialog);
        upload();
        compute_histogram();
        spinner();
	ret=0;
	int response;
_again:
	while( (response=gtk_dialog_run(GTK_DIALOG(dialog)))==GTK_RESPONSE_APPLY)
	{
		spinner();	
	}
        if(response==A_RESET)
        {
                gfloat duo[2]={0,255.};
                gtk_curve_set_curve_type(GTK_CURVE(WID(curve1)),GTK_CURVE_TYPE_SPLINE);
                gtk_curve_reset(GTK_CURVE(WID(curve1)));

                goto _again;
        }
        
	if(response==GTK_RESPONSE_OK)
        {
		printf("Accepting new values\n");
		memcpy(param->_scaler,scaler,sizeof(scaler));
		ret=1;
	}
	gtk_unregister_dialog(dialog);
	gtk_widget_destroy(dialog);
	
	delete imgdst;
	delete imgsrc;
        delete imgdisplay;
	delete [] rgbbuffer;
	
	delete [] histogram;
        delete [] histogramout;
    delete rgbConv;

	if (resizer)
	{
		delete resizer;
		resizer=NULL;
	}

    rgbConv=NULL;    
	histogram=NULL;
        histogramout=NULL;
	
	rgbbuffer=NULL;
	imgdst=NULL;
	imgsrc=NULL;
	dialog=NULL;
        imgdisplay=NULL;
	return ret;

}
Exemplo n.º 4
0
void curve_load (gchar *filename)
{
	GtkWidget *curve = lookup_widget(app,"curve");

	gtk_curve_reset (curve);
}
Exemplo n.º 5
0
void	reset_curve( GtkWidget *curve )
{
	gtk_curve_reset(GTK_CURVE(curve));
	gtk_curve_set_range( GTK_CURVE(curve), 0.0, 1.0, 0.0, 1.0 );
}