imageproc

package
v1.1.58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxFileBytes = 10 << 20
	DefaultMaxPixels    = 40_000_000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Crop

type Crop struct {
	X      int
	Y      int
	Width  int
	Height int
}

type Family

type Family string
const (
	FamilyGeneric               Family = "generic"
	FamilyOpenAI                Family = "openai"
	FamilyAnthropic             Family = "anthropic"
	FamilyAnthropicBedrock      Family = "anthropic-bedrock"
	FamilyGemini                Family = "gemini"
	FamilyMistral               Family = "mistral"
	FamilyDoubaoSeed            Family = "doubao-seed"
	FamilyQwen                  Family = "qwen"
	FamilyKimi                  Family = "kimi"
	FamilyMiniMax               Family = "minimax"
	FamilyGLM                   Family = "glm"
	FamilyGrok                  Family = "grok"
	FamilyLlamaVision           Family = "llama-vision"
	FamilyGemmaVision           Family = "gemma-vision"
	FamilyMiMo                  Family = "mimo"
	FamilyAmazonNova            Family = "amazon-nova"
	FamilyDeepSeekGatewayVision Family = "deepseek-gateway-vision"
)

func InferFamily

func InferFamily(h Hint) Family

type Hint

type Hint struct {
	ProviderID   string
	ProviderName string
	Vendor       string
	API          string
	BaseURL      string
	ModelID      string
}

type Meta

type Meta struct {
	Width          int
	Height         int
	Bytes          int
	OriginalWidth  int
	OriginalHeight int
	OriginalBytes  int
	Resized        bool
	Cropped        bool
	Transcoded     bool
	Scale          float64
	Detail         string
	CropX          int
	CropY          int
	CropWidth      int
	CropHeight     int
}

type Mode

type Mode string
const (
	ModeAuto   Mode = "auto"
	ModeFast   Mode = "fast"
	ModeDetail Mode = "detail"
	ModeRaw    Mode = "raw"
)

func NormalizeMode

func NormalizeMode(s string) Mode

type Policy

type Policy struct {
	Mode           Mode
	MaxFileBytes   int64
	MaxPixels      int
	MaxLongEdge    int
	MaxOutputBytes int
	Crop           *Crop
}

func DefaultPolicy

func DefaultPolicy(mode Mode) Policy

func PolicyForHint

func PolicyForHint(h Hint, mode Mode) Policy

type Result

type Result struct {
	Data     []byte
	MimeType string
	Meta     Meta
}

func PrepareBytes

func PrepareBytes(data []byte, policy Policy) (Result, error)

func PrepareFile

func PrepareFile(path string, policy Policy) (Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL