| 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 | #ifdef __cplusplus |
|---|
| 23 | extern "C" |
|---|
| 24 | { |
|---|
| 25 | #endif |
|---|
| 26 | |
|---|
| 27 | /* pipi_format_t: this enum is a list of all possible pixel formats for |
|---|
| 28 | * our internal images. RGBA32 is the most usual format when an image has |
|---|
| 29 | * just been loaded, but RGBA_F is a lot better for complex operations. */ |
|---|
| 30 | typedef enum |
|---|
| 31 | { |
|---|
| 32 | PIPI_PIXELS_UNINITIALISED = -1, |
|---|
| 33 | |
|---|
| 34 | PIPI_PIXELS_RGBA32 = 0, |
|---|
| 35 | PIPI_PIXELS_BGR24 = 1, |
|---|
| 36 | PIPI_PIXELS_RGBA_F = 2, |
|---|
| 37 | PIPI_PIXELS_Y_F = 3, |
|---|
| 38 | |
|---|
| 39 | PIPI_PIXELS_MAX = 4 |
|---|
| 40 | } |
|---|
| 41 | pipi_format_t; |
|---|
| 42 | |
|---|
| 43 | /* pipi_pixels_t: this structure stores a pixel view of an image. */ |
|---|
| 44 | typedef struct |
|---|
| 45 | { |
|---|
| 46 | void *pixels; |
|---|
| 47 | int w, h, pitch; |
|---|
| 48 | } |
|---|
| 49 | pipi_pixels_t; |
|---|
| 50 | |
|---|
| 51 | /* pipi_image_t: the main image type */ |
|---|
| 52 | typedef struct pipi_image pipi_image_t; |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | extern pipi_image_t *pipi_load(const char *); |
|---|
| 56 | extern pipi_image_t *pipi_new(int, int); |
|---|
| 57 | extern void pipi_free(pipi_image_t *); |
|---|
| 58 | extern void pipi_save(pipi_image_t *, const char *); |
|---|
| 59 | |
|---|
| 60 | extern pipi_pixels_t *pipi_getpixels(pipi_image_t *, pipi_format_t); |
|---|
| 61 | |
|---|
| 62 | extern double pipi_measure_rmsd(pipi_image_t *, pipi_image_t *); |
|---|
| 63 | |
|---|
| 64 | extern pipi_image_t *pipi_resize(pipi_image_t *, int, int); |
|---|
| 65 | |
|---|
| 66 | extern pipi_image_t *pipi_gaussian_blur(pipi_image_t *, float); |
|---|
| 67 | extern pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *, |
|---|
| 68 | float, float, float, float); |
|---|
| 69 | |
|---|
| 70 | extern pipi_image_t *pipi_floydsteinberg(pipi_image_t *); |
|---|
| 71 | extern void pipi_dither_24to16(pipi_image_t *); |
|---|
| 72 | |
|---|
| 73 | extern void pipi_test(pipi_image_t *); |
|---|
| 74 | |
|---|
| 75 | #ifdef __cplusplus |
|---|
| 76 | } |
|---|
| 77 | #endif |
|---|
| 78 | |
|---|
| 79 | #endif /* __PIPI_H__ */ |
|---|
| 80 | |
|---|