int gray = (int)(0.114*inImage[index(i,j) + 0] + 0.587*inImage[index(i,j) + 1] + 0.299*inImage[index(i,j) + 2]); if(gray>=128){ outImage[index(i,j) + 0] = 255; // Blue outImage[index(i,j) + 1] = 255; // Green outImage[index(i,j) + 2] = 255; // Red }else{ outImage[index(i,j) + 0] = 0; // Blue outImage[index(i,j) + 1] = 0; // Green outImage[index(i,j) + 2] = 0; // Red } |
if((CSliderCtrl *)pScrollBar == &th_slider){ setupOutImage(); OnPaint(); } |
th_slider.SetRange(0, 255); th_slider.SetPos(128); |
gray>= th_slider.GetPos() |