github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/image/gif/writer.go (about) 1 // Copyright 2013 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package gif 6 7 import ( 8 "github.com/shogo82148/std/image" 9 "github.com/shogo82148/std/image/draw" 10 "github.com/shogo82148/std/io" 11 ) 12 13 // Optionsは、エンコーディングパラメータです。 14 type Options struct { 15 // NumColorsは、画像で使用される色の最大数です。 16 // 1から256までの範囲です。 17 NumColors int 18 19 // Quantizerは、NumColorsのサイズを持つパレットを生成するために使用されます。 20 // Quantizerがnilの場合、代わりにpalette.Plan9が使用されます。 21 Quantizer draw.Quantizer 22 23 // Drawerは、ソース画像を所望のパレットに変換するために使用されます。 24 // Drawerがnilの場合、代わりにdraw.FloydSteinbergが使用されます。 25 Drawer draw.Drawer 26 } 27 28 // EncodeAllは、指定されたループカウントとフレーム間の遅延で、 29 // GIF形式のwにgの画像を書き込みます。 30 func EncodeAll(w io.Writer, g *GIF) error 31 32 // Encodeは、GIF形式で画像mをwに書き込みます。 33 func Encode(w io.Writer, m image.Image, o *Options) error