[英]Set default value for alpha in CImg
我需要將CImg(R1R2R3 G1G2G3 B1B2B3 A1A2A3等)中的RGB圖像加載為RGBA形式,並正確獲取im.data()。 目前,Cimg僅讀取RGB(R1R2R3 G1G2G3 B1B2B3)。 如何將Alpha通道添加到默認值為255的圖像?
像這樣:
img.channels(0,3); // Force 4th channel.
img.get_shared_channel(3).fill(255); // Fill it with 255.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.