[gegl] lens-correct: Move stuff in lens-correct.h into lens-correct.c
- From: Mukund Sivaraman <muks src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] lens-correct: Move stuff in lens-correct.h into lens-correct.c
- Date: Tue, 30 Aug 2011 14:26:00 +0000 (UTC)
commit 26a18b34bcbc9530c719e8d3e48eafb06fe8c640
Author: Mukund Sivaraman <muks banu com>
Date: Tue Aug 30 19:54:10 2011 +0530
lens-correct: Move stuff in lens-correct.h into lens-correct.c
There's no reason this has to be in an external header.
operations/workshop/Makefile.am | 2 --
operations/workshop/lens-correct.c | 26 ++++++++++++++++++++++++--
operations/workshop/lens-correct.h | 26 --------------------------
3 files changed, 24 insertions(+), 30 deletions(-)
---
diff --git a/operations/workshop/Makefile.am b/operations/workshop/Makefile.am
index fb204a0..42e548a 100644
--- a/operations/workshop/Makefile.am
+++ b/operations/workshop/Makefile.am
@@ -1,8 +1,6 @@
SUBDIRS = generated external
include $(top_srcdir)/operations/Makefile-operations.am
-AM_CPPFLAGS += -I$(top_srcdir)/operations/workshop
-
# Add to Makefile.am when you move lens-correct out of the workshop, or
# figure out how the current system works.
diff --git a/operations/workshop/lens-correct.c b/operations/workshop/lens-correct.c
index e77a9e4..dfb9333 100644
--- a/operations/workshop/lens-correct.c
+++ b/operations/workshop/lens-correct.c
@@ -88,10 +88,32 @@ gegl_chant_double (alpha_d, _("Model alpha d:"), 0.0, 2.0, 1.0,
#include "gegl-chant.h"
#include <math.h>
-#include "lens-correct.h"
-
#include <stdio.h>
+/* Struct containing the correction parameters a,b,c,d for a lens color
+ * channel. These parameters as the same as used in the Panotools
+ * system. For a detailed explanation, please consult
+ * http://wiki.panotools.org/Lens_correction_model
+ *
+ * Normally a, b, and c are close to zero, and d is close to one. Note
+ * that d is the parameter that's approximately equal to 1 - a - b - c,
+ * NOT one of the image shift parameters as used in some GUIs.
+ */
+typedef struct {
+ gfloat a, b, c, d;
+} ChannelCorrectionModel;
+
+/* Struct containing all the information required for lens correction.
+ * It includes the total size of the image plus the correction
+ * parameters for each color channel.
+ */
+typedef struct {
+ GeglRectangle BB; /* Bounding box of the imaged area. */
+ gfloat cx, cy; /* Coordinates of lens center within the imaged area. */
+ gfloat rscale; /* Scale of the image (1/2 of the shortest side). */
+ ChannelCorrectionModel red, green, blue, alpha; /* Correction parameters for each color channel. */
+} LensCorrectionModel;
+
static void
make_lens (LensCorrectionModel *lens,
GeglChantO *o,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]