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

Last change on this file since 2897 was 2897, checked in by Jean-Yves Lamoureux, 11 years ago
  • Added preliminary support of CoreImage? (Cocoa/Mac? OS X) Changed default hidden unicode glyph to 'x' in The Pimp to fix a compilation problem
File size: 2.6 KB
RevLine 
[2228]1/*
[2844]2 *  libpipi       Pathetic image processing interface library
[2228]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/*
[2261]16 *  pipi_internals.h: internal types
[2228]17 */
18
[2605]19#ifndef __PIPI_INTERNALS_H__
20#define __PIPI_INTERNALS_H__
[2228]21
[2793]22#define SET_FLAG_GRAY 0x00000001
23#define SET_FLAG_WRAP 0x00000002
[2794]24#define SET_FLAG_8BIT 0x00000004
[2793]25
[2809]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
[2605]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. */
[2228]40struct pipi_image
41{
[2605]42    int w, h, pitch;
[2756]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
[2769]49    /* Translation vectors for wrap around and tiling. */
50    int wrapx1, wrapy1, wrapx2, wrapy2;
[2605]51
[2769]52    /* List of all possible pixel formats and the last active one. */
[2605]53    pipi_pixels_t p[PIPI_PIXELS_MAX];
[2769]54    pipi_format_t last_modified;
[2605]55
56    /* Private data used by the codec */
[2769]57    pipi_format_t codec_format;
[2605]58    void *codec_priv;
[2837]59    int (*codec_free)(pipi_image_t *);
[2228]60};
61
[2692]62struct pipi_context
63{
64    int nimages;
65    pipi_image_t *images[1024]; /* FIXME: do dynamic allocation */
66};
67
[2261]68#ifdef USE_IMLIB2
69pipi_image_t *pipi_load_imlib2(const char *name);
[2837]70int pipi_save_imlib2(pipi_image_t *img, const char *name);
[2261]71#endif
72
73#ifdef USE_OPENCV
74pipi_image_t *pipi_load_opencv(const char *name);
[2837]75int pipi_save_opencv(pipi_image_t *img, const char *name);
[2261]76#endif
77
78#ifdef USE_SDL
79pipi_image_t *pipi_load_sdl(const char *name);
[2837]80int pipi_save_sdl(pipi_image_t *img, const char *name);
[2261]81#endif
82
[2840]83#ifdef USE_GDI
84pipi_image_t *pipi_load_gdi(const char *name);
85int pipi_save_gdi(pipi_image_t *img, const char *name);
86#endif
87
[2897]88#ifdef USE_COCOA
89pipi_image_t *pipi_load_coreimage(const char *name);
90int pipi_save_coreimage(pipi_image_t *img, const char *name);
91#endif
92
93
[2842]94pipi_image_t *pipi_load_oric(const char *name);
95int pipi_save_oric(pipi_image_t *img, const char *name);
96
[2228]97#endif /* __PIPI_INTERNALS_H__ */
98
Note: See TracBrowser for help on using the repository browser.