資源簡介
C語言計(jì)算圖片直方圖,RGBA原圖像,有四個(gè)顏色通道分別為R,G,B,A。本例循環(huán)分別將三個(gè)通道的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
評論
共有 條評論