[f-spot: 40/40] Merge branch refactoredloader



commit 62ded31e65e6a44bd2d9b2deaed031aad001ed06
Merge: d2f8e1e... 8e1e42a...
Author: Stephane Delcroix <stephane delcroix org>
Date:   Wed Jun 24 11:43:43 2009 +0200

    Merge branch refactoredloader
    
    This branch is a massive rewrite of the async loading code, cutting load times by 2.

 libfspot/f-pixbuf-utils.c   |  179 ------------------
 src/AsyncPixbufLoader.cs    |  440 -------------------------------------------
 src/Editors/CropEditor.cs   |    9 +-
 src/Editors/RedEyeEditor.cs |    7 +-
 src/ImageLoader.cs          |  242 ++++++++++++++++++++++++
 src/Imaging/ImageFile.cs    |    2 +-
 src/Imaging/JpegFile.cs     |    4 +-
 src/Imaging/RafFile.cs      |    2 +-
 src/Loupe.cs                |  155 ++-------------
 src/Makefile.am             |    3 +-
 src/PhotoImageView.cs       |  418 ++++++++++++++++++++---------------------
 src/PhotoLoader.cs          |    1 +
 src/PhotoView.cs            |    3 +-
 src/PixbufUtils.cs          |   89 +--------
 src/RotateCommand.cs        |    2 +-
 src/Sharpener.cs            |  147 ++++++++++++++
 src/TagCommands.cs          |    2 +-
 src/Utils/PixbufUtils.cs    |  105 ++++++++++-
 src/Widgets/ImageView.cs    |  137 +++++++++-----
 19 files changed, 834 insertions(+), 1113 deletions(-)
---
diff --cc src/Makefile.am
index c0d3100,3badc62..65c97ee
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@@ -172,7 -170,7 +171,8 @@@ F_SPOT_CSDISTFILES =				
  	$(srcdir)/GroupSelector.cs		\
  	$(srcdir)/Accelerometer.cs		\
  	$(srcdir)/Histogram.cs			\
 +	$(srcdir)/ImageLoaderThread.cs		\
+ 	$(srcdir)/ImageLoader.cs		\
  	$(srcdir)/ImportBackend.cs		\
  	$(srcdir)/ImportCommand.cs		\
  	$(srcdir)/InfoOverlay.cs		\
diff --cc src/PixbufUtils.cs
index 7491f6b,afda49a..b376855
--- a/src/PixbufUtils.cs
+++ b/src/PixbufUtils.cs
@@@ -740,77 -762,72 +740,6 @@@ public class PixbufUtils 
  		return ret;
  	}
  
- 	public static Gdk.Pixbuf TransformOrientation (Gdk.Pixbuf src, PixbufOrientation orientation, bool copy_data)
- 	{
- 		Gdk.Pixbuf pixbuf;
- 		if (src == null)
- 			return null;
- 		
- 		switch (orientation) {
- 		case PixbufOrientation.LeftTop:
- 		case PixbufOrientation.LeftBottom:
- 		case PixbufOrientation.RightTop:
- 		case PixbufOrientation.RightBottom:	
- 			pixbuf = new Gdk.Pixbuf (src.Colorspace, src.HasAlpha, 
- 						 src.BitsPerSample,
- 						 src.Height, src.Width);
- 			break;
- 		case PixbufOrientation.TopRight:
- 		case PixbufOrientation.BottomRight:
- 		case PixbufOrientation.BottomLeft:
- 			pixbuf = new Gdk.Pixbuf (src.Colorspace, src.HasAlpha, 
- 						 src.BitsPerSample,
- 						 src.Width, src.Height);
- 			break;
- 		default:
- 			pixbuf = src;
- 			break;
- 		}
- 
- 		if (copy_data && src != pixbuf) 
- 			TransformAndCopy (src, pixbuf, orientation, new Gdk.Rectangle (0, 0, src.Width, src.Height));
- 
- 		return pixbuf;
- 	}
- 
- 	public static Gdk.Pixbuf TransformOrientation (Gdk.Pixbuf src, PixbufOrientation orientation)
- 	{
- 		return TransformOrientation (src, orientation, true);
- 	}
- 
- 	public static Gdk.Rectangle TransformAndCopy (Gdk.Pixbuf src, Gdk.Pixbuf dest, PixbufOrientation orientation, Gdk.Rectangle args)
- 	{
- 		Gdk.Rectangle area = FSpot.Utils.PixbufUtils.TransformOrientation (src, args, orientation);
- 
- 		int step = 256;
- 
- 		Gdk.Rectangle rect = new Gdk.Rectangle (args.X, args.Y, 
- 							Math.Min (step, args.Width),
- 							Math.Min (step, args.Height));
- 
- 		Gdk.Rectangle trect = FSpot.Utils.PixbufUtils.TransformOrientation (src, rect, orientation);
- 		Gdk.Pixbuf tmp = new Gdk.Pixbuf (src.Colorspace, src.HasAlpha, 
- 						 src.BitsPerSample,
- 						 trect.Width, trect.Height);
- 
- 		Gdk.Rectangle subarea;
- 		BlockProcessor proc = new BlockProcessor (args, 256);
- 		while (proc.Step (out subarea)) {
- 			Gdk.Rectangle trans = FSpot.Utils.PixbufUtils.TransformOrientation (src, subarea, orientation);
- 			Gdk.Pixbuf ssub = new Gdk.Pixbuf (src, subarea.X, subarea.Y,
- 							  subarea.Width, subarea.Height);
- 
- 			Gdk.Pixbuf tsub = new Gdk.Pixbuf (tmp, 0, 0, trans.Width, trans.Height);
- 			CopyWithOrientation (ssub, tsub, orientation);
- 
- 			tsub.CopyArea (0, 0, trans.Width, trans.Height, dest, trans.X, trans.Y);
- 			ssub.Dispose ();
- 			tsub.Dispose ();
- 		}
- 
- 		tmp.Dispose ();
- 		return area;
- 	}
 -//	public static Gdk.Pixbuf TransformOrientation (Gdk.Pixbuf src, PixbufOrientation orientation)
 -//	{
 -//		Gdk.Pixbuf pixbuf;
 -//		if (src == null)
 -//			return null;
 -//		
 -//		switch (orientation) {
 -//		case PixbufOrientation.LeftTop:
 -//		case PixbufOrientation.LeftBottom:
 -//		case PixbufOrientation.RightTop:
 -//		case PixbufOrientation.RightBottom:	
 -//			pixbuf = new Gdk.Pixbuf (src.Colorspace, src.HasAlpha, 
 -//						 src.BitsPerSample,
 -//						 src.Height, src.Width);
 -//			break;
 -//		case PixbufOrientation.TopRight:
 -//		case PixbufOrientation.BottomRight:
 -//		case PixbufOrientation.BottomLeft:
 -//			pixbuf = new Gdk.Pixbuf (src.Colorspace, src.HasAlpha, 
 -//						 src.BitsPerSample,
 -//						 src.Width, src.Height);
 -//			break;
 -//		default:
 -//			pixbuf = src;
 -//			break;
 -//		}
 -//
 -//		if (src != pixbuf) 
 -//			TransformAndCopy (src, pixbuf, orientation, new Gdk.Rectangle (0, 0, src.Width, src.Height));
 -//
 -//		return pixbuf;
 -//	}
 -//
 -//	static Gdk.Rectangle TransformAndCopy (Gdk.Pixbuf src, Gdk.Pixbuf dest, PixbufOrientation orientation, Gdk.Rectangle args)
 -//	{
 -//		Gdk.Rectangle area = FSpot.Utils.PixbufUtils.TransformOrientation (src, args, orientation);
 -//
 -//		int step = 256;
 -//
 -//		Gdk.Rectangle rect = new Gdk.Rectangle (args.X, args.Y, 
 -//							Math.Min (step, args.Width),
 -//							Math.Min (step, args.Height));
 -//
 -//		Gdk.Rectangle trect = FSpot.Utils.PixbufUtils.TransformOrientation (src, rect, orientation);
 -//		Gdk.Pixbuf tmp = new Gdk.Pixbuf (src.Colorspace, src.HasAlpha, 
 -//						 src.BitsPerSample,
 -//						 trect.Width, trect.Height);
 -//
 -//		Gdk.Rectangle subarea;
 -//		BlockProcessor proc = new BlockProcessor (args, 256);
 -//		while (proc.Step (out subarea)) {
 -//			Gdk.Rectangle trans = FSpot.Utils.PixbufUtils.TransformOrientation (src, subarea, orientation);
 -//			Gdk.Pixbuf ssub = new Gdk.Pixbuf (src, subarea.X, subarea.Y,
 -//							  subarea.Width, subarea.Height);
 -//
 -//			Gdk.Pixbuf tsub = new Gdk.Pixbuf (tmp, 0, 0, trans.Width, trans.Height);
 -//			CopyWithOrientation (ssub, tsub, orientation);
 -//
 -//			tsub.CopyArea (0, 0, trans.Width, trans.Height, dest, trans.X, trans.Y);
 -//			ssub.Dispose ();
 -//			tsub.Dispose ();
 -//		}
 -//
 -//		tmp.Dispose ();
 -//		return area;
 -//	}
  	// Bindings from libf.
  
  	[DllImport ("libfspot")]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]