forked from AuroraMiddleware/gtk
By order of jrb: const patch for various bits, io-gif.c fixup for
By order of jrb: const patch for various bits, io-gif.c fixup for animations.
This commit is contained in:
parent
0f5251b51d
commit
45cb0268b9
@ -1,3 +1,23 @@
|
||||
2000-02-04 Michael Meeks <mmeeks@gnu.org>
|
||||
|
||||
* gdk-pixbuf/io-gif.c (struct _GifContext): add x,y_offset.
|
||||
(gif_get_frame_info): put the offsets on the context.
|
||||
(gif_get_lzw): copy them off into the frame.
|
||||
(new_context): no change required; will 0 offsets by default.
|
||||
|
||||
2000-01-28 Michael Meeks <michael@mejm2.dow.cam.ac.uk>
|
||||
|
||||
* gdk-pixbuf/pixops/pixops.c (pixops_process): const + nasty
|
||||
un-consting cast.
|
||||
|
||||
* gdk-pixbuf/pixops/pixops.h: const.
|
||||
|
||||
* gdk-pixbuf/gdk-pixbuf-util.c: const.
|
||||
|
||||
* gdk-pixbuf/gdk-pixbuf-scale.c: const.
|
||||
|
||||
* gdk-pixbuf/gdk-pixbuf.h: constify lots of things.
|
||||
|
||||
2000-02-03 Federico Mena Quintero <federico@helixcode.com>
|
||||
|
||||
* gdk-pixbuf/gdk-pixbuf-render.c
|
||||
|
@ -22,7 +22,7 @@
|
||||
* destination drawable replacing the previous contents.
|
||||
**/
|
||||
void
|
||||
gdk_pixbuf_scale (GdkPixbuf *src,
|
||||
gdk_pixbuf_scale (const GdkPixbuf *src,
|
||||
GdkPixbuf *dest,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
@ -66,7 +66,7 @@ gdk_pixbuf_scale (GdkPixbuf *src,
|
||||
* destination drawable.
|
||||
**/
|
||||
void
|
||||
gdk_pixbuf_composite (GdkPixbuf *src,
|
||||
gdk_pixbuf_composite (const GdkPixbuf *src,
|
||||
GdkPixbuf *dest,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
@ -116,7 +116,7 @@ gdk_pixbuf_composite (GdkPixbuf *src,
|
||||
* destination drawable.
|
||||
**/
|
||||
void
|
||||
gdk_pixbuf_composite_color (GdkPixbuf *src,
|
||||
gdk_pixbuf_composite_color (const GdkPixbuf *src,
|
||||
GdkPixbuf *dest,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
@ -158,7 +158,7 @@ gdk_pixbuf_composite_color (GdkPixbuf *src,
|
||||
* Return value: the new #GdkPixbuf
|
||||
**/
|
||||
GdkPixbuf *
|
||||
gdk_pixbuf_scale_simple (GdkPixbuf *src,
|
||||
gdk_pixbuf_scale_simple (const GdkPixbuf *src,
|
||||
int dest_width,
|
||||
int dest_height,
|
||||
ArtFilterLevel filter_level)
|
||||
@ -191,7 +191,7 @@ gdk_pixbuf_scale_simple (GdkPixbuf *src,
|
||||
* Return value: the new #GdkPixbuf
|
||||
**/
|
||||
GdkPixbuf *
|
||||
gdk_pixbuf_composite_color_simple (GdkPixbuf *src,
|
||||
gdk_pixbuf_composite_color_simple (const GdkPixbuf *src,
|
||||
int dest_width,
|
||||
int dest_height,
|
||||
ArtFilterLevel filter_level,
|
||||
|
@ -110,13 +110,14 @@ gdk_pixbuf_add_alpha (GdkPixbuf *pixbuf, gboolean substitute_color, guchar r, gu
|
||||
* pixbuf formats is done automatically.
|
||||
**/
|
||||
void
|
||||
gdk_pixbuf_copy_area (GdkPixbuf *src_pixbuf,
|
||||
gdk_pixbuf_copy_area (const GdkPixbuf *src_pixbuf,
|
||||
int src_x, int src_y,
|
||||
int width, int height,
|
||||
GdkPixbuf *dest_pixbuf,
|
||||
int dest_x, int dest_y)
|
||||
{
|
||||
ArtPixBuf *src_apb, *dest_apb;
|
||||
const ArtPixBuf *src_apb;
|
||||
ArtPixBuf *dest_apb;
|
||||
|
||||
g_return_if_fail (src_pixbuf != NULL);
|
||||
g_return_if_fail (dest_pixbuf != NULL);
|
||||
|
@ -168,7 +168,7 @@ GdkPixbuf *gdk_pixbuf_get_from_drawable (GdkPixbuf *dest,
|
||||
int width, int height);
|
||||
|
||||
/* Copy an area of a pixbuf onto another one */
|
||||
void gdk_pixbuf_copy_area (GdkPixbuf *src_pixbuf,
|
||||
void gdk_pixbuf_copy_area (const GdkPixbuf *src_pixbuf,
|
||||
int src_x, int src_y,
|
||||
int width, int height,
|
||||
GdkPixbuf *dest_pixbuf,
|
||||
@ -176,7 +176,7 @@ void gdk_pixbuf_copy_area (GdkPixbuf *src_pixbuf,
|
||||
|
||||
/* Scaling */
|
||||
|
||||
void gdk_pixbuf_scale (GdkPixbuf *src,
|
||||
void gdk_pixbuf_scale (const GdkPixbuf *src,
|
||||
GdkPixbuf *dest,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
@ -187,7 +187,7 @@ void gdk_pixbuf_scale (GdkPixbuf *src,
|
||||
double scale_x,
|
||||
double scale_y,
|
||||
ArtFilterLevel filter_level);
|
||||
void gdk_pixbuf_composite (GdkPixbuf *src,
|
||||
void gdk_pixbuf_composite (const GdkPixbuf *src,
|
||||
GdkPixbuf *dest,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
@ -199,7 +199,7 @@ void gdk_pixbuf_composite (GdkPixbuf *src,
|
||||
double scale_y,
|
||||
ArtFilterLevel filter_level,
|
||||
int overall_alpha);
|
||||
void gdk_pixbuf_composite_color (GdkPixbuf *src,
|
||||
void gdk_pixbuf_composite_color (const GdkPixbuf *src,
|
||||
GdkPixbuf *dest,
|
||||
int dest_x,
|
||||
int dest_y,
|
||||
@ -217,11 +217,11 @@ void gdk_pixbuf_composite_color (GdkPixbuf *src,
|
||||
art_u32 color1,
|
||||
art_u32 color2);
|
||||
|
||||
GdkPixbuf *gdk_pixbuf_scale_simple (GdkPixbuf *src,
|
||||
GdkPixbuf *gdk_pixbuf_scale_simple (const GdkPixbuf *src,
|
||||
int dest_width,
|
||||
int dest_height,
|
||||
ArtFilterLevel filter_level);
|
||||
GdkPixbuf *gdk_pixbuf_composite_color_simple (GdkPixbuf *src,
|
||||
GdkPixbuf *gdk_pixbuf_composite_color_simple (const GdkPixbuf *src,
|
||||
int dest_width,
|
||||
int dest_height,
|
||||
ArtFilterLevel filter_level,
|
||||
|
@ -123,6 +123,8 @@ struct _GifContext
|
||||
int frame_len;
|
||||
int frame_height;
|
||||
int frame_interlace;
|
||||
int x_offset;
|
||||
int y_offset;
|
||||
|
||||
/* Static read only */
|
||||
FILE *file;
|
||||
@ -674,8 +676,8 @@ gif_get_lzw (GifContext *context)
|
||||
(* context->prepare_func) (context->pixbuf, context->user_data);
|
||||
if (context->animation || context->frame_done_func) {
|
||||
context->frame = g_new (GdkPixbufFrame, 1);
|
||||
context->frame->x_offset = 0;
|
||||
context->frame->y_offset = 0;
|
||||
context->frame->x_offset = context->x_offset;
|
||||
context->frame->y_offset = context->y_offset;;
|
||||
context->frame->delay_time = context->gif89.delay_time;
|
||||
switch (context->gif89.disposal) {
|
||||
case 0:
|
||||
@ -934,10 +936,9 @@ gif_get_frame_info (GifContext *context)
|
||||
/* Okay, we got all the info we need. Lets record it */
|
||||
context->frame_len = LM_to_uint (buf[4], buf[5]);
|
||||
context->frame_height = LM_to_uint (buf[6], buf[7]);
|
||||
if (context->frame) {
|
||||
context->frame->x_offset = LM_to_uint (buf[0], buf[1]);
|
||||
context->frame->y_offset = LM_to_uint (buf[2], buf[3]);
|
||||
}
|
||||
context->x_offset = LM_to_uint (buf[0], buf[1]);
|
||||
context->y_offset = LM_to_uint (buf[2], buf[3]);
|
||||
|
||||
if (context->frame_height > context->height) {
|
||||
/* we don't want to resize things. So we exit */
|
||||
context->state = GIF_DONE;
|
||||
@ -1063,6 +1064,7 @@ new_context (void)
|
||||
GifContext *context;
|
||||
|
||||
context = g_new0 (GifContext, 1);
|
||||
|
||||
context->pixbuf = NULL;
|
||||
context->file = NULL;
|
||||
context->state = GIF_START;
|
||||
@ -1077,6 +1079,7 @@ new_context (void)
|
||||
context->gif89.delay_time = -1;
|
||||
context->gif89.input_flag = -1;
|
||||
context->gif89.disposal = -1;
|
||||
|
||||
return context;
|
||||
}
|
||||
/* Shared library entry point */
|
||||
|
@ -56,7 +56,7 @@ pixops_scale_nearest (art_u8 *dest_buf,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
art_boolean dest_has_alpha,
|
||||
art_u8 *src_buf,
|
||||
const art_u8 *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
@ -73,7 +73,7 @@ pixops_scale_nearest (art_u8 *dest_buf,
|
||||
#define INNER_LOOP(SRC_CHANNELS,DEST_CHANNELS) \
|
||||
for (j=0; j < (render_x1 - render_x0); j++) \
|
||||
{ \
|
||||
art_u8 *p = src + (x >> SCALE_SHIFT) * SRC_CHANNELS; \
|
||||
const art_u8 *p = src + (x >> SCALE_SHIFT) * SRC_CHANNELS; \
|
||||
\
|
||||
dest[0] = p[0]; \
|
||||
dest[1] = p[1]; \
|
||||
@ -93,7 +93,7 @@ pixops_scale_nearest (art_u8 *dest_buf,
|
||||
|
||||
for (i = 0; i < (render_y1 - render_y0); i++)
|
||||
{
|
||||
art_u8 *src = src_buf + ((i * y_step + y_step / 2) >> SCALE_SHIFT) * src_rowstride;
|
||||
const art_u8 *src = src_buf + ((i * y_step + y_step / 2) >> SCALE_SHIFT) * src_rowstride;
|
||||
art_u8 *dest = dest_buf + i * dest_rowstride;
|
||||
|
||||
x = render_x0 * x_step + x_step / 2;
|
||||
@ -119,7 +119,7 @@ pixops_scale_nearest (art_u8 *dest_buf,
|
||||
{
|
||||
for (j=0; j < (render_x1 - render_x0); j++)
|
||||
{
|
||||
art_u8 *p = src + (x >> SCALE_SHIFT) * 4;
|
||||
const art_u8 *p = src + (x >> SCALE_SHIFT) * 4;
|
||||
|
||||
*(art_u32 *)dest = *(art_u32 *)p;
|
||||
|
||||
@ -141,7 +141,7 @@ pixops_composite_nearest (art_u8 *dest_buf,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
art_boolean dest_has_alpha,
|
||||
art_u8 *src_buf,
|
||||
const art_u8 *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
@ -158,14 +158,14 @@ pixops_composite_nearest (art_u8 *dest_buf,
|
||||
|
||||
for (i = 0; i < (render_y1 - render_y0); i++)
|
||||
{
|
||||
art_u8 *src = src_buf + (((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT) * src_rowstride;
|
||||
const art_u8 *src = src_buf + (((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT) * src_rowstride;
|
||||
art_u8 *dest = dest_buf + i * dest_rowstride + render_x0 * dest_channels;
|
||||
|
||||
x = render_x0 * x_step + x_step / 2;
|
||||
|
||||
for (j=0; j < (render_x1 - render_x0); j++)
|
||||
{
|
||||
art_u8 *p = src + (x >> SCALE_SHIFT) * src_channels;
|
||||
const art_u8 *p = src + (x >> SCALE_SHIFT) * src_channels;
|
||||
unsigned int a0;
|
||||
|
||||
if (src_has_alpha)
|
||||
@ -218,7 +218,7 @@ pixops_composite_color_nearest (art_u8 *dest_buf,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
art_boolean dest_has_alpha,
|
||||
art_u8 *src_buf,
|
||||
const art_u8 *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
@ -242,7 +242,7 @@ pixops_composite_color_nearest (art_u8 *dest_buf,
|
||||
|
||||
for (i = 0; i < (render_y1 - render_y0); i++)
|
||||
{
|
||||
art_u8 *src = src_buf + (((i + render_y0) * y_step + y_step/2) >> SCALE_SHIFT) * src_rowstride;
|
||||
const art_u8 *src = src_buf + (((i + render_y0) * y_step + y_step/2) >> SCALE_SHIFT) * src_rowstride;
|
||||
art_u8 *dest = dest_buf + i * dest_rowstride;
|
||||
|
||||
x = render_x0 * x_step + x_step / 2;
|
||||
@ -270,7 +270,7 @@ pixops_composite_color_nearest (art_u8 *dest_buf,
|
||||
|
||||
for (j=0 ; j < (render_x1 - render_x0); j++)
|
||||
{
|
||||
art_u8 *p = src + (x >> SCALE_SHIFT) * src_channels;
|
||||
const art_u8 *p = src + (x >> SCALE_SHIFT) * src_channels;
|
||||
unsigned int a0;
|
||||
|
||||
if (src_has_alpha)
|
||||
@ -906,7 +906,7 @@ pixops_process (art_u8 *dest_buf,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
art_boolean dest_has_alpha,
|
||||
art_u8 *src_buf,
|
||||
const art_u8 *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
@ -962,11 +962,11 @@ pixops_process (art_u8 *dest_buf,
|
||||
for (j=0; j<filter->n_y; j++)
|
||||
{
|
||||
if (y_start < 0)
|
||||
line_bufs[j] = src_buf;
|
||||
line_bufs[j] = (art_u8 *)src_buf;
|
||||
else if (y_start < src_height)
|
||||
line_bufs[j] = src_buf + src_rowstride * y_start;
|
||||
line_bufs[j] = (art_u8 *)src_buf + src_rowstride * y_start;
|
||||
else
|
||||
line_bufs[j] = src_buf + src_rowstride * (src_height - 1);
|
||||
line_bufs[j] = (art_u8 *)src_buf + src_rowstride * (src_height - 1);
|
||||
|
||||
y_start++;
|
||||
}
|
||||
@ -1296,7 +1296,7 @@ pixops_composite_color (art_u8 *dest_buf,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
art_boolean dest_has_alpha,
|
||||
art_u8 *src_buf,
|
||||
const art_u8 *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
@ -1380,7 +1380,7 @@ pixops_composite (art_u8 *dest_buf,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
art_boolean dest_has_alpha,
|
||||
art_u8 *src_buf,
|
||||
const art_u8 *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
@ -1463,7 +1463,7 @@ pixops_scale (art_u8 *dest_buf,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
art_boolean dest_has_alpha,
|
||||
art_u8 *src_buf,
|
||||
const art_u8 *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
|
@ -14,7 +14,7 @@ void pixops_composite (art_u8 *dest_buf,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
art_u8 *src_buf,
|
||||
const art_u8 *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
@ -39,7 +39,7 @@ void pixops_composite_color (art_u8 *dest_buf,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
art_u8 *src_buf,
|
||||
const art_u8 *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
@ -68,7 +68,7 @@ void pixops_scale (art_u8 *dest_buf,
|
||||
int dest_rowstride,
|
||||
int dest_channels,
|
||||
int dest_has_alpha,
|
||||
art_u8 *src_buf,
|
||||
const art_u8 *src_buf,
|
||||
int src_width,
|
||||
int src_height,
|
||||
int src_rowstride,
|
||||
|
Loading…
Reference in New Issue
Block a user