forked from AuroraMiddleware/gtk
Properly offset y coordinate accordining to render_y0.
2000-04-22 05:27:43 2000 Owen Taylor <otaylor@redhat.com> * gdk-pixbuf/pixops/pixops.c (pixops_scale_nearest): Properly offset y coordinate accordining to render_y0. * gdk-pixbuf/gdk-pixbuf-scale.c: Properly handle nonzero dest_x, dest_y.
This commit is contained in:
parent
16814166ba
commit
a77a3d135d
@ -1,3 +1,11 @@
|
|||||||
|
2000-04-22 05:27:43 2000 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gdk-pixbuf/pixops/pixops.c (pixops_scale_nearest): Properly
|
||||||
|
offset y coordinate accordining to render_y0.
|
||||||
|
|
||||||
|
* gdk-pixbuf/gdk-pixbuf-scale.c: Properly handle nonzero
|
||||||
|
dest_x, dest_y.
|
||||||
|
|
||||||
2000-04-22 James Henstridge <james@daa.com.au>
|
2000-04-22 James Henstridge <james@daa.com.au>
|
||||||
|
|
||||||
* gdk-pixbuf.spec.in (%files): moved %{prefix}/bin/* from the main
|
* gdk-pixbuf.spec.in (%files): moved %{prefix}/bin/* from the main
|
||||||
|
@ -68,7 +68,8 @@ gdk_pixbuf_scale (const GdkPixbuf *src,
|
|||||||
offset_y = floor (offset_y + 0.5);
|
offset_y = floor (offset_y + 0.5);
|
||||||
|
|
||||||
pixops_scale (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
pixops_scale (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||||
-offset_x, -offset_y, dest_width - offset_x, dest_height - offset_y,
|
dest_x - offset_x, dest_y - offset_y,
|
||||||
|
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||||
src->pixels, src->width, src->height,
|
src->pixels, src->width, src->height,
|
||||||
src->rowstride, src->n_channels, src->has_alpha,
|
src->rowstride, src->n_channels, src->has_alpha,
|
||||||
@ -118,7 +119,8 @@ gdk_pixbuf_composite (const GdkPixbuf *src,
|
|||||||
offset_x = floor (offset_x + 0.5);
|
offset_x = floor (offset_x + 0.5);
|
||||||
offset_y = floor (offset_y + 0.5);
|
offset_y = floor (offset_y + 0.5);
|
||||||
pixops_composite (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
pixops_composite (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||||
-offset_x, -offset_y, dest_width - offset_x, dest_height - offset_y,
|
dest_x - offset_x, dest_y - offset_y,
|
||||||
|
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||||
src->pixels, src->width, src->height,
|
src->pixels, src->width, src->height,
|
||||||
src->rowstride, src->n_channels, src->has_alpha,
|
src->rowstride, src->n_channels, src->has_alpha,
|
||||||
@ -180,7 +182,8 @@ gdk_pixbuf_composite_color (const GdkPixbuf *src,
|
|||||||
offset_y = floor (offset_y + 0.5);
|
offset_y = floor (offset_y + 0.5);
|
||||||
|
|
||||||
pixops_composite_color (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
pixops_composite_color (dest->pixels + dest_y * dest->rowstride + dest_x * dest->n_channels,
|
||||||
-offset_x, -offset_y, dest_width - offset_x, dest_height - offset_y,
|
dest_x - offset_x, dest_y - offset_y,
|
||||||
|
dest_x + dest_width - offset_x, dest_y + dest_height - offset_y,
|
||||||
dest->rowstride, dest->n_channels, dest->has_alpha,
|
dest->rowstride, dest->n_channels, dest->has_alpha,
|
||||||
src->pixels, src->width, src->height,
|
src->pixels, src->width, src->height,
|
||||||
src->rowstride, src->n_channels, src->has_alpha,
|
src->rowstride, src->n_channels, src->has_alpha,
|
||||||
|
@ -93,7 +93,7 @@ pixops_scale_nearest (guchar *dest_buf,
|
|||||||
|
|
||||||
for (i = 0; i < (render_y1 - render_y0); i++)
|
for (i = 0; i < (render_y1 - render_y0); i++)
|
||||||
{
|
{
|
||||||
const guchar *src = src_buf + ((i * y_step + y_step / 2) >> SCALE_SHIFT) * src_rowstride;
|
const guchar *src = src_buf + (((i + render_y0) * y_step + y_step / 2) >> SCALE_SHIFT) * src_rowstride;
|
||||||
guchar *dest = dest_buf + i * dest_rowstride;
|
guchar *dest = dest_buf + i * dest_rowstride;
|
||||||
|
|
||||||
x = render_x0 * x_step + x_step / 2;
|
x = render_x0 * x_step + x_step / 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user