Revision: 7228 http://playerstage.svn.sourceforge.net/playerstage/?rev=7228&view=rev Author: thjc Date: 2009-01-03 02:05:42 +0000 (Sat, 03 Jan 2009)
Log Message: ----------- merge from 2-1 of 7226: fix off by one error in playerv image flipping routine Modified Paths: -------------- code/player/trunk/utils/playerv/pv_dev_camera.c Property Changed: ---------------- code/player/trunk/ Property changes on: code/player/trunk ___________________________________________________________________ Modified: svn:mergeinfo - /code/player/branches/release-2-1-patches:6672-6673,6738,6834,6886,6905,6930,6936,6946,6951,6955,6975,6979-6981,6985,6987-6996,7087-7088,7204 /code/player/trunk:6985 + /code/player/branches/release-2-1-patches:6672-6673,6738,6834,6886,6905,6930,6936,6946,6951,6955,6975,6979-6981,6985,6987-6996,7087-7088,7204,7226 /code/player/trunk:6985 Modified: code/player/trunk/utils/playerv/pv_dev_camera.c =================================================================== --- code/player/trunk/utils/playerv/pv_dev_camera.c 2009-01-03 02:05:17 UTC (rev 7227) +++ code/player/trunk/utils/playerv/pv_dev_camera.c 2009-01-03 02:05:42 UTC (rev 7228) @@ -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