package gif // https://www.w3.org/Graphics/GIF/spec-gif87.txt // https://en.wikipedia.org/wiki/GIF // https://web.archive.org/web/20160304075538/http://qalle.net/gif89a.php#graphiccontrolextension // TODO: local color map // TODO: bit depth done correct? import ( "bytes" "github.com/wader/fq/format" "github.com/wader/fq/pkg/decode" "github.com/wader/fq/pkg/interp" "github.com/wader/fq/pkg/scalar" ) func init() { interp.RegisterFormat(decode.Format{ Name: format.GIF, Description: "Graphics Interchange Format", Groups: []string{format.PROBE, format.IMAGE}, DecodeFn: gifDecode, }) } const ( extensionPlainText = 0x01 extensionGraphicalControl = 0xf9 extensionComment = 0xfe extensionApplication = 0xff ) var extensionNames = scalar.UToSymStr{ extensionPlainText: "PlainText", extensionGraphicalControl: "GraphicalControl", extensionComment: "Comment", extensionApplication: "Application", } func fieldColorMap(d *decode.D, name string, bitDepth int) { d.FieldArray(name, func(d *decode.D) { for i := 0; i < 1<