mistelix r9 - in trunk: extensions/Effects/Brightness extensions/Effects/Contrast extensions/Effects/RotateImage extensions/SlideTransitions/Fade extensions/SlideTransitions/OpaqueLines src src/core src/datamodel src/dialogs
- From: jmas svn gnome org
- To: svn-commits-list gnome org
- Subject: mistelix r9 - in trunk: extensions/Effects/Brightness extensions/Effects/Contrast extensions/Effects/RotateImage extensions/SlideTransitions/Fade extensions/SlideTransitions/OpaqueLines src src/core src/datamodel src/dialogs
- Date: Mon, 30 Mar 2009 18:50:54 +0000 (UTC)
Author: jmas
Date: Mon Mar 30 18:50:54 2009
New Revision: 9
URL: http://svn.gnome.org/viewvc/mistelix?rev=9&view=rev
Log:
Use properties for SlideImage
Modified:
trunk/extensions/Effects/Brightness/Brightness.cs
trunk/extensions/Effects/Contrast/Contrast.cs
trunk/extensions/Effects/RotateImage/RotateImage.cs
trunk/extensions/SlideTransitions/Fade/Fade.cs
trunk/extensions/SlideTransitions/OpaqueLines/OpaqueLines.cs
trunk/src/core/Logger.cs
trunk/src/core/MistelixLib.cs
trunk/src/core/NoneTransition.cs
trunk/src/core/SlideImage.cs
trunk/src/datamodel/SlideShowProjectElement.cs
trunk/src/dialogs/AddSlideDialog.cs
trunk/src/mistelix.cs
Modified: trunk/extensions/Effects/Brightness/Brightness.cs
==============================================================================
--- trunk/extensions/Effects/Brightness/Brightness.cs (original)
+++ trunk/extensions/Effects/Brightness/Brightness.cs Mon Mar 30 18:50:54 2009
@@ -58,9 +58,9 @@
image = new SlideImage ();
image.CopyProperties (org);
- image.Pixels = new byte [org.stride * org.height];
+ image.Pixels = new byte [org.Stride * org.Height];
- for (int i = 0; i < org.stride * org.height; i++)
+ for (int i = 0; i < org.Stride * org.Height; i++)
image.Pixels[i] = (byte) ((double) org.Pixels[i] * _value);
return image;
Modified: trunk/extensions/Effects/Contrast/Contrast.cs
==============================================================================
--- trunk/extensions/Effects/Contrast/Contrast.cs (original)
+++ trunk/extensions/Effects/Contrast/Contrast.cs Mon Mar 30 18:50:54 2009
@@ -58,9 +58,9 @@
image = new SlideImage ();
image.CopyProperties (org);
- image.Pixels = new byte [org.stride * org.height];
+ image.Pixels = new byte [org.Stride * org.Height];
- for (int i = 0; i < org.stride * org.height; i++)
+ for (int i = 0; i < org.Stride * org.Height; i++)
image.Pixels[i] = ContrastPixel (org.Pixels[i]);
return image;
Modified: trunk/extensions/Effects/RotateImage/RotateImage.cs
==============================================================================
--- trunk/extensions/Effects/RotateImage/RotateImage.cs (original)
+++ trunk/extensions/Effects/RotateImage/RotateImage.cs Mon Mar 30 18:50:54 2009
@@ -49,9 +49,9 @@
image = new SlideImage ();
image.CopyProperties (org);
- image.Pixels = new byte [org.stride * org.height];
+ image.Pixels = new byte [org.Stride * org.Height];
- for (int i = 0; i < org.stride * org.height; i++)
+ for (int i = 0; i < org.Stride * org.Height; i++)
image.Pixels[i] = org.Pixels[i];
return image;
Modified: trunk/extensions/SlideTransitions/Fade/Fade.cs
==============================================================================
--- trunk/extensions/SlideTransitions/Fade/Fade.cs (original)
+++ trunk/extensions/SlideTransitions/Fade/Fade.cs Mon Mar 30 18:50:54 2009
@@ -50,16 +50,16 @@
{
images[f] = new SlideImage ();
images[f].CopyProperties (org);
- images[f].Pixels = new byte [org.stride * org.height];
+ images[f].Pixels = new byte [org.Stride * org.Height];
- for (int h = 0; h < org.height; h++)
+ for (int h = 0; h < org.Height; h++)
{
- pos = h * org.stride;
- for (int w = 0; w < org.width; w++)
+ pos = h * org.Stride;
+ for (int w = 0; w < org.Width; w++)
{
- for (int c = 0; c < org.channels; c++)
+ for (int c = 0; c < org.Channels; c++)
images[f].Pixels[pos + c] = (byte) (org.Pixels[pos + c] * percentage);
- pos += org.channels;
+ pos += org.Channels;
}
}
org = images[f];
@@ -67,9 +67,9 @@
images[frames - 1] = new SlideImage ();
images[frames - 1].CopyProperties (org);
- images[frames - 1].Pixels = new byte [org.stride * org.height];
+ images[frames - 1].Pixels = new byte [org.Stride * org.Height];
- for (int i = 0; i < org.stride * org.height; i++)
+ for (int i = 0; i < org.Stride * org.Height; i++)
images[frames - 1].Pixels[i] = trg.Pixels[i];
return images;
Modified: trunk/extensions/SlideTransitions/OpaqueLines/OpaqueLines.cs
==============================================================================
--- trunk/extensions/SlideTransitions/OpaqueLines/OpaqueLines.cs (original)
+++ trunk/extensions/SlideTransitions/OpaqueLines/OpaqueLines.cs Mon Mar 30 18:50:54 2009
@@ -52,31 +52,31 @@
{
images[f] = new SlideImage ();
images[f].CopyProperties (org);
- images[f].Pixels = new byte [org.stride * org.height];
+ images[f].Pixels = new byte [org.Stride * org.Height];
// Black
int h;
- for (h = 0; h < org.height * (double) ((double)f / (double)frames); h++)
+ for (h = 0; h < org.Height * (double) ((double)f / (double)frames); h++)
{
- pos = h * org.stride;
- for (int w = 0; w < org.width; w++)
+ pos = h * org.Stride;
+ for (int w = 0; w < org.Width; w++)
{
- for (int c = 0; c < org.channels; c++)
+ for (int c = 0; c < org.Channels; c++)
images[f].Pixels[pos + c] = 0;
- pos += org.channels;
+ pos += org.Channels;
}
}
// Rest of the image not get blacked
- for (; h < org.height; h++)
+ for (; h < org.Height; h++)
{
- pos = h * org.stride;
- for (int w = 0; w < org.width; w++)
+ pos = h * org.Stride;
+ for (int w = 0; w < org.Width; w++)
{
- for (int c = 0; c < org.channels; c++)
+ for (int c = 0; c < org.Channels; c++)
images[f].Pixels[pos + c] = (byte) (org.Pixels[pos + c]);
- pos += org.channels;
+ pos += org.Channels;
}
}
org = images[f];
@@ -84,9 +84,9 @@
images[frames - 1] = new SlideImage ();
images[frames - 1].CopyProperties (org);
- images[frames - 1].Pixels = new byte [org.stride * org.height];
+ images[frames - 1].Pixels = new byte [org.Stride * org.Height];
- for (int i = 0; i < org.stride * org.height; i++)
+ for (int i = 0; i < org.Stride * org.Height; i++)
images[frames - 1].Pixels[i] = trg.Pixels[i];
return images;
Modified: trunk/src/core/Logger.cs
==============================================================================
--- trunk/src/core/Logger.cs (original)
+++ trunk/src/core/Logger.cs Mon Mar 30 18:50:54 2009
@@ -104,9 +104,9 @@
// loggers are pluggable.
public static class Logger
{
- private static Level log_level = Level.DEBUG;
+ private static Level log_level = Level.INFO;
- static ILogger log_dev = new FileLogger ();
+ static ILogger log_dev = new ConsoleLogger ();
static bool muted = false;
Modified: trunk/src/core/MistelixLib.cs
==============================================================================
--- trunk/src/core/MistelixLib.cs (original)
+++ trunk/src/core/MistelixLib.cs Mon Mar 30 18:50:54 2009
@@ -127,11 +127,11 @@
{
IntPtr pixels = IntPtr.Zero;
int rslt = -1;
-
+
try
{
- if (image.channels != 3)
- throw new InvalidOperationException (String.Format ("mistelixvideosrc expects images in 24 bits (3 channels) not {0}", image.channels));
+ if (image.Channels != 3)
+ throw new InvalidOperationException (String.Format ("mistelixvideosrc expects images in 24 bits (3 channels) not {0}", image.Channels));
pixels = Marshal.AllocHGlobal (image.Pixels.Length);
Marshal.Copy (image.Pixels, 0, pixels, image.Pixels.Length);
@@ -153,8 +153,8 @@
try
{
- if (image.channels != 3)
- throw new InvalidOperationException (String.Format ("mistelixvideosrc expects images in 24 bits (3 channels) not {0}", image.channels));
+ if (image.Channels != 3)
+ throw new InvalidOperationException (String.Format ("mistelixvideosrc expects images in 24 bits (3 channels) not {0}", image.Channels));
pixels = Marshal.AllocHGlobal (image.Pixels.Length);
Marshal.Copy (image.Pixels, 0, pixels, image.Pixels.Length);
Modified: trunk/src/core/NoneTransition.cs
==============================================================================
--- trunk/src/core/NoneTransition.cs (original)
+++ trunk/src/core/NoneTransition.cs Mon Mar 30 18:50:54 2009
@@ -49,14 +49,14 @@
{
images[f] = new SlideImage ();
images[f].CopyProperties (org);
- images[f].Pixels = new byte [org.stride * org.height];
- Array.Copy (org.Pixels, images[f].Pixels, org.stride * org.height);
+ images[f].Pixels = new byte [org.Stride * org.Height];
+ Array.Copy (org.Pixels, images[f].Pixels, org.Stride * org.Height);
}
images[frames - 1] = new SlideImage ();
images[frames - 1].CopyProperties (org);
- images[frames - 1].Pixels = new byte [org.stride * org.height];
- Array.Copy (trg.Pixels, images[frames - 1].Pixels, trg.stride * trg.height);
+ images[frames - 1].Pixels = new byte [org.Stride * org.Height];
+ Array.Copy (trg.Pixels, images[frames - 1].Pixels, trg.Stride * trg.Height);
return images;
}
Modified: trunk/src/core/SlideImage.cs
==============================================================================
--- trunk/src/core/SlideImage.cs (original)
+++ trunk/src/core/SlideImage.cs Mon Mar 30 18:50:54 2009
@@ -42,12 +42,32 @@
//
public class SlideImage : SlideShowProjectElement.Image
{
- [XmlIgnoreAttribute] public int width, height, stride, channels = 3, requested_channels = 3;
- [XmlIgnoreAttribute] public bool alpha = false;
+ [XmlIgnoreAttribute] int width, height, stride, channels = 3, requested_channels = 3;
+ [XmlIgnoreAttribute] bool alpha = false;
[XmlIgnoreAttribute] byte[] pixels = null;
[XmlIgnoreAttribute] Project project;
[XmlIgnoreAttribute] int offset_x, offset_y, w, h;
+ [XmlIgnoreAttribute]
+ public int Width {
+ get { return width; }
+ }
+
+ [XmlIgnoreAttribute]
+ public int Height {
+ get { return height; }
+ }
+
+ [XmlIgnoreAttribute]
+ public int Stride {
+ get { return stride; }
+ }
+
+ [XmlIgnoreAttribute]
+ public int Channels {
+ get { return channels; }
+ }
+
public SlideImage ()
{
TransitionTime = 2; // Transition from slide to slide (effect duration). Hardcoded default
@@ -58,7 +78,7 @@
public SlideImage (string image) : this ()
{
- if (name == null)
+ if (image == null)
throw new ArgumentNullException ("image name cannot be null");
this.image = image;
@@ -132,7 +152,6 @@
pixels = null;
}
-
public DataImageSurface GetThumbnail (int width, int height)
{
SlideImage slide = new SlideImage ();
@@ -226,9 +245,9 @@
void LoadAndScaleImage (int width, int height)
{
if (image == null)
- throw new InvalidOperationException (String.Format ("SlideImage.CreateImage: no filename defined for image"));
+ throw new InvalidOperationException (String.Format ("SlideImage.LoadAndScaleImage: no filename defined for image"));
- Logger.Debug ("SlideImage.CreateImage {0}", image, width, height);
+ Logger.Debug ("SlideImage.LoadAndScaleImage {0} {1} {2}", image, width, height);
int max_w = width; // max target width
int max_h = height; // max target height
Modified: trunk/src/datamodel/SlideShowProjectElement.cs
==============================================================================
--- trunk/src/datamodel/SlideShowProjectElement.cs (original)
+++ trunk/src/datamodel/SlideShowProjectElement.cs Mon Mar 30 18:50:54 2009
@@ -101,8 +101,7 @@
}
// Used by serialization set / get effects
- //public List <Effect.Storage> EffectList {
- public Effect.Storage [] EffectList {
+ public Effect.Storage [] EffectList {
get {
if (effects == null)
return null;
Modified: trunk/src/dialogs/AddSlideDialog.cs
==============================================================================
--- trunk/src/dialogs/AddSlideDialog.cs (original)
+++ trunk/src/dialogs/AddSlideDialog.cs Mon Mar 30 18:50:54 2009
@@ -440,7 +440,7 @@
img = images_transition[idx];
pixels = img.Pixels;
// TODO: To change to the right signature when the new Mono.Cairo is wide spread. Fixed in Mono.Cairo r120299
- ImageSurface img_sur = new ImageSurface (ref pixels, Cairo.Format.Argb32, img.width, img.height, img.stride);
+ ImageSurface img_sur = new ImageSurface (ref pixels, Cairo.Format.Argb32, img.Width, img.Height, img.Stride);
Cairo.Context cc = Gdk.CairoHelper.Create (args.Window);
cc.Save ();
Modified: trunk/src/mistelix.cs
==============================================================================
--- trunk/src/mistelix.cs (original)
+++ trunk/src/mistelix.cs Mon Mar 30 18:50:54 2009
@@ -62,7 +62,6 @@
[Glade.Widget] Gtk.MenuItem add_slideshow;
[Glade.Widget] Gtk.MenuItem add_videos;
-
AuthoringPaneView authoring_view;
Project project;
ProjectElementView element_view;
@@ -102,10 +101,8 @@
if (String.Compare (Environment.GetEnvironmentVariable ("MISTELIX_DEBUG"), "true", false) == 0) {
debugging = true;
- } else {
- // Only INFO and ERROR when no debugging
- Logger.LogLevel = Level.INFO;
- Logger.LogDevice = new ConsoleLogger ();
+ Logger.LogLevel = Level.DEBUG;
+ Logger.LogDevice = new FileLogger ();
}
OnProjectView ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]