1 /* fswebcam - Small and simple webcam for *nix */
2 /*============================================================*/
3 /* Copyright (C)2005-2010 Philip Heron <phil@sanslogic.co.uk> */
5 /* This program is distributed under the terms of the GNU */
6 /* General Public License, version 2. You may use, modify, */
7 /* and redistribute it under the terms of this license. A */
8 /* copy should be included with this source. */
18 int fswc_add_image_y16(src_t *src, avgbmp_t *abitmap)
20 uint16_t *bitmap = (uint16_t *) src->img;
21 uint32_t i = src->width * src->height;
23 if(src->length < i) return(-1);
27 *(abitmap++) += *bitmap >> 8;
28 *(abitmap++) += *bitmap >> 8;
29 *(abitmap++) += *(bitmap++) >> 8;
35 int fswc_add_image_grey(src_t *src, avgbmp_t *abitmap)
37 uint8_t *bitmap = (uint8_t *) src->img;
38 uint32_t i = src->width * src->height;
40 if(src->length < i) return(-1);
44 *(abitmap++) += *bitmap;
45 *(abitmap++) += *bitmap;
46 *(abitmap++) += *(bitmap++);