→ kmap:android有一些內建的composition mode...如果沒有那個if的話 06/09 13:48
我想透過一張 rule圖當參考 做兩張圖片的blending效果
rule參考 http://ppt.cc/HggJ
圖1 http://ppt.cc/H9QT
圖2 http://ppt.cc/xhNn
blending結果 http://ppt.cc/UXnx
在JNI中用以下的算法去做點陣圖運算操作 但處理速度太慢
因此想請問 這段處理如果在opengl中做的話 要怎麼寫 謝謝
code http://codepad.org/jFg7yQn4
for(t=0;t<=255;t++){
for(i=0;i<size;i++){
tmp = alpha[i] & 0x000000FF;
if(tmp<t)
tmp = 0;
else
tmp = 255;
f = tmp/255;
pixel[i] = ((int)(f*(bg[i]&0x000000FF) +
(1-f)*(basic[i]&0x000000FF)))<<16;
pixel[i] += f*(bg[i]&0x0000FF00) + (1-f)*(basic[i]&0x0000FF00);
pixel[i] += ((int)(f*(bg[i]&0x00FF0000) +
(1-f)*(basic[i]&0x00FF0000)))>>16;
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.170.153.165