~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/base/tile-manager.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
21
21
 
22
22
struct _PixelDataHandle
23
23
{
24
 
  guchar                 *data;
25
 
  gint                    width;
26
 
  gint                    height;
27
 
  gint                    stride;
28
 
  gint                    bpp;
 
24
  guchar *data;
 
25
  gint    width;
 
26
  gint    height;
 
27
  gint    stride;
 
28
  gint    bpp;
29
29
};
30
30
 
31
 
/* Creates a new tile manager with the specified
32
 
 *  width for the toplevel. The toplevel sizes is
33
 
 *  used to compute the number of levels and there
34
 
 *  size. Each level is 1/2 the width and height of
 
31
/* Creates a new tile manager with the specified width for the
 
32
 *  toplevel. The toplevel size is used to compute the number of
 
33
 *  levels and their size. Each level is 1/2 the width and height of
35
34
 *  the level above it.
36
35
 *
37
 
 * The toplevel is level 0. The smallest level in the
38
 
 *  hierarchy is "nlevels - 1". That level will be smaller
39
 
 *  than TILE_WIDTH x TILE_HEIGHT
 
36
 * The toplevel is level 0. The smallest level in the hierarchy
 
37
 *  is "nlevels - 1". That level will be smaller than TILE_WIDTH x
 
38
 *  TILE_HEIGHT
40
39
 */
41
 
TileManager * tile_manager_new               (gint toplevel_width,
42
 
                                              gint toplevel_height,
43
 
                                              gint bpp);
 
40
TileManager * tile_manager_new               (gint width,
 
41
                                              gint height,
 
42
                                              gint bpp);
44
43
 
45
44
/* Ref/Unref a tile manager.
46
45
 */
47
46
TileManager * tile_manager_ref               (TileManager *tm);
48
47
void          tile_manager_unref             (TileManager *tm);
49
48
 
50
 
/* Set the validate procedure for the tile manager.
51
 
 *  The validate procedure is called when an invalid tile
52
 
 *  is referenced. If the procedure is NULL, then the tile
53
 
 *  is set to valid and its memory is allocated, but
54
 
 *  not initialized.
 
49
/* Set the validate procedure for the tile manager.  The validate
 
50
 *  procedure is called when an invalid tile is referenced. If the
 
51
 *  procedure is NULL, then the tile is set to valid and its memory is
 
52
 *  allocated, but not initialized.
55
53
 */
56
54
void          tile_manager_set_validate_proc (TileManager      *tm,
57
 
                                              TileValidateProc  proc);
 
55
                                              TileValidateProc  proc);
58
56
 
59
57
/* Get a specified tile from a tile manager.
60
58
 */
61
59
Tile        * tile_manager_get_tile          (TileManager *tm,
62
 
                                              gint         xpixel,
63
 
                                              gint         ypixel,
64
 
                                              gint         wantread,
65
 
                                              gint         wantwrite);
 
60
                                              gint         xpixel,
 
61
                                              gint         ypixel,
 
62
                                              gint         wantread,
 
63
                                              gint         wantwrite);
66
64
 
67
65
/* Get a specified tile from a tile manager.
68
66
 */
69
67
Tile        * tile_manager_get               (TileManager *tm,
70
 
                                              gint         tile_num,
71
 
                                              gint         wantread,
72
 
                                              gint         wantwrite);
73
 
 
74
 
/* Request that (if possible) the tile at x,y be swapped
75
 
 * in.  This is only a hint to improve performance; no guarantees.
76
 
 * The tile may be swapped in or otherwise made more accessible
77
 
 * if it is convenient...
78
 
 */
79
 
void          tile_manager_get_async         (TileManager *tm,
80
 
                                              gint         xpixel,
81
 
                                              gint         ypixel);
 
68
                                              gint         tile_num,
 
69
                                              gint         wantread,
 
70
                                              gint         wantwrite);
82
71
 
83
72
void          tile_manager_map_tile          (TileManager *tm,
84
 
                                              gint         xpixel,
85
 
                                              gint         ypixel,
86
 
                                              Tile        *srctile);
 
73
                                              gint         xpixel,
 
74
                                              gint         ypixel,
 
75
                                              Tile        *srctile);
87
76
 
88
77
void          tile_manager_map               (TileManager *tm,
89
 
                                              gint         tile_num,
90
 
                                              Tile        *srctile);
 
78
                                              gint         tile_num,
 
79
                                              Tile        *srctile);
91
80
 
92
81
/* Validate a tiles memory.
93
82
 */
94
83
void          tile_manager_validate          (TileManager  *tm,
95
 
                                              Tile         *tile);
 
84
                                              Tile         *tile);
96
85
 
97
86
void          tile_invalidate                (Tile        **tile_ptr,
98
 
                                              TileManager  *tm,
99
 
                                              gint          tile_num);
 
87
                                              TileManager  *tm,
 
88
                                              gint          tile_num);
100
89
void          tile_invalidate_tile           (Tile        **tile_ptr,
101
 
                                              TileManager  *tm,
102
 
                                              gint          xpixel,
103
 
                                              gint          ypixel);
 
90
                                              TileManager  *tm,
 
91
                                              gint          xpixel,
 
92
                                              gint          ypixel);
104
93
 
105
94
/* Given a toplevel tile, this procedure will invalidate
106
95
 *  (set the dirty bit) for this toplevel tile.
107
96
 */
108
97
void          tile_manager_invalidate_tiles  (TileManager       *tm,
109
 
                                              Tile              *toplevel_tile);
 
98
                                              Tile              *toplevel_tile);
110
99
 
111
100
void          tile_manager_set_user_data     (TileManager       *tm,
112
 
                                              gpointer           user_data);
 
101
                                              gpointer           user_data);
113
102
gpointer      tile_manager_get_user_data     (const TileManager *tm);
114
103
 
115
104
gint          tile_manager_width             (const TileManager *tm);
117
106
gint          tile_manager_bpp               (const TileManager *tm);
118
107
 
119
108
void          tile_manager_get_offsets       (const TileManager *tm,
120
 
                                              gint              *x,
121
 
                                              gint              *y);
 
109
                                              gint              *x,
 
110
                                              gint              *y);
122
111
void          tile_manager_set_offsets       (TileManager       *tm,
123
 
                                              gint               x,
124
 
                                              gint               y);
 
112
                                              gint               x,
 
113
                                              gint               y);
125
114
 
126
115
gint64        tile_manager_get_memsize       (const TileManager *tm,
127
116
                                              gboolean           sparse);
128
117
 
129
118
void          tile_manager_get_tile_coordinates (TileManager *tm,
130
 
                                                 Tile        *tile,
131
 
                                                 gint        *x,
132
 
                                                 gint        *y);
 
119
                                                 Tile        *tile,
 
120
                                                 gint        *x,
 
121
                                                 gint        *y);
133
122
 
134
123
void          tile_manager_map_over_tile        (TileManager *tm,
135
 
                                                 Tile        *tile,
136
 
                                                 Tile        *srctile);
 
124
                                                 Tile        *tile,
 
125
                                                 Tile        *srctile);
137
126
 
138
127
PixelDataHandle * request_pixel_data (TileManager *tm,
139
 
                                      gint         x1,
140
 
                                      gint         y1,
141
 
                                      gint         x2,
142
 
                                      gint         y2,
143
 
                                      gboolean     wantread,
144
 
                                      gboolean     wantwrite);
 
128
                                      gint         x1,
 
129
                                      gint         y1,
 
130
                                      gint         x2,
 
131
                                      gint         y2,
 
132
                                      gboolean     wantread,
 
133
                                      gboolean     wantwrite);
145
134
 
146
135
void              release_pixel_data (PixelDataHandle *pdh);
147
136
 
148
 
void              read_pixel_data (TileManager *tm,
149
 
                                   gint         x1,
150
 
                                   gint         y1,
151
 
                                   gint         x2,
152
 
                                   gint         y2,
153
 
                                   guchar      *buffer,
154
 
                                   guint        stride);
 
137
void              read_pixel_data    (TileManager  *tm,
 
138
                                      gint          x1,
 
139
                                      gint          y1,
 
140
                                      gint          x2,
 
141
                                      gint          y2,
 
142
                                      guchar       *buffer,
 
143
                                      guint         stride);
155
144
 
156
 
void              write_pixel_data (TileManager *tm,
157
 
                                    gint         x1,
158
 
                                    gint         y1,
159
 
                                    gint         x2,
160
 
                                    gint         y2,
161
 
                                    guchar      *buffer,
162
 
                                    guint        stride);
 
145
void              write_pixel_data   (TileManager  *tm,
 
146
                                      gint          x1,
 
147
                                      gint          y1,
 
148
                                      gint          x2,
 
149
                                      gint          y2,
 
150
                                      const guchar *buffer,
 
151
                                      guint         stride);
163
152
 
164
153
/*   Fill buffer with the pixeldata for the pixel at coordinates x,y
165
154
 *   if x,y is outside the area of the tilemanger, nothing is done.
166
155
 */
167
 
void              read_pixel_data_1 (TileManager *tm,
168
 
                                     gint         x,
169
 
                                     gint         y,
170
 
                                     guchar      *buffer);
 
156
void              read_pixel_data_1  (TileManager  *tm,
 
157
                                      gint          x,
 
158
                                      gint          y,
 
159
                                      guchar       *buffer);
171
160
 
172
 
void              write_pixel_data_1 (TileManager *tm,
173
 
                                      gint         x,
174
 
                                      gint         y,
175
 
                                      guchar      *buffer);
 
161
void              write_pixel_data_1 (TileManager  *tm,
 
162
                                      gint          x,
 
163
                                      gint          y,
 
164
                                      const guchar *buffer);
176
165
 
177
166
#endif /* __TILE_MANAGER_H__ */