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

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