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

Last change on this file since 2794 was 2794, checked in by Sam Hocevar, 12 years ago
  • Add "8bit" to the list of supported template flags.
File size: 2.3 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
26/* pipi_image_t: the image structure. This is probably going to be the most
27 * complex structure in the library, but right now it only has fairly normal
28 * stuff, like width and height and pointers to pixel areas. */
29struct pipi_image
30{
31    int w, h, pitch;
32
33    /* A list of internal image flags.
34     *  wrap: should filters wrap around at edges?
35     *  u8: are the image samples still 8-bit per channel? */
36    int wrap, u8;
37
38    /* Translation vectors for wrap around and tiling. */
39    int wrapx1, wrapy1, wrapx2, wrapy2;
40
41    /* List of all possible pixel formats and the last active one. */
42    pipi_pixels_t p[PIPI_PIXELS_MAX];
43    pipi_format_t last_modified;
44
45    /* Private data used by the codec */
46    pipi_format_t codec_format;
47    void *codec_priv;
48};
49
50struct pipi_context
51{
52    int nimages;
53    pipi_image_t *images[1024]; /* FIXME: do dynamic allocation */
54};
55
56#ifdef USE_IMLIB2
57pipi_image_t *pipi_load_imlib2(const char *name);
58pipi_image_t *pipi_new_imlib2(int width, int height);
59void pipi_free_imlib2(pipi_image_t *img);
60void pipi_save_imlib2(pipi_image_t *img, const char *name);
61#endif
62
63#ifdef USE_OPENCV
64pipi_image_t *pipi_load_opencv(const char *name);
65pipi_image_t *pipi_new_opencv(int width, int height);
66void pipi_free_opencv(pipi_image_t *img);
67void pipi_save_opencv(pipi_image_t *img, const char *name);
68#endif
69
70#ifdef USE_SDL
71pipi_image_t *pipi_load_sdl(const char *name);
72pipi_image_t *pipi_new_sdl(int width, int height);
73void pipi_free_sdl(pipi_image_t *img);
74void pipi_save_sdl(pipi_image_t *img, const char *name);
75#endif
76
77#endif /* __PIPI_INTERNALS_H__ */
78
Note: See TracBrowser for help on using the repository browser.