This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit 2ba6ec494fb6c017cc87e97ca31326949d719e25
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Sat Jul 23 10:06:14 2022 +0200

    api: Move filter functions to separate file
---
 src/lib/Makefile.am  |   1 +
 src/lib/api.c        | 125 -----------------------------------------------
 src/lib/api_filter.c | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 134 insertions(+), 125 deletions(-)

diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index ffd6671..bcd8869 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -15,6 +15,7 @@ libImlib2_la_LIBADD  =
 
 libImlib2_la_SOURCES = \
 api.c 		api.h		\
+api_filter.c	\
 api_obsolete.c	\
 asm.h \
 asm_c.c		asm_c.h		\
diff --git a/src/lib/api.c b/src/lib/api.c
index 7eed2a2..6a27b00 100644
--- a/src/lib/api.c
+++ b/src/lib/api.c
@@ -13,9 +13,7 @@
 #include "blend.h"
 #include "colormod.h"
 #include "color_helpers.h"
-#include "dynamic_filters.h"
 #include "file.h"
-#include "filter.h"
 #include "font.h"
 #include "grad.h"
 #include "image.h"
@@ -2565,129 +2563,6 @@ imlib_blend_image_onto_image_skewed(Imlib_Image source_image,
                                    ctx->cliprect.w, ctx->cliprect.h);
 }
 
-EAPI void
-imlib_image_filter(void)
-{
-   ImlibImage         *im;
-
-   CHECK_PARAM_POINTER("image", ctx->image);
-   CHECK_PARAM_POINTER("filter", ctx->filter);
-   CAST_IMAGE(im, ctx->image);
-   if (__imlib_LoadImageData(im))
-      return;
-   __imlib_DirtyImage(im);
-   __imlib_FilterImage(im, (ImlibFilter *) ctx->filter);
-}
-
-EAPI                Imlib_Filter
-imlib_create_filter(int initsize)
-{
-   return __imlib_CreateFilter(initsize);
-}
-
-EAPI void
-imlib_free_filter(void)
-{
-   CHECK_PARAM_POINTER("filter", ctx->filter);
-   __imlib_FreeFilter((ImlibFilter *) ctx->filter);
-   ctx->filter = NULL;
-}
-
-EAPI void
-imlib_context_set_filter(Imlib_Filter filter)
-{
-   ctx->filter = filter;
-}
-
-EAPI                Imlib_Filter
-imlib_context_get_filter(void)
-{
-   return ctx->filter;
-}
-
-EAPI void
-imlib_filter_set(int xoff, int yoff, int a, int r, int g, int b)
-{
-   ImlibFilter        *fil;
-
-   CHECK_PARAM_POINTER("filter", ctx->filter);
-   fil = (ImlibFilter *) ctx->filter;
-   __imlib_FilterSetColor(&fil->alpha, xoff, yoff, a, 0, 0, 0);
-   __imlib_FilterSetColor(&fil->red, xoff, yoff, 0, r, 0, 0);
-   __imlib_FilterSetColor(&fil->green, xoff, yoff, 0, 0, g, 0);
-   __imlib_FilterSetColor(&fil->blue, xoff, yoff, 0, 0, 0, b);
-}
-
-EAPI void
-imlib_filter_set_alpha(int xoff, int yoff, int a, int r, int g, int b)
-{
-   ImlibFilter        *fil;
-
-   CHECK_PARAM_POINTER("filter", ctx->filter);
-   fil = (ImlibFilter *) ctx->filter;
-   __imlib_FilterSetColor(&fil->alpha, xoff, yoff, a, r, g, b);
-}
-
-EAPI void
-imlib_filter_set_red(int xoff, int yoff, int a, int r, int g, int b)
-{
-   ImlibFilter        *fil;
-
-   CHECK_PARAM_POINTER("filter", ctx->filter);
-   fil = (ImlibFilter *) ctx->filter;
-   __imlib_FilterSetColor(&fil->red, xoff, yoff, a, r, g, b);
-}
-
-EAPI void
-imlib_filter_set_green(int xoff, int yoff, int a, int r, int g, int b)
-{
-   ImlibFilter        *fil;
-
-   CHECK_PARAM_POINTER("filter", ctx->filter);
-   fil = (ImlibFilter *) ctx->filter;
-   __imlib_FilterSetColor(&fil->green, xoff, yoff, a, r, g, b);
-}
-
-EAPI void
-imlib_filter_set_blue(int xoff, int yoff, int a, int r, int g, int b)
-{
-   ImlibFilter        *fil;
-
-   CHECK_PARAM_POINTER("filter", ctx->filter);
-   fil = (ImlibFilter *) ctx->filter;
-   __imlib_FilterSetColor(&fil->blue, xoff, yoff, a, r, g, b);
-}
-
-EAPI void
-imlib_filter_constants(int a, int r, int g, int b)
-{
-   CHECK_PARAM_POINTER("filter", ctx->filter);
-   __imlib_FilterConstants((ImlibFilter *) ctx->filter, a, r, g, b);
-}
-
-EAPI void
-imlib_filter_divisors(int a, int r, int g, int b)
-{
-   CHECK_PARAM_POINTER("filter", ctx->filter);
-   __imlib_FilterDivisors((ImlibFilter *) ctx->filter, a, r, g, b);
-}
-
-EAPI void
-imlib_apply_filter(const char *script, ...)
-{
-   va_list             param_list;
-   ImlibImage         *im;
-
-   __imlib_dynamic_filters_init();
-   CAST_IMAGE(im, ctx->image);
-   if (__imlib_LoadImageData(im))
-      return;
-   __imlib_DirtyImage(im);
-   va_start(param_list, script);
-   __imlib_script_parse(im, script, param_list);
-   va_end(param_list);
-}
-
 EAPI                ImlibPolygon
 imlib_polygon_new(void)
 {
diff --git a/src/lib/api_filter.c b/src/lib/api_filter.c
new file mode 100644
index 0000000..9d81d6d
--- /dev/null
+++ b/src/lib/api_filter.c
@@ -0,0 +1,133 @@
+#include "config.h"
+#include <Imlib2.h>
+#include "common.h"
+
+#include <stdio.h>
+
+#include "api.h"
+#include "image.h"
+#include "dynamic_filters.h"
+#include "filter.h"
+
+EAPI void
+imlib_image_filter(void)
+{
+   ImlibImage         *im;
+
+   CHECK_PARAM_POINTER("image", ctx->image);
+   CHECK_PARAM_POINTER("filter", ctx->filter);
+   CAST_IMAGE(im, ctx->image);
+   if (__imlib_LoadImageData(im))
+      return;
+   __imlib_DirtyImage(im);
+   __imlib_FilterImage(im, (ImlibFilter *) ctx->filter);
+}
+
+EAPI                Imlib_Filter
+imlib_create_filter(int initsize)
+{
+   return __imlib_CreateFilter(initsize);
+}
+
+EAPI void
+imlib_free_filter(void)
+{
+   CHECK_PARAM_POINTER("filter", ctx->filter);
+   __imlib_FreeFilter((ImlibFilter *) ctx->filter);
+   ctx->filter = NULL;
+}
+
+EAPI void
+imlib_context_set_filter(Imlib_Filter filter)
+{
+   ctx->filter = filter;
+}
+
+EAPI                Imlib_Filter
+imlib_context_get_filter(void)
+{
+   return ctx->filter;
+}
+
+EAPI void
+imlib_filter_set(int xoff, int yoff, int a, int r, int g, int b)
+{
+   ImlibFilter        *fil;
+
+   CHECK_PARAM_POINTER("filter", ctx->filter);
+   fil = (ImlibFilter *) ctx->filter;
+   __imlib_FilterSetColor(&fil->alpha, xoff, yoff, a, 0, 0, 0);
+   __imlib_FilterSetColor(&fil->red, xoff, yoff, 0, r, 0, 0);
+   __imlib_FilterSetColor(&fil->green, xoff, yoff, 0, 0, g, 0);
+   __imlib_FilterSetColor(&fil->blue, xoff, yoff, 0, 0, 0, b);
+}
+
+EAPI void
+imlib_filter_set_alpha(int xoff, int yoff, int a, int r, int g, int b)
+{
+   ImlibFilter        *fil;
+
+   CHECK_PARAM_POINTER("filter", ctx->filter);
+   fil = (ImlibFilter *) ctx->filter;
+   __imlib_FilterSetColor(&fil->alpha, xoff, yoff, a, r, g, b);
+}
+
+EAPI void
+imlib_filter_set_red(int xoff, int yoff, int a, int r, int g, int b)
+{
+   ImlibFilter        *fil;
+
+   CHECK_PARAM_POINTER("filter", ctx->filter);
+   fil = (ImlibFilter *) ctx->filter;
+   __imlib_FilterSetColor(&fil->red, xoff, yoff, a, r, g, b);
+}
+
+EAPI void
+imlib_filter_set_green(int xoff, int yoff, int a, int r, int g, int b)
+{
+   ImlibFilter        *fil;
+
+   CHECK_PARAM_POINTER("filter", ctx->filter);
+   fil = (ImlibFilter *) ctx->filter;
+   __imlib_FilterSetColor(&fil->green, xoff, yoff, a, r, g, b);
+}
+
+EAPI void
+imlib_filter_set_blue(int xoff, int yoff, int a, int r, int g, int b)
+{
+   ImlibFilter        *fil;
+
+   CHECK_PARAM_POINTER("filter", ctx->filter);
+   fil = (ImlibFilter *) ctx->filter;
+   __imlib_FilterSetColor(&fil->blue, xoff, yoff, a, r, g, b);
+}
+
+EAPI void
+imlib_filter_constants(int a, int r, int g, int b)
+{
+   CHECK_PARAM_POINTER("filter", ctx->filter);
+   __imlib_FilterConstants((ImlibFilter *) ctx->filter, a, r, g, b);
+}
+
+EAPI void
+imlib_filter_divisors(int a, int r, int g, int b)
+{
+   CHECK_PARAM_POINTER("filter", ctx->filter);
+   __imlib_FilterDivisors((ImlibFilter *) ctx->filter, a, r, g, b);
+}
+
+EAPI void
+imlib_apply_filter(const char *script, ...)
+{
+   va_list             param_list;
+   ImlibImage         *im;
+
+   __imlib_dynamic_filters_init();
+   CAST_IMAGE(im, ctx->image);
+   if (__imlib_LoadImageData(im))
+      return;
+   __imlib_DirtyImage(im);
+   va_start(param_list, script);
+   __imlib_script_parse(im, script, param_list);
+   va_end(param_list);
+}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to