Revision: 7226 http://playerstage.svn.sourceforge.net/playerstage/?rev=7226&view=rev Author: thjc Date: 2009-01-03 02:00:35 +0000 (Sat, 03 Jan 2009)
Log Message: ----------- fix off by one error in playerv image flipping routine Modified Paths: -------------- code/player/branches/release-2-1-patches/utils/playerv/pv_dev_camera.c Modified: code/player/branches/release-2-1-patches/utils/playerv/pv_dev_camera.c =================================================================== --- code/player/branches/release-2-1-patches/utils/playerv/pv_dev_camera.c 2009-01-03 01:45:40 UTC (rev 7225) +++ code/player/branches/release-2-1-patches/utils/playerv/pv_dev_camera.c 2009-01-03 02:00:35 UTC (rev 7226) @@ -1,4 +1,4 @@ -/* +/* * PlayerViewer * Copyright (C) Andrew Howard 2002 * @@ -46,12 +46,12 @@ char section[64]; char label[64]; camera_t *camera; - + camera = malloc(sizeof(camera_t)); camera->datatime = 0; camera->drivername = strdup(drivername); camera->proxy = playerc_camera_create(client, index); - + // Construct the menu snprintf(label, sizeof(label), "camera:%d (%s)", index, camera->drivername); camera->menu = rtk_menu_create_sub(mainwnd->device_menu, label); @@ -64,10 +64,10 @@ // Set the initial menu state rtk_menuitem_check(camera->subscribe_item, subscribe); rtk_menuitem_check(camera->stats_item, 0); - + // Default scale for drawing the image (m/pixel) camera->scale = 0.01; - + // Construct figures camera->image_init = 0; camera->allocated_size = 0; @@ -126,8 +126,8 @@ camera->img_buffer = realloc(camera->img_buffer, camera->proxy->image_count); camera->allocated_size = camera->proxy->image_count; } - - flip_image(camera->img_buffer, camera->proxy->image, camera->proxy->width, + + flip_image(camera->img_buffer, camera->proxy->image, camera->proxy->width, camera->proxy->height, camera->proxy->bpp, camera->proxy->image_count); camera_draw(camera); } @@ -188,7 +188,7 @@ camera->proxy->bpp); rtk_fig_text(camera->image_fig, PX(10), PY(camera->proxy->height + 10), 0, text); } - + } void flip_image(unsigned char *dst, unsigned char *src, int width, int height, int bpp, int usize) @@ -204,7 +204,7 @@ } row_width = width * bpp/8; - for(r = height; r >= 0; r--) { + for(r = height-1; r >= 0; r--) { memcpy(dst, src + r*row_width, row_width); dst = dst + row_width; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit