pgr_conversions.cpp
Go to the documentation of this file.
1 
11 //=============================================================================
12 // Copyright © 2007 Point Grey Research, Inc. All Rights Reserved.
13 //
14 // This software is the confidential and proprietary information of Point
15 // Grey Research, Inc. ("Confidential Information"). You shall not
16 // disclose such Confidential Information and shall use it only in
17 // accordance with the terms of the license agreement you entered into
18 // with Point Grey Research Inc.
19 //
20 // PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
21 // SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
22 // IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23 // PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
24 // SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
25 // THIS SOFTWARE OR ITS DERIVATIVES.
26 //
27 //=============================================================================
28 
29 //=============================================================================
30 //
31 // pgr_conversions.cpp
32 //
33 //=============================================================================
34 
35 //=============================================================================
36 // System Includes
37 //=============================================================================
38 #include <stdio.h>
39 #include <errno.h>
40 #include <dc1394/dc1394.h>
41 
42 //=============================================================================
43 // PGR Includes
44 //=============================================================================
45 
46 
47 //=============================================================================
48 // Implementation
49 //=============================================================================
50 
51 // taken from dc1394_deinterlace_stereo
52 // change a 24bit rgb image (8bit/channel) into three 8bit images on top
53 // of each other
54 void
55 dc1394_deinterlace_rgb( unsigned char* src,
56  unsigned char* dest,
57  unsigned int width,
58  unsigned int height)
59 {
60  register int i = (width*height)-1;
61  register int r = ((width*height)/3)-1;
62  register int g = ((width*height)*2/3)-1;
63  register int b = (width*height)-1;
64 
65  while (i >= 0) {
66  dest[r--] = src[i--];
67  dest[g--] = src[i--];
68  dest[b--] = src[i--];
69  }
70 }
71 
72 void
73 dc1394_deinterlace_green( unsigned char* src,
74  unsigned char* dest,
75  unsigned int width,
76  unsigned int height)
77 {
78  register int i = (width*height)-2;
79  register int g = ((width*height)/3)-1;
80 
81  while (i >= 0) {
82  dest[g--] = src[i-=3];
83  }
84 }
85 
86 
90 /*Previous 3 lines appended automatically on Wed Jun 9 00:11:56 WEST 2010 */
void dc1394_deinterlace_rgb(unsigned char *src, unsigned char *dest, unsigned int width, unsigned int height)
void dc1394_deinterlace_green(unsigned char *src, unsigned char *dest, unsigned int width, unsigned int height)


xb3
Author(s): Miguel Oliveira, Tiago Talhada
autogenerated on Mon Mar 2 2015 01:33:02