source: libpipi/trunk/pipi/pipi_internals.h @ 3075

Last change on this file since 3075 was 3075, checked in by Jean-Yves Lamoureux, 12 years ago
  • Added 'Modular' codec as a testbed for hand-written codecs, as well as a JPEG decoder (libjpeg). Some stuff are

temporary, though.

File size: 2.9 KB
Line 
1/*
2 *  libpipi       Pathetic image processing interface 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_internals.h: internal types
17 */
18
19#ifndef __PIPI_INTERNALS_H__
20#define __PIPI_INTERNALS_H__
21
22#include "pipi_stubs.h"
23
24#define SET_FLAG_GRAY 0x00000001
25#define SET_FLAG_WRAP 0x00000002
26#define SET_FLAG_8BIT 0x00000004
27
28struct pipi_histogram
29{
30    int r_present, g_present, b_present, y_present;
31    unsigned int a[256];
32    unsigned int r[256];
33    unsigned int g[256];
34    unsigned int b[256];
35    unsigned int y[256];
36};
37
38
39/* pipi_image_t: the image structure. This is probably going to be the most
40 * complex structure in the library, but right now it only has fairly normal
41 * stuff, like width and height and pointers to pixel areas. */
42struct pipi_image
43{
44    int w, h, pitch;
45
46    /* A list of internal image flags.
47     *  wrap: should filters wrap around at edges?
48     *  u8: are the image samples still 8-bit per channel? */
49    int wrap, u8;
50
51    /* Translation vectors for wrap around and tiling. */
52    int wrapx1, wrapy1, wrapx2, wrapy2;
53
54    /* List of all possible pixel formats and the last active one. */
55    pipi_pixels_t p[PIPI_PIXELS_MAX];
56    pipi_format_t last_modified;
57
58    /* Private data used by the codec */
59    pipi_format_t codec_format;
60    void *codec_priv;
61    int (*codec_free)(pipi_image_t *);
62};
63
64struct pipi_context
65{
66    int nimages;
67    pipi_image_t *images[1024]; /* FIXME: do dynamic allocation */
68};
69
70#ifdef USE_IMLIB2
71pipi_image_t *pipi_load_imlib2(const char *name);
72int pipi_save_imlib2(pipi_image_t *img, const char *name);
73#endif
74
75#ifdef USE_OPENCV
76pipi_image_t *pipi_load_opencv(const char *name);
77int pipi_save_opencv(pipi_image_t *img, const char *name);
78#endif
79
80#ifdef USE_SDL
81pipi_image_t *pipi_load_sdl(const char *name);
82int pipi_save_sdl(pipi_image_t *img, const char *name);
83#endif
84
85#ifdef USE_GDIPLUS
86pipi_image_t *pipi_load_gdiplus(const char *name);
87int pipi_save_gdiplus(pipi_image_t *img, const char *name);
88#endif
89
90#ifdef USE_GDI
91pipi_image_t *pipi_load_gdi(const char *name);
92int pipi_save_gdi(pipi_image_t *img, const char *name);
93#endif
94
95#ifdef USE_COCOA
96pipi_image_t *pipi_load_coreimage(const char *name);
97int pipi_save_coreimage(pipi_image_t *img, const char *name);
98#endif
99
100/* Modular codecs */
101#ifdef USE_MODULAR
102pipi_image_t *pipi_load_modular(const char *name);
103int pipi_save_modular(pipi_image_t *img, const char *name);
104#endif
105
106
107
108pipi_image_t *pipi_load_oric(const char *name);
109int pipi_save_oric(pipi_image_t *img, const char *name);
110
111#endif /* __PIPI_INTERNALS_H__ */
112
Note: See TracBrowser for help on using the repository browser.