// Generated by Lisette bindgen
// Source: image/gif (Go stdlib)
// Go: 1.25.5
// Lisette: 0.1.14

import "go:image"
import "go:image/draw"
import "go:io"

/// Decode reads a GIF image from r and returns the first embedded
/// image as an [image.Image].
pub fn Decode(r: io.Reader) -> Result<image.Image, error>

pub fn DecodeAll(r: io.Reader) -> Result<Ref<GIF>, error>

/// DecodeConfig returns the global color model and dimensions of a GIF image
/// without decoding the entire image.
pub fn DecodeConfig(r: io.Reader) -> Result<image.Config, error>

/// Encode writes the Image m to w in GIF format.
pub fn Encode(w: io.Writer, m: image.Image, o: Ref<Options>) -> Result<(), error>

/// EncodeAll writes the images in g to w in GIF format with the
/// given loop count and delay between frames.
pub fn EncodeAll(w: io.Writer, g: Ref<GIF>) -> Result<(), error>

/// GIF represents the possibly multiple images stored in a GIF file.
pub struct GIF {
  pub Image: Slice<Option<Ref<image.Paletted>>>,
  pub Delay: Slice<int>,
  pub LoopCount: int,
  pub Disposal: Slice<uint8>,
  pub Config: image.Config,
  pub BackgroundIndex: uint8,
}

/// Options are the encoding parameters.
pub struct Options {
  pub NumColors: int,
  pub Quantizer: Option<draw.Quantizer>,
  pub Drawer: Option<draw.Drawer>,
}

/// Disposal Methods.
const DisposalBackground = 0x02

/// Disposal Methods.
const DisposalNone = 0x01

/// Disposal Methods.
const DisposalPrevious = 0x03
