images

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProgressiveAuto ProgressiveValue = "auto"
	QualityAuto     QualityValue     = "auto"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdjustOptions added in v0.3.0

type AdjustOptions struct {
	Brightness float64  `json:"brightness"`
	Saturation *float64 `json:"saturation,omitempty"`
	Color      *float64 `json:"color,omitempty"`
}

type ChromaSubsampling added in v0.3.1

type ChromaSubsampling string
const (
	ChromaSubsampling444  ChromaSubsampling = "4:4:4"
	ChromaSubsampling422  ChromaSubsampling = "4:2:2"
	ChromaSubsamplingAuto ChromaSubsampling = "auto"
)

type ColorProfile added in v0.3.0

type ColorProfile string
const (
	ColorProfileSRGB     ColorProfile = "srgb"
	ColorProfileRGB16    ColorProfile = "rgb16"
	ColorProfileCMYK     ColorProfile = "cmyk"
	ColorProfileKeep     ColorProfile = "keep"
	ColorProfilePreserve ColorProfile = "preserve"
)

type ContrastOptions added in v0.3.0

type ContrastOptions struct {
	Multiplier float64  `json:"multiplier"`
	Pivot      *float64 `json:"pivot,omitempty"`
}

type CropOptions added in v0.3.0

type CropOptions struct {
	X       *int    `json:"x,omitempty"`
	Y       *int    `json:"y,omitempty"`
	Width   int     `json:"width"`
	Height  int     `json:"height"`
	Gravity *string `json:"gravity,omitempty"`
}

type DuotoneOptions added in v0.3.0

type DuotoneOptions struct {
	ShadowColor    string `json:"shadowColor"`
	HighlightColor string `json:"highlightColor"`
}

type ExtendAspectRatioOptions added in v0.3.0

type ExtendAspectRatioOptions struct {
	Ratio  *float64 `json:"ratio,omitempty"`
	Width  *int     `json:"width,omitempty"`
	Height *int     `json:"height,omitempty"`
}

type ExtendOptions added in v0.3.0

type ExtendOptions struct {
	Top        *float64 `json:"top,omitempty"`
	Right      *float64 `json:"right,omitempty"`
	Bottom     *float64 `json:"bottom,omitempty"`
	Left       *float64 `json:"left,omitempty"`
	Background *string  `json:"background,omitempty"`
}

type GradientOptions added in v0.3.0

type GradientOptions struct {
	Colors  []string `json:"colors"`
	Angle   *float64 `json:"angle,omitempty"`
	Opacity *float64 `json:"opacity,omitempty"`
	Blend   *string  `json:"blend,omitempty"`
}

type GravityType

type GravityType string
const (
	GravityNorth     GravityType = "north"
	GravitySouth     GravityType = "south"
	GravityEast      GravityType = "east"
	GravityWest      GravityType = "west"
	GravityNorthEast GravityType = "northeast"
	GravityNorthWest GravityType = "northwest"
	GravitySouthEast GravityType = "southeast"
	GravitySouthWest GravityType = "southwest"
	GravityCenter    GravityType = "center"
	GravityAttention GravityType = "attention"
	GravityEntropy   GravityType = "entropy"
)

type ImgwireImage

type ImgwireImage struct {
	generated.ImageSchema
}

func ExtendImage

func ExtendImage(image generated.ImageSchema) ImgwireImage

func ExtendImagePtr

func ExtendImagePtr(image *generated.ImageSchema) *ImgwireImage

func (ImgwireImage) URL

func (image ImgwireImage) URL(options URLOptions) (string, error)

type NegateOptions added in v0.3.0

type NegateOptions struct {
	Alpha bool `json:"alpha"`
}

type NormalizeOptions added in v0.3.0

type NormalizeOptions struct {
	Lower float64 `json:"lower"`
	Upper float64 `json:"upper"`
}

type OutputFormat

type OutputFormat string
const (
	FormatAuto OutputFormat = "auto"
	FormatJPG  OutputFormat = "jpg"
	FormatJPEG OutputFormat = "jpeg"
	FormatPNG  OutputFormat = "png"
	FormatAVIF OutputFormat = "avif"
	FormatGIF  OutputFormat = "gif"
	FormatWEBP OutputFormat = "webp"
	FormatTIFF OutputFormat = "tiff"
)

type PaddingOptions added in v0.3.0

type PaddingOptions struct {
	All    *float64 `json:"all,omitempty"`
	X      *float64 `json:"x,omitempty"`
	Y      *float64 `json:"y,omitempty"`
	Top    *float64 `json:"top,omitempty"`
	Right  *float64 `json:"right,omitempty"`
	Bottom *float64 `json:"bottom,omitempty"`
	Left   *float64 `json:"left,omitempty"`
}

type ProgressiveValue added in v0.3.1

type ProgressiveValue string

type QualityValue added in v0.3.1

type QualityValue string

type ResizingAlgorithm added in v0.3.0

type ResizingAlgorithm string
const (
	ResizingAlgorithmNearest  ResizingAlgorithm = "nearest"
	ResizingAlgorithmCubic    ResizingAlgorithm = "cubic"
	ResizingAlgorithmMitchell ResizingAlgorithm = "mitchell"
	ResizingAlgorithmLanczos2 ResizingAlgorithm = "lanczos2"
	ResizingAlgorithmLanczos3 ResizingAlgorithm = "lanczos3"
)

type ResizingType

type ResizingType string
const (
	ResizingCover    ResizingType = "cover"
	ResizingContain  ResizingType = "contain"
	ResizingFill     ResizingType = "fill"
	ResizingInside   ResizingType = "inside"
	ResizingOutside  ResizingType = "outside"
	ResizingFit      ResizingType = "fit"
	ResizingFillDown ResizingType = "fill-down"
	ResizingForce    ResizingType = "force"
	ResizingAuto     ResizingType = "auto"
)

type RotateOptions added in v0.3.0

type RotateOptions struct {
	Angle      float64 `json:"angle"`
	Background *string `json:"background,omitempty"`
}

type StandardUploadResponse

type StandardUploadResponse struct {
	Image                ImgwireImage
	UploadURL            string
	AdditionalProperties map[string]interface{}
}

func ExtendStandardUploadResponse

func ExtendStandardUploadResponse(
	response *generated.StandardUploadResponseSchema,
) *StandardUploadResponse

type URLOptions

type URLOptions struct {
	Preset            *URLPreset
	Adjust            any
	Background        *string
	BackgroundAlpha   *float64
	Blur              any
	Brightness        *float64
	ChromaSubsampling *ChromaSubsampling
	ColorProfile      *ColorProfile
	Colorize          *string
	Contrast          any
	Crop              any
	DPI               *int
	DPR               *float64
	Duotone           any
	Enlarge           *bool
	Extend            any
	ExtendAspectRatio any
	Flip              any
	Format            *OutputFormat
	Gradient          any
	Gravity           any
	Height            *int
	Hue               *float64
	KeepCopyright     *bool
	Lightness         *float64
	MinHeight         *int
	MinWidth          *int
	Monochrome        any
	Negate            any
	Normalize         any
	Padding           any
	Pixelate          *float64
	Progressive       any
	Quality           any
	ResizingAlgorithm *ResizingAlgorithm
	ResizingType      *ResizingType
	Rotate            any
	Saturation        *float64
	Sharpen           any
	StripColorProfile *bool
	StripMetadata     *bool
	Watermark         any
	WatermarkPosition any
	WatermarkRotate   any
	WatermarkShadow   any
	WatermarkSize     any
	WatermarkText     any
	WatermarkURL      *string
	Width             *int
	Zoom              any
}

type URLPreset

type URLPreset string
const (
	PresetThumbnail URLPreset = "thumbnail"
	PresetSmall     URLPreset = "small"
	PresetMedium    URLPreset = "medium"
	PresetLarge     URLPreset = "large"
)

type WatermarkOptions added in v0.3.0

type WatermarkOptions struct {
	ImageID string  `json:"image_id"`
	Gravity *string `json:"gravity,omitempty"`
	X       *int    `json:"x,omitempty"`
	Y       *int    `json:"y,omitempty"`
}

type WatermarkPositionOptions added in v0.3.0

type WatermarkPositionOptions struct {
	Gravity string   `json:"gravity"`
	X       *int     `json:"x,omitempty"`
	Y       *int     `json:"y,omitempty"`
	Opacity *float64 `json:"opacity,omitempty"`
	Blend   *string  `json:"blend,omitempty"`
}

type WatermarkShadowOptions added in v0.3.0

type WatermarkShadowOptions struct {
	Color *string  `json:"color,omitempty"`
	Blur  *float64 `json:"blur,omitempty"`
	X     *int     `json:"x,omitempty"`
	Y     *int     `json:"y,omitempty"`
}

type WatermarkSizeOptions added in v0.3.0

type WatermarkSizeOptions struct {
	Width  *int     `json:"width,omitempty"`
	Height *int     `json:"height,omitempty"`
	Scale  *float64 `json:"scale,omitempty"`
}

type ZoomOptions added in v0.3.0

type ZoomOptions struct {
	Factor  float64 `json:"factor"`
	Gravity *string `json:"gravity,omitempty"`
}

Jump to

Keyboard shortcuts

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