<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                接上之前的數字圖像處理軟件系列,其實這個APP很早之前就做完了,主要是模仿了美圖秀秀。之前因為太多事而耽誤了,現在繼續把這系列的博客寫完 那么開始正文: 這次要講的圖片特效部分是:浮雕特效 老規矩,話不多說,我們來看效果圖: ![](https://box.kancloud.cn/2016-03-28_56f8ea7b0723f.jpg) ![](https://box.kancloud.cn/2016-03-28_56f8ea7b27d61.jpg) 那么下面就開始講解: 浮雕的特性我們必須得知道,浮雕不凸顯細節但是凸顯輪廓,這是浮雕的特性,那么輪廓有哪些特點呢?我個人認為,圖片中的事物,他們的輪廓區分,基本可以靠顏色區分,也就是邊界的顏色差異,當然這個方法只是可以突出局部的輪廓,但這也足夠用了。所以和前幾篇一樣,我們需要用RGB操作,即比較RGB(凸顯邊界) ~~~ ?//浮雕 ? ? public static Bitmap ?img_fudiao(Bitmap ?bm){ ?intwidth = bm.getWidth(); ? ? int height = bm.getHeight(); ?Bitmap ?bmp= Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);? ?int color,color2; ? ? ? ?//前一個像素 ? ? ? int pixelsR,pixelsR2; ? ? ? int pixelsG,pixelsG2; ? ? ? int pixelsB,pixelsB2; ? ? ? ?//當前像素 ? ? ?? ? ? int[] pixels = new int[width * height]; bm.getPixels(pixels, 0, width, 0, 0, width, height); ? for(int i=1;i<width*height;i++) { ? color = pixels[i-1]; ? ? ? ? ? ? ? ? ?//前一個像素 ? ? ? ? ? ? ? ? ?pixelsR = Color.red(color); ? ? ? ? ? ? ? ? ?pixelsG = Color.green(color); ? ? ? ? ? ? ? ? ?pixelsB = Color.blue(color); ? ? ? ? ? ? ? ? ?//當前像素 ? ? ? ? ? ? ? ? ?color2 = pixels[i]; ? ? ? ? ? ? ? ? ?pixelsR2 = Color.red(color2); ? ? ? ? ? ? ? ? ?pixelsG2 = Color.green(color2); ? ? ? ? ? ? ? ? ?pixelsB2 = Color.blue(color2); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pixelsR = (pixelsR - pixelsR2 + 127); ? ? ? ? ? ? ? ? ?pixelsG = (pixelsG - pixelsG2 + 127); ? ? ? ? ? ? ? ? ?pixelsB = (pixelsB - pixelsB2 + 127); ? ? ? ? ? ? ? ? ?//均小于等于255 ? ? ? ? ? ? ? ? ?if(pixelsR > 255){ ? ? ? ? ? ? ? ? ? ? ?pixelsR = 255; ? ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?if(pixelsG > 255){ ? ? ? ? ? ? ? ? ? ? ?pixelsG = 255; ? ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?if(pixelsB > 255){ ? ? ? ? ? ? ? ? ? ? ?pixelsB = 255; ? ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ?pixels[i] = Color.argb(255, pixelsR, pixelsG, pixelsB); }? ? bmp.setPixels(pixels, 0, width, 0, 0, width, height); ? ? ? ?return bmp; ? ? } ~~~ 在代碼中可以看到,每次去相鄰兩項的RGB,讓他們做比較,差異色大的可以基本確定是邊界色,也就可以凸顯輪廓 最后返回結果。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看