欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

AGG第四十二課Blittinganimageoveranotherwithtransparency

問題:

成都創(chuàng)新互聯(lián)堅持“要么做到,要么別承諾”的工作理念,服務領域包括:網站制作、做網站、企業(yè)官網、英文網站、手機端網站、網站推廣等服務,滿足客戶于互聯(lián)網時代的薩嘎網站設計、移動媒體設計的需求,幫助企業(yè)找到有效的互聯(lián)網解決方案。努力成為您成熟可靠的網絡建設合作伙伴!

I've managed to blit a loaded p_w_picpath onto another through the method 

"copy_from(...)" of renderer_base.

I'd like to know how can i blit the same p_w_picpath and also specifying a color 

that will NOT overwrite the pixels of the destination p_w_picpath ( a color that 

will then result transparent ).

I complete my question by specifying that the source p_w_picpath is a BMP and 

therefore doesn't support transparency and alpha channel in the pixel 

values.

Any suggestion is appreciated

回答:

Yes, your simple question isn't actually that simple. I could add this 

functionality to copy_from, but I don't know what exactly to add. Do you 

need to make transparent only one color? Or a number of colors? Or maybe it 

should be some volume in RGB with transparency determined by the distance 

from a certain point. OK, suppose you need only one color, bu someone else 

may want to make a number of colors translucent. And so on. We need a kind 

of a general solution.

For now you can try to use a method similar to the one in 

examples/p_w_picpath_alpha.cpp

See class span_conv_brightness_alpha_rgb8 and modify it as you want.

But it's a transformer, so that, works slower than copy_from. Besides, with 

any kind of a filter (bilinear and such) the colors are not exact, so, it's 

probably makes sense to use span_p_w_picpath_filter_rgb_nn instead of 

span_p_w_picpath_filter_rgb_bilinear.

Maybe it makes sense to add some functor to copy_from(), but I have no idea 

how to do that in a general way and without losing performance. Perhaps 

there should be another function more like blend_from(). Any ideas?

答復:

Actually I've gone for a "specialized" solution, that just solves my case. 

In detail, I created a new renderer that's only suitable to copy bitmaps one 

over another with 1 transparent color.

I only have ported the "copy_from" method from renderer_base along with all 

the clipping helper methods and obejcts of your original rendere_base.

I added a method that sets a trasparency color:

    setTransaprentColor(color_type color)

    {

        ...

    }

In the "copy_from" method, I get the color of the source bitmap with the 

"pixel(x,y)" method, check it against "transparentColor" and, if equal, I 

simply skip the point with a "continue" statement.

Else, I call "copy_pixel" on the underlying rendering_buffer with the exact 

value of the source bitmap pixel.

It's evident that it can be easily extended to a generic "array" of 

transparent colors, with the cost of cycling through all of them to see if 

one of them matches the source color. Even better, one could even imagine to 

"map" some source color with some other colors (along with its own alpha 

channel) once the source RGB values are matched against the RGB values of 

the "transformer" object. I thought about it and it is not difficult to code 

such a transformer object and pass it to a renderer. But that would be too 

much for my special case and also kind of "expensive" in terms of 

performance, so I just left it "for future expansions" ;-)

文章題目:AGG第四十二課Blittinganimageoveranotherwithtransparency
本文來源:http://aaarwkj.com/article0/igjioo.html

成都網站建設公司_創(chuàng)新互聯(lián),為您提供網站制作軟件開發(fā)、網站建設、電子商務Google、網站改版

廣告

聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

外貿網站建設
久久精品久久黄色片看看| 激情五月婷婷中文字幕| 一区二区三区国产不卡| 九九六热这里只有精品| 国产高清av免费在线观看| 免费搜索国产男女视频| 国产女片xb内射在线| 剧情av一区二区在线| 亚洲一区二区三区精品乱码 | 欧美日韩精品成人大片| 中文字幕久久一区二区三区| 久久精品国产亚洲av高清观看| 热门精品一区二区三区| 亚洲成av人片又粗又长| 国产大片在线观看一区二区| 免费在线黄色生活大片| 日本高清免费黄色录像| 日本精彩视频一区二区| 大屁股白浆一区二区三区| 久久热在线观看免费高清| 国产超碰久久久久久精品| 一卡二卡精品在线免费| 亚洲精品一区av在线观看| 日本中文字幕有码专区| 亚洲一区二区日本乱码| 日本福利影院在线观看| 国语少妇高潮对白在线| 亚洲国产欧美一区三区成人| 亚洲欧美日韩国产桃色| 久久亚洲一区二区麻豆偷| 亚洲熟妇丰满多毛的大昊| 国产乱子一区二区三区| 亚洲女人淫片在线观看| 久久国内午夜福利直播| 欧美黄片在线免费观看视频| 日本不卡二区高清三区| 亚洲婷婷综合精品五月天| 91出品国产福利在线| 三级黄色片免费久久久| 久久婷婷精品国产亚洲av| 国产精品欧美久久久久久|