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

import "go:image"
import "go:io"

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

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

/// Encode writes the Image m to w in JPEG 4:2:0 baseline format with the given
/// options. Default parameters are used if a nil *[Options] is passed.
pub fn Encode(w: io.Writer, m: image.Image, o: Ref<Options>) -> Result<(), error>

/// A FormatError reports that the input is not a valid JPEG.
pub struct FormatError(string)

/// Options are the encoding parameters.
/// Quality ranges from 1 to 100 inclusive, higher is better.
pub struct Options {
  pub Quality: int,
}

/// Deprecated: Reader is not used by the [image/jpeg] package and should
/// not be used by others. It is kept for compatibility.
pub interface Reader {
  fn Read(mut p: Slice<uint8>) -> Partial<int, error>
  fn ReadByte() -> Result<uint8, error>
}

/// An UnsupportedError reports that the input uses a valid but unimplemented JPEG feature.
pub struct UnsupportedError(string)

/// DefaultQuality is the default quality encoding parameter.
const DefaultQuality = 75

impl FormatError {
  fn Error(self) -> string
}

impl UnsupportedError {
  fn Error(self) -> string
}
