浏览代码

Support C99 types on Win32 through the same hacks as in libcaca.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2902 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 年前
父节点
当前提交
0eb36a6225
共有 60 个文件被更改,包括 261 次插入197 次删除
  1. +1
    -1
      Makefile.am
  2. +16
    -0
      configure.ac
  3. +0
    -1
      examples/bezier.c
  4. +0
    -1
      examples/edd.c
  5. +0
    -1
      examples/floodfill.c
  6. +0
    -1
      examples/histogram.c
  7. +0
    -1
      examples/img2rubik.c
  8. +0
    -1
      examples/line.c
  9. +0
    -1
      examples/sharpen.c
  10. +0
    -1
      genethumb/genethumb.c
  11. +4
    -2
      pipi/Makefile.am
  12. +0
    -1
      pipi/accessors.c
  13. +0
    -1
      pipi/codec.c
  14. +1
    -3
      pipi/codec/coreimage.h
  15. +0
    -1
      pipi/codec/gdi.c
  16. +0
    -1
      pipi/codec/imlib.c
  17. +0
    -1
      pipi/codec/opencv.c
  18. +0
    -1
      pipi/codec/oric.c
  19. +0
    -1
      pipi/codec/sdl.c
  20. +0
    -24
      pipi/colorstring.c
  21. +0
    -1
      pipi/combine/mean.c
  22. +0
    -1
      pipi/combine/minmax.c
  23. +0
    -1
      pipi/combine/mulscreen.c
  24. +0
    -1
      pipi/combine/rgb.c
  25. +0
    -1
      pipi/combine/subadd.c
  26. +0
    -1
      pipi/context.c
  27. +0
    -1
      pipi/dither.c
  28. +0
    -1
      pipi/dither/dbs.c
  29. +0
    -1
      pipi/dither/ediff.c
  30. +0
    -1
      pipi/dither/ordered.c
  31. +0
    -1
      pipi/dither/ostromoukhov.c
  32. +0
    -1
      pipi/dither/random.c
  33. +0
    -1
      pipi/filter/autocontrast.c
  34. +0
    -1
      pipi/filter/blur.c
  35. +0
    -1
      pipi/filter/color.c
  36. +0
    -1
      pipi/filter/convolution.c
  37. +0
    -1
      pipi/filter/dilate.c
  38. +0
    -1
      pipi/filter/median.c
  39. +0
    -1
      pipi/filter/transform.c
  40. +0
    -1
      pipi/histogram/histogram.c
  41. +0
    -1
      pipi/measure.c
  42. +0
    -1
      pipi/paint/bezier.c
  43. +0
    -1
      pipi/paint/floodfill.c
  44. +0
    -1
      pipi/paint/line.c
  45. +1
    -2
      pipi/paint/tile.c
  46. +0
    -1
      pipi/pipi.c
  47. +96
    -91
      pipi/pipi.h
  48. +2
    -0
      pipi/pipi_internals.h
  49. +37
    -25
      pipi/pipi_stubs.h
  50. +100
    -0
      pipi/pipi_types.h.in
  51. +0
    -1
      pipi/pixels.c
  52. +0
    -1
      pipi/quantize/reduce.c
  53. +0
    -1
      pipi/render/noise.c
  54. +0
    -1
      pipi/render/screen.c
  55. +0
    -1
      pipi/resize.c
  56. +0
    -1
      pipi/stock.c
  57. +0
    -1
      src/pipi.c
  58. +0
    -1
      test/u8tof32tou8.c
  59. +1
    -1
      win32/Makefile.am
  60. +2
    -0
      win32/pipi_types.h

+ 1
- 1
Makefile.am 查看文件

@@ -3,6 +3,6 @@
SUBDIRS = pipi src genethumb examples test pipi-sharp ThePimp
DIST_SUBDIRS = $(SUBDIRS) win32

EXTRA_DIST = bootstrap build-win32 common.h NOTES
EXTRA_DIST = bootstrap build-win32 NOTES
AUTOMAKE_OPTIONS = dist-bzip2


+ 16
- 0
configure.ac 查看文件

@@ -67,6 +67,21 @@ fi
AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
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
CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
@@ -174,6 +189,7 @@ AC_CONFIG_FILES([
win32/Makefile
])
AC_CONFIG_FILES([
pipi/pipi_types.h
pipi/pipi.pc
pipi-sharp/pipi-sharp.pc
pipi-sharp/pipi-sharp.dll.config


+ 0
- 1
examples/bezier.c 查看文件

@@ -1,5 +1,4 @@
#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
examples/edd.c 查看文件

@@ -23,7 +23,6 @@
* are not entirely black and white. */

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
examples/floodfill.c 查看文件

@@ -1,5 +1,4 @@
#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
examples/histogram.c 查看文件

@@ -1,5 +1,4 @@
#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
examples/img2rubik.c 查看文件

@@ -1,5 +1,4 @@
#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
examples/line.c 查看文件

@@ -1,5 +1,4 @@
#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
examples/sharpen.c 查看文件

@@ -1,5 +1,4 @@
#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
genethumb/genethumb.c 查看文件

@@ -1,5 +1,4 @@
#include "config.h"
#include "common.h"

#if !defined HAVE_GETOPT_LONG
# include "mygetopt.h"


+ 4
- 2
pipi/Makefile.am 查看文件

@@ -1,6 +1,6 @@
# $Id$

EXTRA_DIST = pipi.pc.in
EXTRA_DIST = pipi_types.h.in pipi.pc.in
DISTCLEANFILES = pipi.pc

AM_CPPFLAGS = -I$(top_srcdir)
@@ -8,14 +8,16 @@ AM_CPPFLAGS = -I$(top_srcdir)
pkgconfig_DATA = pipi.pc
pkgconfigdir = $(libdir)/pkgconfig

include_HEADERS = pipi.h
include_HEADERS = pipi.h pipi_types.h

# The main library
lib_LTLIBRARIES = libpipi.la
libpipi_la_SOURCES = \
pipi.c \
pipi.h \
pipi_types.h \
pipi_internals.h \
pipi_stubs.h \
pipi_template.h \
context.c \
pixels.c \


+ 0
- 1
pipi/accessors.c 查看文件

@@ -18,7 +18,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/codec.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 1
- 3
pipi/codec/coreimage.h 查看文件

@@ -20,8 +20,6 @@
#include "config.h"
#ifdef USE_COCOA

#include "common.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -31,4 +29,4 @@
#include "pipi.h"
#include "pipi_internals.h"

#endif
#endif

+ 0
- 1
pipi/codec/gdi.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/codec/imlib.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/codec/opencv.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/codec/oric.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/codec/sdl.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 24
pipi/colorstring.c 查看文件

@@ -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
* Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org>
@@ -40,12 +18,10 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include <string.h>

#include "pipi.h"


+ 0
- 1
pipi/combine/mean.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include "pipi.h"
#include "pipi_internals.h"


+ 0
- 1
pipi/combine/minmax.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include "pipi.h"
#include "pipi_internals.h"


+ 0
- 1
pipi/combine/mulscreen.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include "pipi.h"
#include "pipi_internals.h"


+ 0
- 1
pipi/combine/rgb.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include "pipi.h"
#include "pipi_internals.h"


+ 0
- 1
pipi/combine/subadd.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <math.h>



+ 0
- 1
pipi/context.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/dither.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/dither/dbs.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <string.h>
#include <stdlib.h>


+ 0
- 1
pipi/dither/ediff.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include "pipi.h"
#include "pipi_internals.h"


+ 0
- 1
pipi/dither/ordered.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdlib.h>
#include <math.h>


+ 0
- 1
pipi/dither/ostromoukhov.c 查看文件

@@ -25,7 +25,6 @@
*/

#include "config.h"
#include "common.h"

#include "pipi.h"
#include "pipi_internals.h"


+ 0
- 1
pipi/dither/random.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include "pipi.h"
#include "pipi_internals.h"


+ 0
- 1
pipi/filter/autocontrast.c 查看文件

@@ -19,7 +19,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdlib.h>
#include <stdio.h>


+ 0
- 1
pipi/filter/blur.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdlib.h>
#include <stdio.h>


+ 0
- 1
pipi/filter/color.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdlib.h>
#include <stdio.h>


+ 0
- 1
pipi/filter/convolution.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdlib.h>
#include <stdio.h>


+ 0
- 1
pipi/filter/dilate.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdlib.h>
#include <stdio.h>


+ 0
- 1
pipi/filter/median.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdlib.h>
#include <stdio.h>


+ 0
- 1
pipi/filter/transform.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdlib.h>
#include <stdio.h>


+ 0
- 1
pipi/histogram/histogram.c 查看文件

@@ -18,7 +18,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/measure.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <math.h>



+ 0
- 1
pipi/paint/bezier.c 查看文件

@@ -18,7 +18,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/paint/floodfill.c 查看文件

@@ -18,7 +18,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdlib.h>
#include <stdio.h>


+ 0
- 1
pipi/paint/line.c 查看文件

@@ -18,7 +18,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 1
- 2
pipi/paint/tile.c 查看文件

@@ -17,9 +17,8 @@
*/

#include "config.h"
#include "common.h"

#include <strings.h>
#include <string.h>

#include "pipi.h"
#include "pipi_internals.h"


+ 0
- 1
pipi/pipi.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 96
- 91
pipi/pipi.h 查看文件

@@ -20,9 +20,15 @@
#ifndef __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
extern "C"
@@ -112,103 +118,102 @@ typedef struct
}
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);

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);
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);
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);
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);
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);
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
}


+ 2
- 0
pipi/pipi_internals.h 查看文件

@@ -19,6 +19,8 @@
#ifndef __PIPI_INTERNALS_H__
#define __PIPI_INTERNALS_H__

#include "pipi_stubs.h"

#define SET_FLAG_GRAY 0x00000001
#define SET_FLAG_WRAP 0x00000002
#define SET_FLAG_8BIT 0x00000004


common.h → pipi/pipi_stubs.h 查看文件

@@ -1,14 +1,13 @@
/*
* 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
*
* $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.
*/

@@ -17,30 +16,41 @@
* 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
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

/* 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>
# elif defined HAVE_NETINET_IN_H
# include <netinet/in.h>
@@ -48,7 +58,9 @@ typedef unsigned long int uintptr_t;
# define hton16 htons
# define hton32 htonl
#else
# if defined HAVE_ENDIAN_H
# if defined __KERNEL__
/* Nothing to do */
# elif defined HAVE_ENDIAN_H
# include <endian.h>
# endif
static inline uint16_t hton16(uint16_t x)
@@ -81,5 +93,5 @@ static inline uint32_t hton32(uint32_t x)
}
#endif

#endif /* __COMMON_H__ */
#endif /* __PIPI_STUBS_H__ */


+ 100
- 0
pipi/pipi_types.h.in 查看文件

@@ -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__ */


+ 0
- 1
pipi/pixels.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/quantize/reduce.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/render/noise.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/render/screen.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
pipi/resize.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdlib.h>
#include <string.h>


+ 0
- 1
pipi/stock.c 查看文件

@@ -17,7 +17,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
src/pipi.c 查看文件

@@ -1,5 +1,4 @@
#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 0
- 1
test/u8tof32tou8.c 查看文件

@@ -18,7 +18,6 @@
*/

#include "config.h"
#include "common.h"

#include <stdio.h>
#include <stdlib.h>


+ 1
- 1
win32/Makefile.am 查看文件

@@ -1,4 +1,4 @@
# $Id$

EXTRA_DIST = config.h
EXTRA_DIST = config.h pipi_types.h


+ 2
- 0
win32/pipi_types.h 查看文件

@@ -0,0 +1,2 @@
#define PIPI_TYPES 3
#include "../pipi/pipi_types.h.in"

正在加载...
取消
保存