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

Last change on this file since 2668 was 2668, checked in by Sam Hocevar, 14 years ago
  • pipi.c: implement pipi_copy().
File size: 2.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
67extern pipi_image_t *pipi_load(const char *);
68extern pipi_image_t *pipi_new(int, int);
69extern pipi_image_t *pipi_copy(pipi_image_t *);
70extern void pipi_free(pipi_image_t *);
71extern void pipi_save(pipi_image_t *, const char *);
72
73extern pipi_pixels_t *pipi_getpixels(pipi_image_t *, pipi_format_t);
74
75extern double pipi_measure_msd(pipi_image_t *, pipi_image_t *);
76extern double pipi_measure_rmsd(pipi_image_t *, pipi_image_t *);
77
78extern pipi_image_t *pipi_resize(pipi_image_t *, int, int);
79
80extern pipi_image_t *pipi_convolution(pipi_image_t *, int, int, double[]);
81extern pipi_image_t *pipi_gaussian_blur(pipi_image_t *, float);
82extern pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *,
83                                            float, float, float, float);
84
85extern pipi_image_t *pipi_dither_floydsteinberg(pipi_image_t *, pipi_scan_t);
86extern pipi_image_t *pipi_dither_ordered(pipi_image_t *);
87extern pipi_image_t *pipi_dither_ostromoukhov(pipi_image_t *, pipi_scan_t);
88extern pipi_image_t *pipi_dither_dbs(pipi_image_t *);
89extern void pipi_dither_24to16(pipi_image_t *);
90
91extern void pipi_test(pipi_image_t *);
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif /* __PIPI_H__ */
98
Note: See TracBrowser for help on using the repository browser.