summaryrefslogtreecommitdiff
path: root/src/eom-transform.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/eom-transform.h')
-rw-r--r--src/eom-transform.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/eom-transform.h b/src/eom-transform.h
new file mode 100644
index 0000000..a321e03
--- /dev/null
+++ b/src/eom-transform.h
@@ -0,0 +1,75 @@
+#ifndef _EOM_TRANSFORM_H_
+#define _EOM_TRANSFORM_H_
+
+#include <glib-object.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+G_BEGIN_DECLS
+
+#ifndef __EOM_JOB_DECLR__
+#define __EOM_JOB_DECLR__
+typedef struct _EomJob EomJob;
+#endif
+
+typedef enum {
+ EOM_TRANSFORM_NONE,
+ EOM_TRANSFORM_ROT_90,
+ EOM_TRANSFORM_ROT_180,
+ EOM_TRANSFORM_ROT_270,
+ EOM_TRANSFORM_FLIP_HORIZONTAL,
+ EOM_TRANSFORM_FLIP_VERTICAL,
+ EOM_TRANSFORM_TRANSPOSE,
+ EOM_TRANSFORM_TRANSVERSE
+} EomTransformType;
+
+#define EOM_TYPE_TRANSFORM (eom_transform_get_type ())
+#define EOM_TRANSFORM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EOM_TYPE_TRANSFORM, EomTransform))
+#define EOM_TRANSFORM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EOM_TYPE_TRANSFORM, EomTransformClass))
+#define EOM_IS_TRANSFORM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOM_TYPE_TRANSFORM))
+#define EOM_IS_TRANSFORM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EOM_TYPE_TRANSFORM))
+#define EOM_TRANSFORM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EOM_TYPE_TRANSFORM, EomTransformClass))
+
+/* =========================================
+
+ GObjecat wrapper around an affine transformation
+
+ ----------------------------------------*/
+
+typedef struct _EomTransform EomTransform;
+typedef struct _EomTransformClass EomTransformClass;
+typedef struct _EomTransformPrivate EomTransformPrivate;
+
+struct _EomTransform {
+ GObject parent;
+
+ EomTransformPrivate *priv;
+};
+
+struct _EomTransformClass {
+ GObjectClass parent_klass;
+};
+
+GType eom_transform_get_type (void) G_GNUC_CONST;
+
+GdkPixbuf* eom_transform_apply (EomTransform *trans, GdkPixbuf *pixbuf, EomJob *job);
+EomTransform* eom_transform_reverse (EomTransform *trans);
+EomTransform* eom_transform_compose (EomTransform *trans, EomTransform *compose);
+gboolean eom_transform_is_identity (EomTransform *trans);
+
+EomTransform* eom_transform_identity_new (void);
+EomTransform* eom_transform_rotate_new (int degree);
+EomTransform* eom_transform_flip_new (EomTransformType type /* only EOM_TRANSFORM_FLIP_* are valid */);
+#if 0
+EomTransform* eom_transform_scale_new (double sx, double sy);
+#endif
+EomTransform* eom_transform_new (EomTransformType trans);
+
+EomTransformType eom_transform_get_transform_type (EomTransform *trans);
+
+gboolean eom_transform_get_affine (EomTransform *trans, cairo_matrix_t *affine);
+
+G_END_DECLS
+
+#endif /* _EOM_TRANSFORM_H_ */
+
+