[gthumb: 97/129] rotate tool: placeholder for future image rotation algorithm
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb: 97/129] rotate tool: placeholder for future image rotation algorithm
- Date: Wed, 27 Apr 2011 20:58:32 +0000 (UTC)
commit 90cca1b0faab4287674d69a1257fc61e4cd3b2c7
Author: Stefano Pettini <spettini users sourceforge net>
Date: Wed Apr 20 13:59:26 2011 +0100
rotate tool: placeholder for future image rotation algorithm
extensions/file_tools/gdk-pixbuf-rotate.c | 21 +++++++++++++++++----
extensions/file_tools/gdk-pixbuf-rotate.h | 4 ++--
2 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/extensions/file_tools/gdk-pixbuf-rotate.c b/extensions/file_tools/gdk-pixbuf-rotate.c
index bd80807..3b85c44 100644
--- a/extensions/file_tools/gdk-pixbuf-rotate.c
+++ b/extensions/file_tools/gdk-pixbuf-rotate.c
@@ -19,13 +19,26 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <gthumb.h>
#include "gdk-pixbuf-rotate.h"
-
-void
-_gdk_pixbuf_rotate (GdkPixbuf *src,
+GdkPixbuf*
+_gdk_pixbuf_rotate (GdkPixbuf *src_pixbuf,
double angle)
{
- // TODO: implemement all
+ GdkPixbuf *new_pixbuf;
+
+ if (angle > 45.0) {
+ new_pixbuf = _gdk_pixbuf_transform (src_pixbuf, GTH_TRANSFORM_ROTATE_90);
+ }
+ else if (angle < -45.0) {
+ new_pixbuf = _gdk_pixbuf_transform (src_pixbuf, GTH_TRANSFORM_ROTATE_270);
+ }
+ else {
+ new_pixbuf = src_pixbuf;
+ g_object_ref (new_pixbuf);
+ }
+
+ return new_pixbuf;
}
diff --git a/extensions/file_tools/gdk-pixbuf-rotate.h b/extensions/file_tools/gdk-pixbuf-rotate.h
index 6ecbedb..e0cc9c6 100644
--- a/extensions/file_tools/gdk-pixbuf-rotate.h
+++ b/extensions/file_tools/gdk-pixbuf-rotate.h
@@ -28,8 +28,8 @@
G_BEGIN_DECLS
-void _gdk_pixbuf_rotate (GdkPixbuf *src,
- double angle);
+GdkPixbuf* _gdk_pixbuf_rotate (GdkPixbuf *src_pixbuf,
+ double angle);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]