mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
gst/games/gstpuzzle.c: fix edges when image sizes aren't multiples of tile sizes
Original commit message from CVS: * gst/games/gstpuzzle.c: (draw_puzzle): fix edges when image sizes aren't multiples of tile sizes
This commit is contained in:
parent
6a0908113e
commit
2ed845fcad
2 changed files with 21 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-01-06 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
|
* gst/games/gstpuzzle.c: (draw_puzzle):
|
||||||
|
fix edges when image sizes aren't multiples of tile sizes
|
||||||
|
|
||||||
2005-01-06 Benjamin Otte <otte@gnome.org>
|
2005-01-06 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
* gst/games/gstpuzzle.c: (gst_puzzle_base_init):
|
* gst/games/gstpuzzle.c: (gst_puzzle_base_init):
|
||||||
|
|
|
@ -463,21 +463,25 @@ draw_puzzle (GstVideofilter * videofilter, void *destp, void *srcp)
|
||||||
height = gst_videofilter_get_input_height (videofilter);
|
height = gst_videofilter_get_input_height (videofilter);
|
||||||
gst_video_image_setup (&dest, puzzle->format, destp, width, height);
|
gst_video_image_setup (&dest, puzzle->format, destp, width, height);
|
||||||
gst_video_image_setup (&src, puzzle->format, srcp, width, height);
|
gst_video_image_setup (&src, puzzle->format, srcp, width, height);
|
||||||
if (width % puzzle->columns != 0) {
|
|
||||||
guint w = width % puzzle->columns;
|
|
||||||
|
|
||||||
gst_video_image_copy_area (&dest, width - w, 0, &src, width - w, 0, w,
|
|
||||||
height);
|
|
||||||
}
|
|
||||||
if (height % puzzle->rows != 0) {
|
|
||||||
guint h = height % puzzle->rows;
|
|
||||||
|
|
||||||
gst_video_image_copy_area (&dest, 0, height - h, &src, 0, height - h, width,
|
|
||||||
h);
|
|
||||||
}
|
|
||||||
/* use multiples of 4 here to get around drawing problems with YUV colorspaces */
|
/* use multiples of 4 here to get around drawing problems with YUV colorspaces */
|
||||||
width = (width / puzzle->columns) & ~3;
|
width = (width / puzzle->columns) & ~3;
|
||||||
height = (height / puzzle->rows) & ~3;
|
height = (height / puzzle->rows) & ~3;
|
||||||
|
if (width * puzzle->columns != gst_videofilter_get_input_width (videofilter)) {
|
||||||
|
guint w =
|
||||||
|
gst_videofilter_get_input_width (videofilter) - width * puzzle->columns;
|
||||||
|
|
||||||
|
gst_video_image_copy_area (&dest, width * puzzle->columns, 0, &src,
|
||||||
|
width * puzzle->columns, 0, w,
|
||||||
|
gst_videofilter_get_input_height (videofilter));
|
||||||
|
}
|
||||||
|
if (height * puzzle->rows != gst_videofilter_get_input_height (videofilter)) {
|
||||||
|
guint h =
|
||||||
|
gst_videofilter_get_input_width (videofilter) - height * puzzle->rows;
|
||||||
|
|
||||||
|
gst_video_image_copy_area (&dest, 0, height * puzzle->rows, &src, 0,
|
||||||
|
height * puzzle->rows, gst_videofilter_get_input_width (videofilter),
|
||||||
|
h);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < puzzle->tiles; i++) {
|
for (i = 0; i < puzzle->tiles; i++) {
|
||||||
if (!puzzle->solved && i == puzzle->position) {
|
if (!puzzle->solved && i == puzzle->position) {
|
||||||
|
|
Loading…
Reference in a new issue