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

Last change on this file since 2809 was 2809, checked in by jylam, 6 years ago
  • Preliminary image histogram routines and example
File size: 2.5 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};
60
61struct pipi_context
62{
63    int nimages;
64    pipi_image_t *images[1024]; /* FIXME: do dynamic allocation */
65};
66
67#ifdef USE_IMLIB2
68pipi_image_t *pipi_load_imlib2(const char *name);
69pipi_image_t *pipi_new_imlib2(int width, int height);
70void pipi_free_imlib2(pipi_image_t *img);
71void pipi_save_imlib2(pipi_image_t *img, const char *name);
72#endif
73
74#ifdef USE_OPENCV
75pipi_image_t *pipi_load_opencv(const char *name);
76pipi_image_t *pipi_new_opencv(int width, int height);
77void pipi_free_opencv(pipi_image_t *img);
78void pipi_save_opencv(pipi_image_t *img, const char *name);
79#endif
80
81#ifdef USE_SDL
82pipi_image_t *pipi_load_sdl(const char *name);
83pipi_image_t *pipi_new_sdl(int width, int height);
84void pipi_free_sdl(pipi_image_t *img);
85void pipi_save_sdl(pipi_image_t *img, const char *name);
86#endif
87
88#endif /* __PIPI_INTERNALS_H__ */
89
Note: See TracBrowser for help on using the repository browser.