<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國際加速解決方案。 廣告
                # package draw `import "image/draw"` draw包提供了圖像合成函數。參見:[http://golang.org/doc/articles/image_draw.html](http://golang.org/doc/articles/image_draw.html) ## Index * [type Quantizer](#Quantizer) * [type Image](#Image) * [type Drawer](#Drawer) * [type Op](#Op) * [func (op Op) Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point)](#Op.Draw) * [func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op)](#Draw) * [func DrawMask(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op)](#DrawMask) ## type [Quantizer](https://github.com/golang/go/blob/master/src/image/draw/draw.go#L26 "View Source") ``` type Quantizer interface { // Quantize方法向p中最多增加cap(p)-len(p)個色彩并返回修正后的調色板 // 返回值更適合(可以更少失真的)將m轉換為一個調色板類型的圖像 Quantize(p color.Palette, m image.Image) color.Palette } ``` Quantizer接口為一個圖像生成調色板。 ## type [Image](https://github.com/golang/go/blob/master/src/image/draw/draw.go#L20 "View Source") ``` type Image interface { image.Image Set(x, y int, c color.Color) } ``` Image接口比image.Image接口多了Set方法,該方法用于修改單個像素的色彩。 ## type [Drawer](https://github.com/golang/go/blob/master/src/image/draw/draw.go#L49 "View Source") ``` type Drawer interface { // 對齊圖像dst的r.Min和src的sp點,然后將src繪制到dst上的結果來替換矩形范圍內的圖像 Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point) } ``` Drawer包含Draw方法。 ``` var FloydSteinberg Drawer = floydSteinberg{} ``` FloydSteinberg是采用Src操作并實現了Floyd-Steinberg誤差擴散算法的Drawer。 ## type [Op](https://github.com/golang/go/blob/master/src/image/draw/draw.go#L33 "View Source") ``` type Op int ``` Op是Porter-Duff合成的操作符。 ``` const ( // 源圖像透過遮罩后,覆蓋在目標圖像上(類似圖層) Over Op = iota // 源圖像透過遮罩后,替換掉目標圖像 Src ) ``` ### func (Op) [Draw](https://github.com/golang/go/blob/master/src/image/draw/draw.go#L44 "View Source") ``` func (op Op) Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point) ``` Draw方法通過使用Op參數調用包的Draw函數實現了Drawer接口。 ## func [Draw](https://github.com/golang/go/blob/master/src/image/draw/draw.go#L97 "View Source") ``` func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op) ``` Draw函數使用nil的mask參數調用DrawMask函數。 ## func [DrawMask](https://github.com/golang/go/blob/master/src/image/draw/draw.go#L103 "View Source") ``` func DrawMask(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op) ``` 對齊目標圖像dst的矩形r左上角、源圖像src的sp點、遮罩mask的mp點,根據op修改dst的r矩形區域內的內容,mask如果為nil則視為完全透明。
                  <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>

                              哎呀哎呀视频在线观看