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

Last change on this file since 2837 was 2837, checked in by Sam Hocevar, 10 years ago

Allow to use all available image loaders instead of just the first one.

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