diff options
author | Marek Dvoroznak <dvoromar@gmail.com> | 2013-07-31 19:53:00 +0200 |
---|---|---|
committer | Mikael Magnusson <mikachu@src.gnome.org> | 2015-02-27 18:36:37 +0100 |
commit | 10d81c811e97fbe5a05d49f7623933c9b00f7988 (patch) | |
tree | fd635947abaf17484c4ee37f90b7b574a9e44679 /libs | |
parent | e1f0dc4b66383d132eac4bb57b7137a64e082de1 (diff) |
make shared NPD library
Diffstat (limited to 'libs')
-rw-r--r-- | libs/npd/Makefile.am | 57 | ||||
-rw-r--r-- | libs/npd/graphics.h | 4 | ||||
-rw-r--r-- | libs/npd/npd.h | 1 | ||||
-rw-r--r-- | libs/npd/npd_common.c | 6 | ||||
-rw-r--r-- | libs/npd/npd_common.h | 4 |
5 files changed, 50 insertions, 22 deletions
diff --git a/libs/npd/Makefile.am b/libs/npd/Makefile.am index 16ad5434..a5ca9fc2 100644 --- a/libs/npd/Makefile.am +++ b/libs/npd/Makefile.am @@ -1,17 +1,40 @@ -noinst_LTLIBRARIES = libnpd.la - -AM_CFLAGS = $(GLIB_CFLAGS) $(NPD_CFLAGS) -I$(top_builddir)/gegl -I$(top_srcdir)/gegl -AM_LDFLAGS = $(GLIB_LIBS) $(NPD_LIBS) - -libnpd_la_SOURCES = \ - npd_common.h \ - npd_common.c \ - deformation.h \ - deformation.c \ - npd_math.h \ - npd_math.c \ - graphics.h \ - graphics.c \ - npd_gegl.h \ - npd_gegl.c \ - npd.h +include $(top_srcdir)/operations/Makefile-common.am + +###################################################### +# A shared library for n-point image deformation API # +###################################################### + +GEGL_NPD_publicdir = $(includedir)/gegl-$(GEGL_API_VERSION)/npd + +GEGL_NPD_public_HEADERS = \ + npd_common.h \ + deformation.h \ + npd_math.h \ + graphics.h \ + refine.h \ + npd_gegl.h \ + npd.h + +GEGL_NPD_SOURCES = \ + $(GEGL_NPD_public_HEADERS) \ + npd_common.c \ + deformation.c \ + npd_math.c \ + graphics.c \ + refine.c \ + npd_gegl.c + +libgegl_npd_@GEGL_API_VERSION@_la_SOURCES = \ + $(GEGL_NPD_public_HEADERS) \ + $(GEGL_NPD_SOURCES) + +libgegl_npd_@GEGL_API_VERSION@_la_LDFLAGS = \ + -avoid-version -export-dynamic $(no_undefined) + +libgegl_npd_@GEGL_API_VERSION@_la_CFLAGS = \ + $(AM_CFLAGS) + +lib_LTLIBRARIES = libgegl-npd-@GEGL_API_VERSION@.la + +libgegl_npd_@GEGL_API_VERSION@_la_LIBADD = \ + $(libgegl) diff --git a/libs/npd/graphics.h b/libs/npd/graphics.h index d27cd5fe..691ec4f2 100644 --- a/libs/npd/graphics.h +++ b/libs/npd/graphics.h @@ -76,11 +76,11 @@ void npd_bilinear_color_interpolation (NPDColor *I0, gfloat dx, gfloat dy, NPDColor *out); -void npd_get_pixel_color (NPDImage *image, +void (*npd_get_pixel_color) (NPDImage *image, gint x, gint y, NPDColor *color); -void npd_set_pixel_color (NPDImage *image, +void (*npd_set_pixel_color) (NPDImage *image, gint x, gint y, NPDColor *color); diff --git a/libs/npd/npd.h b/libs/npd/npd.h index ae70e591..e01fc4bc 100644 --- a/libs/npd/npd.h +++ b/libs/npd/npd.h @@ -24,6 +24,7 @@ #include "graphics.h" #include "deformation.h" #include "npd_math.h" +/*#include "refine.h"*/ #endif /* __NPD_H__ */ diff --git a/libs/npd/npd_common.c b/libs/npd/npd_common.c index 19914910..0f1ad975 100644 --- a/libs/npd/npd_common.c +++ b/libs/npd/npd_common.c @@ -128,11 +128,11 @@ npd_remove_control_point (NPDModel *model, for (i = 0; i < model->control_points->len; i++) { - cp = &g_array_index(model->control_points, NPDControlPoint, i); + cp = &g_array_index (model->control_points, NPDControlPoint, i); if (cp == control_point) { - npd_set_control_point_weight(cp, 1.0); + npd_set_control_point_weight (cp, 1.0); g_array_remove_index (model->control_points, i); return; } @@ -193,7 +193,7 @@ npd_get_control_point_at (NPDModel *model, } } - g_printf ("no control points\n"); +// g_printf ("no control points\n"); return NULL; } diff --git a/libs/npd/npd_common.h b/libs/npd/npd_common.h index 5ccadad0..4414cc5b 100644 --- a/libs/npd/npd_common.h +++ b/libs/npd/npd_common.h @@ -92,6 +92,10 @@ typedef struct NPDDisplay *display; } NPDModel; +#define npd_init(set_pixel, get_pixel)\ +npd_set_pixel_color = set_pixel;\ +npd_get_pixel_color = get_pixel + void npd_init_model (NPDModel *model); void npd_destroy_hidden_model (NPDHiddenModel *model); void npd_destroy_model (NPDModel *model); |