SyntekUSBVideoCamera
Macros | Functions | Variables
stk11xx-bayer.c File Reference

Driver for Syntek USB video camera. More...

#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/kref.h>
#include <linux/usb.h>
#include <media/v4l2-common.h>
#include "stk11xx.h"

Go to the source code of this file.

Macros

#define MAX(a, b)   ((a)>(b)?(a):(b))
 
#define MIN(a, b)   ((a)<(b)?(a):(b))
 
#define CLIP(a, low, high)   MAX((low),MIN((high),(a)))
 

Functions

void stk11xx_b2rgb24 (uint8_t *bayer, uint8_t *rgb, struct stk11xx_coord *image, struct stk11xx_coord *view, const int hflip, const int vflip, const int factor)
 This function permits to convert an image from bayer to RGB24. More...
 
void stk11xx_b2rgb32 (uint8_t *bayer, uint8_t *rgb, struct stk11xx_coord *image, struct stk11xx_coord *view, const int hflip, const int vflip, const int factor)
 This function permits to convert an image from bayer to RGB32. More...
 
void stk11xx_b2bgr24 (uint8_t *bayer, uint8_t *bgr, struct stk11xx_coord *image, struct stk11xx_coord *view, const int hflip, const int vflip, const int factor)
 This function permits to convert an image from bayer to BGR24. More...
 
void stk11xx_b2bgr32 (uint8_t *bayer, uint8_t *bgr, struct stk11xx_coord *image, struct stk11xx_coord *view, const int hflip, const int vflip, const int factor)
 This function permits to convert an image from bayer to BGR32. More...
 
void stk11xx_b2uyvy (uint8_t *bayer, uint8_t *yuv, struct stk11xx_coord *image, struct stk11xx_coord *view, const int hflip, const int vflip, const int factor)
 This function permits to convert an image from bayer to YUV (UYVY) More...
 
void stk11xx_b2yuyv (uint8_t *bayer, uint8_t *yuv, struct stk11xx_coord *image, struct stk11xx_coord *view, const int hflip, const int vflip, const int factor)
 This function permits to convert an image from bayer to YUV (YUYV) More...
 
void stk11xx_correct_brightness (uint8_t *img, const int width, const int height, const int brightness, int palette, int depth)
 Correct the brightness of an image. More...
 
int stk11xx_decompress (struct usb_stk11xx *dev)
 Decompress a frame. More...
 

Variables

static signed short stk11xx_yuv_interp [256][8]
 

Detailed Description

Driver for Syntek USB video camera.

Author
Martin ROOS
Date
2006-01-14
Version
v2.0.x
Note
Copyright (C) Nicolas VIVIEN
Licences

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

SubVersion
Date
Revision
Author
HeadURL

Definition in file stk11xx-bayer.c.

Function Documentation

◆ stk11xx_b2bgr24()

void stk11xx_b2bgr24 ( uint8_t *  bayer,
uint8_t *  bgr,
struct stk11xx_coord image,
struct stk11xx_coord view,
const int  hflip,
const int  vflip,
const int  factor 
)

This function permits to convert an image from bayer to BGR24.

Parameters
bayerBuffer with the bayer data
imageSize of image
viewSize of view
hflipHorizontal flip
vflipVertical flip
factorFactor of redimensioning
Return values
bgrBuffer with the BGR data

Definition at line 660 of file stk11xx-bayer.c.

References hflip, vflip, stk11xx_coord::x, and stk11xx_coord::y.

◆ stk11xx_b2bgr32()

void stk11xx_b2bgr32 ( uint8_t *  bayer,
uint8_t *  bgr,
struct stk11xx_coord image,
struct stk11xx_coord view,
const int  hflip,
const int  vflip,
const int  factor 
)

This function permits to convert an image from bayer to BGR32.

Parameters
bayerBuffer with the bayer data
imageSize of image
viewSize of view
hflipHorizontal flip
vflipVertical flip
factorFactor of redimensioning
Return values
bgrBuffer with the BGR data

Definition at line 799 of file stk11xx-bayer.c.

References hflip, vflip, stk11xx_coord::x, and stk11xx_coord::y.

◆ stk11xx_b2rgb24()

void stk11xx_b2rgb24 ( uint8_t *  bayer,
uint8_t *  rgb,
struct stk11xx_coord image,
struct stk11xx_coord view,
const int  hflip,
const int  vflip,
const int  factor 
)

This function permits to convert an image from bayer to RGB24.

Parameters
bayerBuffer with the bayer data
imageSize of image
viewSize of view
hflipHorizontal flip
vflipVertical flip
factorFactor of redimensioning
Return values
rgbBuffer with the RGB data

Definition at line 374 of file stk11xx-bayer.c.

References hflip, vflip, stk11xx_coord::x, and stk11xx_coord::y.

◆ stk11xx_b2rgb32()

void stk11xx_b2rgb32 ( uint8_t *  bayer,
uint8_t *  rgb,
struct stk11xx_coord image,
struct stk11xx_coord view,
const int  hflip,
const int  vflip,
const int  factor 
)

This function permits to convert an image from bayer to RGB32.

Parameters
bayerBuffer with the bayer data
imageSize of image
viewSize of view
hflipHorizontal flip
vflipVertical flip
factorFactor of redimensioning
Return values
rgbBuffer with the RGB data

Definition at line 513 of file stk11xx-bayer.c.

References hflip, vflip, stk11xx_coord::x, and stk11xx_coord::y.

◆ stk11xx_b2uyvy()

void stk11xx_b2uyvy ( uint8_t *  bayer,
uint8_t *  yuv,
struct stk11xx_coord image,
struct stk11xx_coord view,
const int  hflip,
const int  vflip,
const int  factor 
)

This function permits to convert an image from bayer to YUV (UYVY)

Parameters
bayerBuffer with the bayer data
imageSize of image
viewSize of view
hflipHorizontal flip
vflipVertical flip
factorFactor of redimensioning
Return values
yuvBuffer with the YUV data

Definition at line 946 of file stk11xx-bayer.c.

References hflip, vflip, stk11xx_coord::x, and stk11xx_coord::y.

◆ stk11xx_b2yuyv()

void stk11xx_b2yuyv ( uint8_t *  bayer,
uint8_t *  yuv,
struct stk11xx_coord image,
struct stk11xx_coord view,
const int  hflip,
const int  vflip,
const int  factor 
)

This function permits to convert an image from bayer to YUV (YUYV)

Parameters
bayerBuffer with the bayer data
imageSize of image
viewSize of view
hflipHorizontal flip
vflipVertical flip
factorFactor of redimensioning
Return values
yuvBuffer with the YUV data

Definition at line 1125 of file stk11xx-bayer.c.

References hflip, vflip, stk11xx_coord::x, and stk11xx_coord::y.

◆ stk11xx_correct_brightness()

void stk11xx_correct_brightness ( uint8_t *  img,
const int  width,
const int  height,
const int  brightness,
int  palette,
int  depth 
)

Correct the brightness of an image.

This function permits to correct the brightness of an image.

Parameters
imgBuffer to RGB/YUV data
widthWidth of frame
heightHeight of frame
brightnessBrightness correction
depthColor depth
Return values
rgbBuffer to RGB/YUV data

Definition at line 270 of file stk11xx-bayer.c.

◆ stk11xx_decompress()

int stk11xx_decompress ( struct usb_stk11xx dev)

Decompress a frame.

This function permits to decompress a frame from the video stream.

Parameters
devDevice structure
Returns
0 if all is OK

Definition at line 155 of file stk11xx-bayer.c.

References stk11xx_image_buf::offset.

Referenced by stk11xx_handle_frame().