資源簡介
C語言計算圖片直方圖,RGBA原圖像,有四個顏色通道分別為R,G,B,A。本例循環分別將三個通道的RGB值取出,返回指針
代碼片段和文件信息
#include?
#include?
/*
?*image_data?is?a?RGBA?iamge;
?*/
unsigned?int?*histogram_rgba_unorm8(void*?image_data?int?w?int?h)
{
????unsigned?char?*img?=?(unsigned?char*)image_data;
????unsigned?int?*ref_histogram_results;
????unsigned?int?*ptr;
????int?i;
????ref_histogram_results?=?(unsigned?int*)malloc(256*3*sizeof(unsigned?int));
????ptr?=?ref_histogram_results;
????memse
- 上一篇:C++ 回溯法求解羅密歐與朱麗葉的迷宮問題
- 下一篇:類似于病毒的C語言自我復制程序
評論
共有 條評論