00001 00011 //============================================================================= 00012 // Copyright © 2007 Point Grey Research, Inc. All Rights Reserved. 00013 // 00014 // This software is the confidential and proprietary information of Point 00015 // Grey Research, Inc. ("Confidential Information"). You shall not 00016 // disclose such Confidential Information and shall use it only in 00017 // accordance with the terms of the license agreement you entered into 00018 // with Point Grey Research Inc. 00019 // 00020 // PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE 00021 // SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 00022 // IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 00023 // PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES 00024 // SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING 00025 // THIS SOFTWARE OR ITS DERIVATIVES. 00026 // 00027 //============================================================================= 00028 00029 //============================================================================= 00030 // 00031 // pgr_conversions.cpp 00032 // 00033 //============================================================================= 00034 00035 //============================================================================= 00036 // System Includes 00037 //============================================================================= 00038 #include <stdio.h> 00039 #include <errno.h> 00040 #include <dc1394/dc1394.h> 00041 00042 //============================================================================= 00043 // PGR Includes 00044 //============================================================================= 00045 00046 00047 //============================================================================= 00048 // Implementation 00049 //============================================================================= 00050 00051 // taken from dc1394_deinterlace_stereo 00052 // change a 24bit rgb image (8bit/channel) into three 8bit images on top 00053 // of each other 00054 void 00055 dc1394_deinterlace_rgb( unsigned char* src, 00056 unsigned char* dest, 00057 unsigned int width, 00058 unsigned int height) 00059 { 00060 register int i = (width*height)-1; 00061 register int r = ((width*height)/3)-1; 00062 register int g = ((width*height)*2/3)-1; 00063 register int b = (width*height)-1; 00064 00065 while (i >= 0) { 00066 dest[r--] = src[i--]; 00067 dest[g--] = src[i--]; 00068 dest[b--] = src[i--]; 00069 } 00070 } 00071 00072 void 00073 dc1394_deinterlace_green( unsigned char* src, 00074 unsigned char* dest, 00075 unsigned int width, 00076 unsigned int height) 00077 { 00078 register int i = (width*height)-2; 00079 register int g = ((width*height)/3)-1; 00080 00081 while (i >= 0) { 00082 dest[g--] = src[i-=3]; 00083 } 00084 } 00085 00086 00090 /*Previous 3 lines appended automatically on Wed Jun 9 00:11:56 WEST 2010 */