<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                這是數字圖像處理軟件系列的第二篇。 首先來講解圖像特效部分 1、選擇本地圖片,如下圖結果: 底部狀態欄有多種特效可以選擇,有:懷舊,銳化,火焰,浮雕,柔化,光暈,紅外,淡化,灰度等效果 下面我選擇兩種特效做講解: Duang~ 效果圖如下: 下面來講解思路: ~~~ long start = System.currentTimeMillis(); ? ? ? ? ? int width = bmp.getWidth(); ? ? ? ? ? int height = bmp.getHeight(); ? ? ? ? ? Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); ? ? ? ? ? int pixColor = 0; ? ? ? ? ? int pixR = 0; ? ? ? ? ? int pixG = 0; ? ? ? ? ? int pixB = 0; ? ? ? ? ? int newR = 0; ? ? ? ? ? int newG = 0; ? ? ? ? ? int newB = 0; ? ~~~ //沒張圖片都可以轉化為RGB信息,也就是說對RGB信息修改,意味著對圖片的修改,也就是產生的一般特效(特殊的特效更為復雜)。 以下內容為核心處理: ~~~ ? int[] pixels = new int[width * height]; ? ? ? ? ? bmp.getPixels(pixels, 0, width, 0, 0, width, height); ? ? ? ? ? for (int i = 0; i < height; i++) ? ? ? ? ? { ? ? ? ? ? ? ? for (int k = 0; k < width; k++) ? ? ? ? ? ? ? { ? ? ? ? ? ? ? ? ? pixColor = pixels[width * i + k]; ? ? ? ? ? ? ? ? ? pixR = Color.red(pixColor); ? ? ? ? ? ? ? ? ? pixG = Color.green(pixColor); ? ? ? ? ? ? ? ? ? pixB = Color.blue(pixColor); ? ? ? ? ? ? ? ? ? newR = (int) (0.393 * pixR + 0.769 * pixG + 0.189 * pixB); ? ? ? ? ? ? ? ? ? newG = (int) (0.349 * pixR + 0.686 * pixG + 0.168 * pixB); ? ? ? ? ? ? ? ? ? newB = (int) (0.272 * pixR + 0.534 * pixG + 0.131 * pixB); ? ? ? ? ? ? ? ? ? int newColor = Color.argb(255, newR > 255 ? 255 : newR, newG > 255 ? 255 : newG, newB > 255 ? 255 : newB); ? ? ? ? ? ? ? ? ? pixels[width * i + k] = newColor; ? ? ? ? ? ? ? } ? ? ? ? ? } ? ~~~ //對每個像素點取RGB,并修改,修改后替換原來信息。 ~~~ ?bitmap.setPixels(pixels, 0, width, 0, 0, width, height); ? ? ? ? ? long end = System.currentTimeMillis(); ? ? ? ? ? Log.d("may", "used time="+(end - start)); ? ? ? ? ? return bitmap; ? ~~~ //最后實現,返回位圖。
                  <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>

                              哎呀哎呀视频在线观看