[Jahshaka-cvs] jah/jahtools/jbatch jbatch_ui.py,1.6,1.7
Status: Beta
Brought to you by:
jahshaka
From: Charles Y. <lil...@us...> - 2007-05-02 05:56:40
|
Update of /cvsroot/jahshaka/jah/jahtools/jbatch In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7766 Modified Files: jbatch_ui.py Log Message: + Just for the hell of it - employs the crop filter too (best used with composite... edge cases badly handled) Index: jbatch_ui.py =================================================================== RCS file: /cvsroot/jahshaka/jah/jahtools/jbatch/jbatch_ui.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- jbatch_ui.py 1 May 2007 22:28:34 -0000 1.6 +++ jbatch_ui.py 2 May 2007 05:56:37 -0000 1.7 @@ -69,6 +69,26 @@ Tkinter.Checkbutton( frame, text = "Deinterlace", variable = self.v_deinterlace, command = self.filter_changed ).grid( row = rc, column = 0, sticky = Tkinter.W ) rc += 1 + self.v_crop = Tkinter.IntVar( ) + Tkinter.Checkbutton( frame, text = "Crop", variable = self.v_crop, command = self.filter_changed ).grid( row = rc, column = 0, sticky = Tkinter.W ) + self.v_crop_x = Tkinter.DoubleVar( ) + self.v_crop_y = Tkinter.DoubleVar( ) + self.v_crop_w = Tkinter.DoubleVar( ) + self.v_crop_h = Tkinter.DoubleVar( ) + self.v_crop_x.set( 0.0 ) + self.v_crop_y.set( 0.0 ) + self.v_crop_w.set( 1.0 ) + self.v_crop_h.set( 1.0 ) + Tkinter.Label( frame, text = "X" ).grid( row = rc, column = 1, sticky = Tkinter.W ) + Tkinter.Scale( frame, orient = Tkinter.HORIZONTAL, variable = self.v_crop_x, showvalue = False, command = self.filter_changed, from_ = 0.0, to = 1.0, resolution=0.01 ).grid( row = rc, column = 2, sticky = Tkinter.W ) + Tkinter.Label( frame, text = "Y" ).grid( row = rc + 1, column = 1, sticky = Tkinter.W ) + Tkinter.Scale( frame, orient = Tkinter.HORIZONTAL, variable = self.v_crop_y, showvalue = False, command = self.filter_changed, from_ = 0.0, to = 1.0, resolution=0.01 ).grid( row = rc + 1, column = 2, sticky = Tkinter.W ) + Tkinter.Label( frame, text = "W" ).grid( row = rc + 2, column = 1, sticky = Tkinter.W ) + Tkinter.Scale( frame, orient = Tkinter.HORIZONTAL, variable = self.v_crop_w, showvalue = False, command = self.filter_changed, from_ = 0.0, to = 1.0, resolution=0.01 ).grid( row = rc + 2, column = 2, sticky = Tkinter.W ) + Tkinter.Label( frame, text = "H" ).grid( row = rc + 3, column = 1, sticky = Tkinter.W ) + Tkinter.Scale( frame, orient = Tkinter.HORIZONTAL, variable = self.v_crop_h, showvalue = False, command = self.filter_changed, from_ = 0.0, to = 1.0, resolution=0.01 ).grid( row = rc + 3, column = 2, sticky = Tkinter.W ) + rc += 4 + self.v_correct = Tkinter.IntVar( ) Tkinter.Checkbutton( frame, text = "Correction", variable = self.v_correct, command = self.filter_changed ).grid( row = rc, column = 0, sticky = Tkinter.W ) self.v_correct_b = Tkinter.DoubleVar( ) @@ -171,7 +191,12 @@ def filters( self, apply = True ): result = [ ] - result += [ [ "@@deinterlace=0" ], [ "@@deinterlace=1", "@@u=%d" ] ][ self.v_deinterlace.get( ) ] + result += [ [ "@@deinterlace=0" ], [ "@@deinterlace=1" ] ][ self.v_deinterlace.get( ) ] + cw = self.v_crop_w.get( ) + if self.v_crop_w.get( ) - self.v_crop_x.get( ) <= 0.0: cw = 0.01 + ch = self.v_crop_h.get( ) + if self.v_crop_h.get( ) - self.v_crop_y.get( ) <= 0.0: ch = 0.01 + result += [ [ "@@crop=", "@@cx=", "@@cy=", "@@cw=", "@@ch=" ], [ "@@crop=1", "@@cx=%f" % self.v_crop_x.get( ), "@@cy=%f" % self.v_crop_y.get( ), "@@cw=%f" % cw, "@@ch=%f" % ch ] ][ self.v_crop.get( ) ] result += [ [ "@@chroma=", "@@u=", "@@v=" ], [ "@@chroma=1", "@@u=%d" % self.v_chroma_u.get( ), "@@v=%d" % self.v_chroma_v.get( ) ] ][ self.v_greyscale.get( ) ] result += [ [ "@@correction=", "@@brightness=", "@@contrast=", "@@hue=", "@@saturation=" ], [ "@@correction=1", "@@brightness=%f" % self.v_correct_b.get( ), "@@contrast=%f" % self.v_correct_c.get( ), "@@hue=%f" % self.v_correct_h.get( ), "@@saturation=%f" % self.v_correct_s.get( ) ] ][ self.v_correct.get( ) ] result += [ [ "@@composite=", "@@rx=", "@@ry=", "@@rw=", "@@rh=", "@@mix=" ], [ "@@composite=1", "@@rx=%f" % self.v_composite_x.get( ), "@@ry=%f" % self.v_composite_y.get( ), "@@rw=%f" % self.v_composite_w.get( ), "@@rh=%f" % self.v_composite_h.get( ), "@@mix=%f" % self.v_composite_m.get( ) ] ][ self.v_composite.get( ) ] |