git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2902 92316355-f0b4-4df1-b90c-862c8a59935fremotes/tiles
@@ -3,6 +3,6 @@ | |||||
SUBDIRS = pipi src genethumb examples test pipi-sharp ThePimp | SUBDIRS = pipi src genethumb examples test pipi-sharp ThePimp | ||||
DIST_SUBDIRS = $(SUBDIRS) win32 | DIST_SUBDIRS = $(SUBDIRS) win32 | ||||
EXTRA_DIST = bootstrap build-win32 common.h NOTES | |||||
EXTRA_DIST = bootstrap build-win32 NOTES | |||||
AUTOMAKE_OPTIONS = dist-bzip2 | AUTOMAKE_OPTIONS = dist-bzip2 | ||||
@@ -67,6 +67,21 @@ fi | |||||
AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no") | AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no") | ||||
AC_SUBST(GETOPT_LIBS) | AC_SUBST(GETOPT_LIBS) | ||||
# How to get the C99 types. See pipi/pipi_types.h.in for details about | |||||
# the PIPI_TYPES variable | |||||
if test "${ac_cv_my_have_vga}" = "yes"; then | |||||
PIPI_TYPES=0 | |||||
else | |||||
AC_CHECK_HEADERS(stdint.h, | |||||
[PIPI_TYPES=1], | |||||
[AC_CHECK_HEADERS(inttypes.h, | |||||
[PIPI_TYPES=2], | |||||
[AC_CHECK_HEADERS(windows.h, | |||||
[PIPI_TYPES=3], | |||||
[PIPI_TYPES=0])])]) | |||||
fi | |||||
AC_SUBST(PIPI_TYPES) | |||||
# Optimizations | # Optimizations | ||||
CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" | CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" | ||||
# Code qui fait des warnings == code de porc == deux baffes dans ta gueule | # Code qui fait des warnings == code de porc == deux baffes dans ta gueule | ||||
@@ -174,6 +189,7 @@ AC_CONFIG_FILES([ | |||||
win32/Makefile | win32/Makefile | ||||
]) | ]) | ||||
AC_CONFIG_FILES([ | AC_CONFIG_FILES([ | ||||
pipi/pipi_types.h | |||||
pipi/pipi.pc | pipi/pipi.pc | ||||
pipi-sharp/pipi-sharp.pc | pipi-sharp/pipi-sharp.pc | ||||
pipi-sharp/pipi-sharp.dll.config | pipi-sharp/pipi-sharp.dll.config | ||||
@@ -1,5 +1,4 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -23,7 +23,6 @@ | |||||
* are not entirely black and white. */ | * are not entirely black and white. */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -1,5 +1,4 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -1,5 +1,4 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -1,5 +1,4 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -1,5 +1,4 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -1,5 +1,4 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -1,5 +1,4 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#if !defined HAVE_GETOPT_LONG | #if !defined HAVE_GETOPT_LONG | ||||
# include "mygetopt.h" | # include "mygetopt.h" | ||||
@@ -1,6 +1,6 @@ | |||||
# $Id$ | # $Id$ | ||||
EXTRA_DIST = pipi.pc.in | |||||
EXTRA_DIST = pipi_types.h.in pipi.pc.in | |||||
DISTCLEANFILES = pipi.pc | DISTCLEANFILES = pipi.pc | ||||
AM_CPPFLAGS = -I$(top_srcdir) | AM_CPPFLAGS = -I$(top_srcdir) | ||||
@@ -8,14 +8,16 @@ AM_CPPFLAGS = -I$(top_srcdir) | |||||
pkgconfig_DATA = pipi.pc | pkgconfig_DATA = pipi.pc | ||||
pkgconfigdir = $(libdir)/pkgconfig | pkgconfigdir = $(libdir)/pkgconfig | ||||
include_HEADERS = pipi.h | |||||
include_HEADERS = pipi.h pipi_types.h | |||||
# The main library | # The main library | ||||
lib_LTLIBRARIES = libpipi.la | lib_LTLIBRARIES = libpipi.la | ||||
libpipi_la_SOURCES = \ | libpipi_la_SOURCES = \ | ||||
pipi.c \ | pipi.c \ | ||||
pipi.h \ | pipi.h \ | ||||
pipi_types.h \ | |||||
pipi_internals.h \ | pipi_internals.h \ | ||||
pipi_stubs.h \ | |||||
pipi_template.h \ | pipi_template.h \ | ||||
context.c \ | context.c \ | ||||
pixels.c \ | pixels.c \ | ||||
@@ -18,7 +18,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -20,8 +20,6 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#ifdef USE_COCOA | #ifdef USE_COCOA | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -31,4 +29,4 @@ | |||||
#include "pipi.h" | #include "pipi.h" | ||||
#include "pipi_internals.h" | #include "pipi_internals.h" | ||||
#endif | |||||
#endif |
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -1,25 +1,3 @@ | |||||
/* | |||||
* libpipi Pathetic image processing interface library | |||||
* Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org> | |||||
* 2008 Jean-Yves Lamoureux <jylam@lnxscene.org | |||||
* All Rights Reserved | |||||
* | |||||
* $Id$ | |||||
* | |||||
* This library is free software. It comes without any warranty, to | |||||
* the extent permitted by applicable law. You can redistribute it | |||||
* and/or modify it under the terms of the Do What The Fuck You Want | |||||
* To Public License, Version 2, as published by Sam Hocevar. See | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | |||||
*/ | |||||
/* | |||||
* color.c: color parsing functions | |||||
*/ | |||||
#include "config.h" | |||||
#include "common.h" | |||||
/* | /* | ||||
* libpipi Pathetic image processing interface library | * libpipi Pathetic image processing interface library | ||||
* Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org> | * Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org> | ||||
@@ -40,12 +18,10 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include <stdint.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include "pipi.h" | #include "pipi.h" | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include "pipi.h" | #include "pipi.h" | ||||
#include "pipi_internals.h" | #include "pipi_internals.h" | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include "pipi.h" | #include "pipi.h" | ||||
#include "pipi_internals.h" | #include "pipi_internals.h" | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include "pipi.h" | #include "pipi.h" | ||||
#include "pipi_internals.h" | #include "pipi_internals.h" | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include "pipi.h" | #include "pipi.h" | ||||
#include "pipi_internals.h" | #include "pipi_internals.h" | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <math.h> | #include <math.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <string.h> | #include <string.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include "pipi.h" | #include "pipi.h" | ||||
#include "pipi_internals.h" | #include "pipi_internals.h" | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <math.h> | #include <math.h> | ||||
@@ -25,7 +25,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include "pipi.h" | #include "pipi.h" | ||||
#include "pipi_internals.h" | #include "pipi_internals.h" | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include "pipi.h" | #include "pipi.h" | ||||
#include "pipi_internals.h" | #include "pipi_internals.h" | ||||
@@ -19,7 +19,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
@@ -18,7 +18,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <math.h> | #include <math.h> | ||||
@@ -18,7 +18,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -18,7 +18,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
@@ -18,7 +18,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,9 +17,8 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <strings.h> | |||||
#include <string.h> | |||||
#include "pipi.h" | #include "pipi.h" | ||||
#include "pipi_internals.h" | #include "pipi_internals.h" | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -20,9 +20,15 @@ | |||||
#ifndef __PIPI_H__ | #ifndef __PIPI_H__ | ||||
#define __PIPI_H__ | #define __PIPI_H__ | ||||
#include <stdio.h> | |||||
#include <string.h> | |||||
#include <stdint.h> | |||||
#include <pipi_types.h> | |||||
#undef __extern | |||||
#if defined(_DOXYGEN_SKIP_ME) | |||||
#elif defined(_WIN32) && defined(__LIBPIPI__) | |||||
# define __extern extern __declspec(dllexport) | |||||
#else | |||||
# define __extern extern | |||||
#endif | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" | extern "C" | ||||
@@ -112,103 +118,102 @@ typedef struct | |||||
} | } | ||||
pipi_command_t; | pipi_command_t; | ||||
extern pipi_pixel_t *pipi_get_color_from_string(const char* s); | |||||
__extern pipi_pixel_t *pipi_get_color_from_string(const char* s); | |||||
char const * pipi_get_version(void); | char const * pipi_get_version(void); | ||||
extern pipi_context_t *pipi_create_context(void); | |||||
extern void pipi_destroy_context(pipi_context_t *); | |||||
extern pipi_command_t const *pipi_get_command_list(void); | |||||
extern int pipi_command(pipi_context_t *, char const *, ...); | |||||
extern pipi_image_t *pipi_load(char const *); | |||||
extern pipi_image_t *pipi_load_stock(char const *); | |||||
extern pipi_image_t *pipi_new(int, int); | |||||
extern pipi_image_t *pipi_copy(pipi_image_t *); | |||||
extern void pipi_free(pipi_image_t *); | |||||
extern int pipi_save(pipi_image_t *, const char *); | |||||
extern void pipi_set_gamma(double); | |||||
extern pipi_pixels_t *pipi_getpixels(pipi_image_t *, pipi_format_t); | |||||
extern int pipi_get_image_width(pipi_image_t *img); | |||||
extern int pipi_get_image_height(pipi_image_t *img); | |||||
extern int pipi_get_image_pitch(pipi_image_t *img); | |||||
extern int pipi_get_image_last_modified(pipi_image_t *img); | |||||
extern const char* pipi_get_format_name(int format); | |||||
extern double pipi_measure_msd(pipi_image_t *, pipi_image_t *); | |||||
extern double pipi_measure_rmsd(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_resize(pipi_image_t *, int, int); | |||||
extern pipi_image_t *pipi_render_random(int, int); | |||||
extern pipi_image_t *pipi_render_bayer(int, int); | |||||
extern pipi_image_t *pipi_render_halftone(int, int); | |||||
extern pipi_image_t *pipi_rgb(pipi_image_t *, pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_red(pipi_image_t *); | |||||
extern pipi_image_t *pipi_green(pipi_image_t *); | |||||
extern pipi_image_t *pipi_blue(pipi_image_t *); | |||||
extern pipi_image_t *pipi_mean(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_min(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_max(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_add(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_sub(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_difference(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_multiply(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_divide(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_screen(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_overlay(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_convolution(pipi_image_t *, int, int, double[]); | |||||
extern pipi_image_t *pipi_gaussian_blur(pipi_image_t *, float); | |||||
extern pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *, | |||||
__extern pipi_context_t *pipi_create_context(void); | |||||
__extern void pipi_destroy_context(pipi_context_t *); | |||||
__extern pipi_command_t const *pipi_get_command_list(void); | |||||
__extern int pipi_command(pipi_context_t *, char const *, ...); | |||||
__extern pipi_image_t *pipi_load(char const *); | |||||
__extern pipi_image_t *pipi_load_stock(char const *); | |||||
__extern pipi_image_t *pipi_new(int, int); | |||||
__extern pipi_image_t *pipi_copy(pipi_image_t *); | |||||
__extern void pipi_free(pipi_image_t *); | |||||
__extern int pipi_save(pipi_image_t *, const char *); | |||||
__extern void pipi_set_gamma(double); | |||||
__extern pipi_pixels_t *pipi_getpixels(pipi_image_t *, pipi_format_t); | |||||
__extern int pipi_get_image_width(pipi_image_t *img); | |||||
__extern int pipi_get_image_height(pipi_image_t *img); | |||||
__extern int pipi_get_image_pitch(pipi_image_t *img); | |||||
__extern int pipi_get_image_last_modified(pipi_image_t *img); | |||||
__extern const char* pipi_get_format_name(int format); | |||||
__extern double pipi_measure_msd(pipi_image_t *, pipi_image_t *); | |||||
__extern double pipi_measure_rmsd(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_resize(pipi_image_t *, int, int); | |||||
__extern pipi_image_t *pipi_render_random(int, int); | |||||
__extern pipi_image_t *pipi_render_bayer(int, int); | |||||
__extern pipi_image_t *pipi_render_halftone(int, int); | |||||
__extern pipi_image_t *pipi_rgb(pipi_image_t *, pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_red(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_green(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_blue(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_mean(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_min(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_max(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_add(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_sub(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_difference(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_multiply(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_divide(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_screen(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_overlay(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_convolution(pipi_image_t *, int, int, double[]); | |||||
__extern pipi_image_t *pipi_gaussian_blur(pipi_image_t *, float); | |||||
__extern pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *, | |||||
float, float, float, float, float); | float, float, float, float, float); | ||||
extern pipi_image_t *pipi_box_blur(pipi_image_t *, int); | |||||
extern pipi_image_t *pipi_box_blur_ext(pipi_image_t *, int, int); | |||||
extern pipi_image_t *pipi_brightness(pipi_image_t *, double); | |||||
extern pipi_image_t *pipi_contrast(pipi_image_t *, double); | |||||
extern pipi_image_t *pipi_autocontrast(pipi_image_t *); | |||||
extern pipi_image_t *pipi_invert(pipi_image_t *); | |||||
extern pipi_image_t *pipi_threshold(pipi_image_t *, double); | |||||
extern pipi_image_t *pipi_hflip(pipi_image_t *); | |||||
extern pipi_image_t *pipi_vflip(pipi_image_t *); | |||||
extern pipi_image_t *pipi_rotate90(pipi_image_t *); | |||||
extern pipi_image_t *pipi_rotate180(pipi_image_t *); | |||||
extern pipi_image_t *pipi_rotate270(pipi_image_t *); | |||||
extern pipi_image_t *pipi_median(pipi_image_t *, int); | |||||
extern pipi_image_t *pipi_median_ext(pipi_image_t *, int, int); | |||||
extern pipi_image_t *pipi_dilate(pipi_image_t *); | |||||
extern pipi_image_t *pipi_erode(pipi_image_t *); | |||||
extern pipi_image_t *pipi_order(pipi_image_t *); | |||||
extern pipi_image_t *pipi_tile(pipi_image_t *, int, int); | |||||
extern int pipi_flood_fill(pipi_image_t *, | |||||
__extern pipi_image_t *pipi_box_blur(pipi_image_t *, int); | |||||
__extern pipi_image_t *pipi_box_blur_ext(pipi_image_t *, int, int); | |||||
__extern pipi_image_t *pipi_brightness(pipi_image_t *, double); | |||||
__extern pipi_image_t *pipi_contrast(pipi_image_t *, double); | |||||
__extern pipi_image_t *pipi_autocontrast(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_invert(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_threshold(pipi_image_t *, double); | |||||
__extern pipi_image_t *pipi_hflip(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_vflip(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_rotate90(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_rotate180(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_rotate270(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_median(pipi_image_t *, int); | |||||
__extern pipi_image_t *pipi_median_ext(pipi_image_t *, int, int); | |||||
__extern pipi_image_t *pipi_dilate(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_erode(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_order(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_tile(pipi_image_t *, int, int); | |||||
__extern int pipi_flood_fill(pipi_image_t *, | |||||
int, int, float, float, float, float); | int, int, float, float, float, float); | ||||
extern int pipi_draw_line(pipi_image_t *, int, int, int, int, uint32_t, int); | |||||
extern int pipi_draw_polyline(pipi_image_t *, int const[], int const[], | |||||
__extern int pipi_draw_line(pipi_image_t *, int, int, int, int, uint32_t, int); | |||||
__extern int pipi_draw_polyline(pipi_image_t *, int const[], int const[], | |||||
int , uint32_t, int); | int , uint32_t, int); | ||||
extern int pipi_draw_bezier4(pipi_image_t *,int, int, int, int, int, int, int, int, uint32_t, int, int); | |||||
extern pipi_image_t *pipi_reduce(pipi_image_t *, int, double const *); | |||||
__extern int pipi_draw_bezier4(pipi_image_t *,int, int, int, int, int, int, int, int, uint32_t, int, int); | |||||
__extern pipi_image_t *pipi_reduce(pipi_image_t *, int, double const *); | |||||
extern pipi_image_t *pipi_dither_ediff(pipi_image_t *, pipi_image_t *, | |||||
__extern pipi_image_t *pipi_dither_ediff(pipi_image_t *, pipi_image_t *, | |||||
pipi_scan_t); | pipi_scan_t); | ||||
extern pipi_image_t *pipi_dither_ordered(pipi_image_t *, pipi_image_t *); | |||||
extern pipi_image_t *pipi_dither_ordered_ext(pipi_image_t *, pipi_image_t *, | |||||
__extern pipi_image_t *pipi_dither_ordered(pipi_image_t *, pipi_image_t *); | |||||
__extern pipi_image_t *pipi_dither_ordered_ext(pipi_image_t *, pipi_image_t *, | |||||
double, double); | double, double); | ||||
extern pipi_image_t *pipi_dither_halftone(pipi_image_t *, double, double); | |||||
extern pipi_image_t *pipi_dither_random(pipi_image_t *); | |||||
extern pipi_image_t *pipi_dither_ostromoukhov(pipi_image_t *, pipi_scan_t); | |||||
extern pipi_image_t *pipi_dither_dbs(pipi_image_t *); | |||||
extern void pipi_dither_24to16(pipi_image_t *); | |||||
extern pipi_histogram_t* pipi_new_histogram(void); | |||||
extern int pipi_get_image_histogram(pipi_image_t *, pipi_histogram_t *, int); | |||||
extern int pipi_free_histogram(pipi_histogram_t*); | |||||
extern int pipi_render_histogram(pipi_image_t *, pipi_histogram_t*, int); | |||||
__extern pipi_image_t *pipi_dither_halftone(pipi_image_t *, double, double); | |||||
__extern pipi_image_t *pipi_dither_random(pipi_image_t *); | |||||
__extern pipi_image_t *pipi_dither_ostromoukhov(pipi_image_t *, pipi_scan_t); | |||||
__extern pipi_image_t *pipi_dither_dbs(pipi_image_t *); | |||||
__extern void pipi_dither_24to16(pipi_image_t *); | |||||
__extern pipi_histogram_t* pipi_new_histogram(void); | |||||
__extern int pipi_get_image_histogram(pipi_image_t *, pipi_histogram_t *, int); | |||||
__extern int pipi_free_histogram(pipi_histogram_t*); | |||||
__extern int pipi_render_histogram(pipi_image_t *, pipi_histogram_t*, int); | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} | } | ||||
@@ -19,6 +19,8 @@ | |||||
#ifndef __PIPI_INTERNALS_H__ | #ifndef __PIPI_INTERNALS_H__ | ||||
#define __PIPI_INTERNALS_H__ | #define __PIPI_INTERNALS_H__ | ||||
#include "pipi_stubs.h" | |||||
#define SET_FLAG_GRAY 0x00000001 | #define SET_FLAG_GRAY 0x00000001 | ||||
#define SET_FLAG_WRAP 0x00000002 | #define SET_FLAG_WRAP 0x00000002 | ||||
#define SET_FLAG_8BIT 0x00000004 | #define SET_FLAG_8BIT 0x00000004 | ||||
@@ -1,14 +1,13 @@ | |||||
/* | /* | ||||
* libpipi Pathetic image processing interface library | * libpipi Pathetic image processing interface library | ||||
* Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org> | |||||
* Copyright (c) 2006 Sam Hocevar <sam@zoy.org> | |||||
* All Rights Reserved | * All Rights Reserved | ||||
* | * | ||||
* $Id$ | * $Id$ | ||||
* | * | ||||
* This library is free software. It comes without any warranty, to | |||||
* the extent permitted by applicable law. You can redistribute it | |||||
* and/or modify it under the terms of the Do What The Fuck You Want | |||||
* To Public License, Version 2, as published by Sam Hocevar. See | |||||
* This library is free software; you can redistribute it and/or | |||||
* modify it under the terms of the Do What The Fuck You Want To | |||||
* Public License, Version 2, as published by Sam Hocevar. See | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
@@ -17,30 +16,41 @@ | |||||
* function prototypes that are sometimes missing. | * function prototypes that are sometimes missing. | ||||
*/ | */ | ||||
#ifndef __COMMON_H__ | |||||
#define __COMMON_H__ | |||||
#ifndef __PIPI_STUBS_H__ | |||||
#define __PIPI_STUBS_H__ | |||||
/* C99 types */ | |||||
#if defined HAVE_INTTYPES_H && !defined __KERNEL__ | |||||
# include <inttypes.h> | |||||
/* errno handling */ | |||||
#if defined HAVE_ERRNO_H && !defined __KERNEL__ | |||||
# include <errno.h> | |||||
static inline void seterrno(int e) { errno = e; } | |||||
static inline int geterrno(void) { return errno; } | |||||
#else | #else | ||||
typedef signed char int8_t; | |||||
typedef signed short int16_t; | |||||
typedef signed long int int32_t; | |||||
typedef unsigned char uint8_t; | |||||
typedef unsigned short uint16_t; | |||||
typedef unsigned long int uint32_t; | |||||
# define seterrno(x) do { (void)(x); } while(0) | |||||
# define geterrno(x) 0 | |||||
#endif | |||||
typedef long int intptr_t; | |||||
typedef unsigned long int uintptr_t; | |||||
/* debug messages */ | |||||
#if defined DEBUG && !defined __KERNEL__ | |||||
# include <stdio.h> | |||||
# include <stdarg.h> | |||||
static inline void debug(const char *format, ...) | |||||
{ | |||||
int saved_errno = geterrno(); | |||||
va_list args; | |||||
va_start(args, format); | |||||
fprintf(stderr, "** libpipi debug ** "); | |||||
vfprintf(stderr, format, args); | |||||
fprintf(stderr, "\n"); | |||||
va_end(args); | |||||
seterrno(saved_errno); | |||||
} | |||||
#else | |||||
# define debug(format, ...) do {} while(0) | |||||
#endif | #endif | ||||
/* hton16() and hton32() */ | /* hton16() and hton32() */ | ||||
#if defined HAVE_HTONS | |||||
# if defined __KERNEL__ | |||||
/* Nothing to do */ | |||||
# elif defined HAVE_ARPA_INET_H | |||||
#if defined HAVE_HTONS && !defined __KERNEL__ | |||||
# if defined HAVE_ARPA_INET_H | |||||
# include <arpa/inet.h> | # include <arpa/inet.h> | ||||
# elif defined HAVE_NETINET_IN_H | # elif defined HAVE_NETINET_IN_H | ||||
# include <netinet/in.h> | # include <netinet/in.h> | ||||
@@ -48,7 +58,9 @@ typedef unsigned long int uintptr_t; | |||||
# define hton16 htons | # define hton16 htons | ||||
# define hton32 htonl | # define hton32 htonl | ||||
#else | #else | ||||
# if defined HAVE_ENDIAN_H | |||||
# if defined __KERNEL__ | |||||
/* Nothing to do */ | |||||
# elif defined HAVE_ENDIAN_H | |||||
# include <endian.h> | # include <endian.h> | ||||
# endif | # endif | ||||
static inline uint16_t hton16(uint16_t x) | static inline uint16_t hton16(uint16_t x) | ||||
@@ -81,5 +93,5 @@ static inline uint32_t hton32(uint32_t x) | |||||
} | } | ||||
#endif | #endif | ||||
#endif /* __COMMON_H__ */ | |||||
#endif /* __PIPI_STUBS_H__ */ | |||||
@@ -0,0 +1,100 @@ | |||||
/* | |||||
* libpipi Pathetic image processing interface library | |||||
* Copyright (c) 2008 Sam Hocevar <sam@zoy.org> | |||||
* All Rights Reserved | |||||
* | |||||
* $Id$ | |||||
* | |||||
* This library is free software; you can redistribute it and/or | |||||
* modify it under the terms of the Do What The Fuck You Want To | |||||
* Public License, Version 2, as published by Sam Hocevar. See | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | |||||
*/ | |||||
/* | |||||
* This file contains definitions for the C99 integer types. | |||||
*/ | |||||
#ifndef __PIPI_TYPES_H__ | |||||
#define __PIPI_TYPES_H__ | |||||
#ifndef PIPI_TYPES | |||||
# define PIPI_TYPES @PIPI_TYPES@ | |||||
#endif | |||||
/* mode 1: standard <stdint.h> header is present, just include it */ | |||||
#if PIPI_TYPES == 1 | |||||
# include <stdint.h> | |||||
# include <unistd.h> | |||||
/* mode 2: standard <inttypes.h> header is present, just include it */ | |||||
#elif PIPI_TYPES == 2 | |||||
# include <inttypes.h> | |||||
# include <unistd.h> | |||||
/* mode 3: <windows.h> indicates Win32, only (u)intptr_t is present | |||||
* FIXME: Win64 probably doesn't work that way */ | |||||
#elif PIPI_TYPES == 3 | |||||
#include <windows.h> | |||||
typedef signed char int8_t; | |||||
typedef signed short int16_t; | |||||
typedef signed long int int32_t; | |||||
typedef signed long long int int64_t; | |||||
typedef unsigned char uint8_t; | |||||
typedef unsigned short uint16_t; | |||||
typedef unsigned long int uint32_t; | |||||
typedef unsigned long long int uint64_t; | |||||
typedef int ssize_t; | |||||
typedef unsigned int size_t; | |||||
/* fallback: nothing is known, we assume the platform is 32-bit and | |||||
* sizeof(long) == sizeof(void *). We don't typedef directly because we | |||||
* have no idea what other typedefs have already been made. */ | |||||
#else | |||||
typedef signed char _pipi_int8_t; | |||||
typedef signed short _pipi_int16_t; | |||||
typedef signed long int _pipi_int32_t; | |||||
typedef signed long long int _pipi_int64_t; | |||||
# undef int8_t | |||||
# define int8_t _pipi_int8_t | |||||
# undef int16_t | |||||
# define int16_t _pipi_int16_t | |||||
# undef int32_t | |||||
# define int32_t _pipi_int32_t | |||||
# undef int64_t | |||||
# define int64_t _pipi_int64_t | |||||
typedef unsigned char _pipi_uint8_t; | |||||
typedef unsigned short _pipi_uint16_t; | |||||
typedef unsigned long int _pipi_uint32_t; | |||||
typedef unsigned long long int _pipi_uint64_t; | |||||
# undef uint8_t | |||||
# define uint8_t _pipi_uint8_t | |||||
# undef uint16_t | |||||
# define uint16_t _pipi_uint16_t | |||||
# undef uint32_t | |||||
# define uint32_t _pipi_uint32_t | |||||
# undef uint64_t | |||||
# define uint64_t _pipi_uint64_t | |||||
typedef long int _pipi_intptr_t; | |||||
typedef unsigned long int _pipi_uintptr_t; | |||||
# undef intptr_t | |||||
# define intptr_t _pipi_intptr_t | |||||
# undef uintptr_t | |||||
# define uintptr_t _pipi_uintptr_t | |||||
typedef int _pipi_ssize_t; | |||||
typedef unsigned int _pipi_size_t; | |||||
# undef ssize_t | |||||
# define ssize_t _pipi_ssize_t | |||||
# undef size_t | |||||
# define size_t _pipi_size_t | |||||
#endif | |||||
#endif /* __PIPI_TYPES_H__ */ | |||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -1,5 +1,4 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -18,7 +18,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -1,4 +1,4 @@ | |||||
# $Id$ | # $Id$ | ||||
EXTRA_DIST = config.h | |||||
EXTRA_DIST = config.h pipi_types.h | |||||
@@ -0,0 +1,2 @@ | |||||
#define PIPI_TYPES 3 | |||||
#include "../pipi/pipi_types.h.in" |