Android NDK: From Elementary to Expert Episode 24

来源:互联网 发布:电台节目录制软件 编辑:程序博客网 时间:2024/06/09 20:09

The Algorithm:

int pixelCount=info.width*info.height;for(int i=0;i<=pixelCount;i++){    int gray=pic[i];    histogram[gray]++;}int LUT[256];LUT[0]=(int)1.0*histogram[0]/pixelCount;int sum=histogram[0];for(int i=1;i<=255;++i){    sum+=histogram[i];    LUT[i]=(int)1.0*sum/pixelCount*255;}for(int i=0;i<=pixelCount-1;i++){    pixels[i]=(void)LUT[pic[i]];}

The NDK development will be stopped for a while. Because the current knowledge of my produce is almost achieve my limitation, I need to study further to continue this column.

原创粉丝点击