void VIS5MPColSupWBL::saveColSupWBLInitSetting(){ long currValue, lCaps; // reset global struct initCtrlSetting.WhiteBalance = 0; initCtrlSetting.WhiteBalanceComponentRed = 0; initCtrlSetting.WhiteBalanceComponentBlue = 0; initCtrlSetting.colsupGain = 0; initCtrlSetting.colsupAGCStart = 0; initCtrlSetting.colsupAGCEnd = 0; initCtrlSetting.collightGain = 0; initCtrlSetting.coledgSupp = 0; // get current Value currValue = 0; getStandardControlPropertyCurrentValue(KSPROPERTY_VIDEOPROCAMP_WHITEBALANCE, &currValue, &lCaps); initCtrlSetting.WhiteBalance = currValue; getWhiteBalanceComponent(&initCtrlSetting.WhiteBalanceComponentRed, &initCtrlSetting.WhiteBalanceComponentBlue); initCtrlSetting.WhiteBalanceComponentBlueCur = initCtrlSetting.WhiteBalanceComponentBlue; initCtrlSetting.WhiteBalanceComponentRedCur = initCtrlSetting.WhiteBalanceComponentRed; getRegVal(REG_COLSUPGAIN, &initCtrlSetting.colsupGain); getRegVal(REG_COLSUPAGCSTART, &initCtrlSetting.colsupAGCStart); getRegVal(REG_COLSUPAGCEND, &initCtrlSetting.colsupAGCEnd); getRegVal(REG_COLLIGHTGAIN, &initCtrlSetting.collightGain); getRegVal(REG_COLEDGESUP, &initCtrlSetting.coledgSupp); }
void LSM330DLC::getMotion6(int* ax, int* ay, int* az, int* gx, int* gy, int* gz) { uint8_t temp[12]; uint8_t error = 0; if (getRegVal( accAddr, 0xA8, &temp[0]) != 6) error++; if (getRegVal(gyroAddr, 0xA8, &temp[6]) != 6) error++; if (error == 0) { ax[0] = (int16_t)temp[0] | ((int16_t)temp[1] << 8); ay[0] = (int16_t)temp[2] | ((int16_t)temp[3] << 8); az[0] = (int16_t)temp[4] | ((int16_t)temp[5] << 8); gx[0] = (int16_t)temp[6] | ((int16_t)temp[7] << 8); gy[0] = (int16_t)temp[8] | ((int16_t)temp[9] << 8); gz[0] = (int16_t)temp[10] | ((int16_t)temp[11] << 8); ax[0] = -(int16_t)ax[0]; ay[0] = (int16_t)ay[0]; az[0] = -(int16_t)az[0]; gx[0] = -(int16_t)gx[0]; gy[0] = (int16_t)gy[0]; gz[0] = -(int16_t)gz[0]; } else { ax[0] = 0; ay[0] = 0; az[0] = 0; gx[0] = 0; gy[0] = 0; gz[0] = 0; } }
static void initialiseRegistre(Processeur* proc, struct x86_thread_state state){ setRegVal(_CS, state.uts.ts64.__cs); setRegVal(_FS, state.uts.ts64.__fs); setRegVal(_GS, state.uts.ts64.__gs); setRegVal(_R10, state.uts.ts64.__r10); setRegVal(_R11, state.uts.ts64.__r11); setRegVal(_R12, state.uts.ts64.__r12); setRegVal(_R13, state.uts.ts64.__r13); setRegVal(_R14, state.uts.ts64.__r14); setRegVal(_R15, state.uts.ts64.__r15); setRegVal(_R8, state.uts.ts64.__r8); setRegVal(_R9, state.uts.ts64.__r9); setRegVal(_RAX, state.uts.ts64.__rax); setRegVal(_RBP, state.uts.ts64.__rbp); setRegVal(_RBX, state.uts.ts64.__rbx); setRegVal(_RCX, state.uts.ts64.__rcx); setRegVal(_RDI, state.uts.ts64.__rdi); setRegVal(_RDX, state.uts.ts64.__rdx); setRegVal(_RFLAGS, state.uts.ts64.__rflags); setRegVal(_RIP, state.uts.ts64.__rip); setRegVal(_RSI, state.uts.ts64.__rsi); setRegVal(_RSP, state.uts.ts64.__rsp); initialiserFlags(proc, getRegVal(_RFLAGS)); }
int effect(ImageData *img,ImageData *outimg) { int val; int x,y; int xx,yy; int hh; int endn; int vv, vr, vg, vb; int ave, rr, gg,bb; Pixel col,ncol; Pixel ans; int *sobel; int sadr; int rate,nn,i; int x1,y1,x2,y2; x1=0; y1=0; x2=img->width-1; y2=img->height-1; setRegInfo(); nn=2; for(y=y1;y<=y2;y++){ for(x=x1;x<=x2;x++){ rr=gg=bb=0; sadr=0; for(yy=(-nn);yy<=nn;yy++){ for(xx=(-nn);xx<=nn;xx++){ val = getPixel(img,x+xx,y+yy,&ncol); imgR[sadr]=ncol.r; imgG[sadr]=ncol.g; imgB[sadr]=ncol.b; sadr++; } } vr=vg=vb=1000; for(i=0;i<=8;i++){ vv=getRegVal(imgR,i,&ave); if(vr>vv){ vr=vv; rr=ave; } vv=getRegVal(imgG,i,&ave); if(vg>vv){ vg=vv; gg=ave; } vv=getRegVal(imgB,i,&ave); if(vb>vv){ vb=vv; bb=ave; } } vv=getRegVal(imgB,i,&ave); if(vb>vv){ vb=vv; bb=ave; } } ans.r = rr; ans.g = gg; ans.b = bb; setPixel(outimg,x,y,&ans); } }
bool rmg146_getraw(void *h, int *raw) { struct rmg146 *l = (struct rmg146 *)h; unsigned char temp[18]; short word[9]; int error = 0; if (l->accAddr != 0xFF && getRegVal( l->accAddr, 0x28, &temp[0]) != 6) { error++; } else if (l->gyroAddr != 0xFF && getRegVal(l->gyroAddr, 0x1D, &temp[6]) != 6) { error++; } else if (l->magnAddr != 0xFF && getRegVal(l->magnAddr, 0x03, &temp[12]) != 6) { error++; } if (error == 0) { if (l->accAddr != 0xFF) { word[0] = (short)temp[0] | ((short)temp[1] << 8); word[1] = (short)temp[2] | ((short)temp[3] << 8); word[2] = (short)temp[4] | ((short)temp[5] << 8); raw[0] = (int)word[0]; raw[1] = (int)word[1]; raw[2] = (int)word[2]; } else { raw[0] = 0; raw[1] = 0; raw[2] = 0; } if (l->gyroAddr != 0xFF) { word[3] = (short)temp[7] | ((short)temp[6] << 8); word[4] = (short)temp[9] | ((short)temp[8] << 8); word[5] = (short)temp[11] | ((short)temp[10] << 8); raw[3] = (int)word[3]; raw[4] = (int)word[4]; raw[5] = (int)word[5]; } else { raw[3] = 0; raw[4] = 0; raw[5] = 0; } if (l->magnAddr != 0xFF) { word[6] = (short)temp[13] | ((short)temp[12] << 8); word[7] = (short)temp[15] | ((short)temp[14] << 8); word[8] = (short)temp[17] | ((short)temp[16] << 8); raw[6] = (int)word[6]; raw[7] = (int)word[7]; raw[8] = (int)word[8]; } else { raw[6] = 0; raw[7] = 0; raw[8] = 0; } return true; } raw[0] = 0; raw[1] = 0; raw[2] = 0; raw[3] = 0; raw[4] = 0; raw[5] = 0; raw[6] = 0; raw[7] = 0; raw[8] = 0; return false; }