mirror of https://github.com/GNOME/gimp.git
formatting.
2005-07-09 Sven Neumann <sven@gimp.org> * app/base/pixel-surround.[ch]: formatting.
This commit is contained in:
parent
4b29677d16
commit
841144efbd
|
@ -1,5 +1,7 @@
|
|||
2005-07-09 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/pixel-surround.[ch]: formatting.
|
||||
|
||||
* app/core/gimpchannel.c (gimp_channel_real_feather):
|
||||
gaussian_blur_region() writes to the pixel data, need to initialize
|
||||
the pixel region with dirty == TRUE;
|
||||
|
|
|
@ -33,14 +33,12 @@ pixel_surround_init (PixelSurround *ps,
|
|||
TileManager *tm,
|
||||
gint w,
|
||||
gint h,
|
||||
guchar bg[MAX_CHANNELS])
|
||||
const guchar bg[MAX_CHANNELS])
|
||||
{
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < MAX_CHANNELS; ++i)
|
||||
{
|
||||
ps->bg[i] = bg[i];
|
||||
}
|
||||
ps->bg[i] = bg[i];
|
||||
|
||||
ps->tile = NULL;
|
||||
ps->mgr = tm;
|
||||
|
@ -69,10 +67,11 @@ pixel_surround_lock (PixelSurround *ps,
|
|||
|
||||
/* do we have the whole region? */
|
||||
if (ps->tile &&
|
||||
(i < (tile_ewidth(ps->tile) - ps->w)) &&
|
||||
(j < (tile_eheight(ps->tile) - ps->h)))
|
||||
(i < (tile_ewidth (ps->tile) - ps->w)) &&
|
||||
(j < (tile_eheight (ps->tile) - ps->h)))
|
||||
{
|
||||
ps->row_stride = tile_ewidth (ps->tile) * ps->bpp;
|
||||
|
||||
/* is this really the correct way? */
|
||||
return tile_data_pointer (ps->tile, i, j);
|
||||
}
|
||||
|
@ -87,9 +86,9 @@ pixel_surround_lock (PixelSurround *ps,
|
|||
/* copy pixels, one by one */
|
||||
/* no, this is not the best way, but it's much better than before */
|
||||
ptr = ps->buff;
|
||||
for (j = y; j < y+ps->h; ++j)
|
||||
for (j = y; j < y + ps->h; ++j)
|
||||
{
|
||||
for (i = x; i < x+ps->w; ++i)
|
||||
for (i = x; i < x + ps->w; ++i)
|
||||
{
|
||||
Tile *tile = tile_manager_get_tile (ps->mgr, i, j, TRUE, FALSE);
|
||||
|
||||
|
@ -100,17 +99,14 @@ pixel_surround_lock (PixelSurround *ps,
|
|||
j % TILE_HEIGHT);
|
||||
|
||||
for (k = buff; k < buff+ps->bpp; ++k, ++ptr)
|
||||
{
|
||||
*ptr = *k;
|
||||
}
|
||||
*ptr = *k;
|
||||
|
||||
tile_release (tile, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (k = ps->bg; k < ps->bg+ps->bpp; ++k, ++ptr)
|
||||
{
|
||||
*ptr = *k;
|
||||
}
|
||||
for (k = ps->bg; k < ps->bg + ps->bpp; ++k, ++ptr)
|
||||
*ptr = *k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,18 +39,18 @@ typedef struct _PixelSurround
|
|||
|
||||
|
||||
void pixel_surround_init (PixelSurround *ps,
|
||||
TileManager *tm,
|
||||
gint w,
|
||||
gint h,
|
||||
guchar bg[MAX_CHANNELS]);
|
||||
TileManager *tm,
|
||||
gint w,
|
||||
gint h,
|
||||
const guchar bg[MAX_CHANNELS]);
|
||||
|
||||
/* return a pointer to a buffer which contains all the surrounding pixels
|
||||
* strategy: if we are in the middle of a tile, use the tile storage
|
||||
* otherwise just copy into our own malloced buffer and return that
|
||||
*/
|
||||
guchar * pixel_surround_lock (PixelSurround *ps,
|
||||
gint x,
|
||||
gint y);
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
gint pixel_surround_rowstride (PixelSurround *ps);
|
||||
|
||||
|
|
Loading…
Reference in New Issue