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

Last change on this file since 3627 was 3627, checked in by Sam Hocevar, 11 years ago

Move the whole makemovie logic to libpipi. It's really hackish
for now, but it seems to work.

File size: 3.3 KB
Line 
1/*
2 *  libpipi       Pathetic image processing interface library
3 *  Copyright (c) 2004-2009 Sam Hocevar <sam@hocevar.net>
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#include "pipi_stubs.h"
23
24#define SET_FLAG_GRAY 0x00000001
25#define SET_FLAG_WRAP 0x00000002
26#define SET_FLAG_8BIT 0x00000004
27
28struct pipi_histogram
29{
30    int r_present, g_present, b_present, y_present;
31    unsigned int a[256];
32    unsigned int r[256];
33    unsigned int g[256];
34    unsigned int b[256];
35    unsigned int y[256];
36};
37
38#ifdef USE_TILES
39#define TILE_SIZE 128
40
41struct pipi_tile
42{
43    int x, y;
44    int zoom;
45
46    int refcount;
47
48    pipi_format_t fmt;
49    int plane;
50    union { uint8_t *u8; float *f; double *d; } data;
51    union { uint8_t u8[1]; float f[1]; double d[1]; } align;
52};
53#endif /* USE_TILES */
54
55/* pipi_image_t: the image structure. This is probably going to be the most
56 * complex structure in the library, but right now it only has fairly normal
57 * stuff, like width and height and pointers to pixel areas. */
58struct pipi_image
59{
60    int w, h, pitch;
61
62#ifdef USE_TILES
63    pipi_tile_t **tiles;
64    int ntiles;
65#endif /* USE_TILES */
66
67    /* A list of internal image flags.
68     *  wrap: should filters wrap around at edges?
69     *  u8: are the image samples still 8-bit per channel? */
70    int wrap, u8;
71
72    /* Translation vectors for wrap around and tiling. */
73    int wrapx1, wrapy1, wrapx2, wrapy2;
74
75    /* List of all possible pixel formats and the last active one. */
76    pipi_pixels_t p[PIPI_PIXELS_MAX];
77    pipi_format_t last_modified;
78
79    /* Private data used by the codec */
80    pipi_format_t codec_format;
81    void *codec_priv;
82    int (*codec_free)(pipi_image_t *);
83};
84
85struct pipi_sequence
86{
87    int w, h, fps;
88
89    void *codec_priv;
90};
91
92struct pipi_context
93{
94    int nimages;
95    pipi_image_t *images[1024]; /* FIXME: do dynamic allocation */
96};
97
98#ifdef USE_IMLIB2
99pipi_image_t *pipi_load_imlib2(const char *name);
100int pipi_save_imlib2(pipi_image_t *img, const char *name);
101#endif
102
103#ifdef USE_OPENCV
104pipi_image_t *pipi_load_opencv(const char *name);
105int pipi_save_opencv(pipi_image_t *img, const char *name);
106#endif
107
108#ifdef USE_SDL
109pipi_image_t *pipi_load_sdl(const char *name);
110int pipi_save_sdl(pipi_image_t *img, const char *name);
111#endif
112
113#ifdef USE_GDIPLUS
114pipi_image_t *pipi_load_gdiplus(const char *name);
115int pipi_save_gdiplus(pipi_image_t *img, const char *name);
116#endif
117
118#ifdef USE_GDI
119pipi_image_t *pipi_load_gdi(const char *name);
120int pipi_save_gdi(pipi_image_t *img, const char *name);
121#endif
122
123#ifdef USE_COCOA
124pipi_image_t *pipi_load_coreimage(const char *name);
125int pipi_save_coreimage(pipi_image_t *img, const char *name);
126#endif
127
128#ifdef USE_JPEG
129pipi_image_t *pipi_load_jpeg(const char *name);
130int pipi_save_jpeg(pipi_image_t *img, const char *name);
131#endif
132
133pipi_image_t *pipi_load_oric(const char *name);
134int pipi_save_oric(pipi_image_t *img, const char *name);
135
136#endif /* __PIPI_INTERNALS_H__ */
137
Note: See TracBrowser for help on using the repository browser.