?? ccdpp.cpp
字號:
/*
* Copyright 2008, writen by shikosan
* File name: ccdPP.cpp
* 零偏預處理
*/
#include "ccd.h"
#include "ccdPP.h"
#define SZ_ROW 64
#define SZ_COL 128
// change char into unsigned char by shikosan
// static char buffer[SZ_ROW][SZ_COL];
static unsigned char buffer[SZ_ROW][SZ_COL];
// change unsigned into signed
// static unsigned rowIndex, colIndex;
static int rowIndex, colIndex;
void CcdppInitialize()
{
rowIndex = -1;
colIndex = -1;
}
// This function performs zero-bias adjustment after each row read in
void CcdppCapture(void)
{
// Change char into uchar
// char bias;
unsigned char bias;
CcdCapture();
for(rowIndex=0; rowIndex<SZ_ROW; rowIndex++)
{
for(colIndex=0; colIndex<SZ_COL; colIndex++)
{
buffer[rowIndex][colIndex] = CcdPopPixel();
}
bias = (CcdPopPixel() + CcdPopPixel()) / 2;
for(colIndex=0; colIndex<SZ_COL; colIndex++)
{
buffer[rowIndex][colIndex] -= bias;
}
}
rowIndex = 0;
colIndex = 0;
}
// This function obtains image pixel
// Change char into uchar
// char CcdppPopPixel(void)
unsigned char CcdppPopPixel(void)
{
// Change char into uchar
// char pixel;
unsigned char pixel;
pixel = buffer[rowIndex][colIndex];
if( ++colIndex == SZ_COL )
{
colIndex = 0;
if( ++rowIndex == SZ_ROW )
{
colIndex = -1;
rowIndex = -1;
}
}
return pixel;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -