source: libpipi/trunk/pipi/pipi.h @ 2709

Last change on this file since 2709 was 2708, checked in by Sam Hocevar, 15 years ago
  • subadd.c: add pipi_sub() and pipi_add() as another way to combine two images.
File size: 3.7 KB
Line 
1/*
2 *  libpipi       Proper image processing implementation library
3 *  Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org>
4 *                All Rights Reserved
5 *
6 *  $Id$
7 *
8 *  This library is free software. It comes without any warranty, to
9 *  the extent permitted by applicable law. You can redistribute it
10 *  and/or modify it under the terms of the Do What The Fuck You Want
11 *  To Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15/*
16 * pipi.h: the full libpipi public API
17 */
18
19#ifndef __PIPI_H__
20#define __PIPI_H__
21
22#include <stdio.h>
23
24#ifdef __cplusplus
25extern "C"
26{
27#endif
28
29/* pipi_scan_t: this enum is a list of all possible scanning methods when
30 * parsing an image’s pixels. Not all functions support all scanning paths. */
31typedef enum
32{
33    PIPI_SCAN_RASTER = 0,
34    PIPI_SCAN_SERPENTINE = 1
35}
36pipi_scan_t;
37
38/* pipi_format_t: this enum is a list of all possible pixel formats for
39 * our internal images. RGBA32 is the most usual format when an image has
40 * just been loaded, but RGBA_F is a lot better for complex operations. */
41typedef enum
42{
43    PIPI_PIXELS_UNINITIALISED = -1,
44
45    PIPI_PIXELS_RGBA32 = 0,
46    PIPI_PIXELS_BGR24 = 1,
47    PIPI_PIXELS_RGBA_F = 2,
48    PIPI_PIXELS_Y_F = 3,
49
50    PIPI_PIXELS_MAX = 4
51}
52pipi_format_t;
53
54/* pipi_pixels_t: this structure stores a pixel view of an image. */
55typedef struct
56{
57    void *pixels;
58    int w, h, pitch, bpp;
59    size_t bytes;
60}
61pipi_pixels_t;
62
63/* pipi_image_t: the main image type */
64typedef struct pipi_image pipi_image_t;
65
66/* pipi_context_t: the processing stack */
67typedef struct pipi_context pipi_context_t;
68
69
70extern pipi_context_t *pipi_create_context(void);
71extern void pipi_destroy_context(pipi_context_t *);
72extern int pipi_command(pipi_context_t *, char const *, ...);
73
74extern pipi_image_t *pipi_load(char const *);
75extern pipi_image_t *pipi_load_stock(char const *);
76extern pipi_image_t *pipi_new(int, int);
77extern pipi_image_t *pipi_copy(pipi_image_t *);
78extern void pipi_free(pipi_image_t *);
79extern void pipi_save(pipi_image_t *, const char *);
80
81extern pipi_pixels_t *pipi_getpixels(pipi_image_t *, pipi_format_t);
82
83extern double pipi_measure_msd(pipi_image_t *, pipi_image_t *);
84extern double pipi_measure_rmsd(pipi_image_t *, pipi_image_t *);
85
86extern pipi_image_t *pipi_resize(pipi_image_t *, int, int);
87
88extern pipi_image_t *pipi_mean(pipi_image_t *, pipi_image_t *);
89extern pipi_image_t *pipi_min(pipi_image_t *, pipi_image_t *);
90extern pipi_image_t *pipi_max(pipi_image_t *, pipi_image_t *);
91extern pipi_image_t *pipi_sub(pipi_image_t *, pipi_image_t *);
92extern pipi_image_t *pipi_add(pipi_image_t *, pipi_image_t *);
93
94extern pipi_image_t *pipi_convolution(pipi_image_t *, int, int, double[]);
95extern pipi_image_t *pipi_gaussian_blur(pipi_image_t *, float);
96extern pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *,
97                                            float, float, float, float);
98extern pipi_image_t *pipi_box_blur(pipi_image_t *, int);
99extern pipi_image_t *pipi_box_blur_ext(pipi_image_t *, int, int);
100extern pipi_image_t *pipi_autocontrast(pipi_image_t *);
101
102extern int pipi_flood_fill(pipi_image_t *,
103                           int, int, float, float, float, float);
104
105extern pipi_image_t *pipi_dither_floydsteinberg(pipi_image_t *, pipi_scan_t);
106extern pipi_image_t *pipi_dither_jajuni(pipi_image_t *, pipi_scan_t);
107extern pipi_image_t *pipi_dither_ordered(pipi_image_t *, pipi_image_t *);
108extern pipi_image_t *pipi_dither_random(pipi_image_t *);
109extern pipi_image_t *pipi_dither_ostromoukhov(pipi_image_t *, pipi_scan_t);
110extern pipi_image_t *pipi_dither_dbs(pipi_image_t *);
111extern void pipi_dither_24to16(pipi_image_t *);
112
113#ifdef __cplusplus
114}
115#endif
116
117#endif /* __PIPI_H__ */
118
Note: See TracBrowser for help on using the repository browser.