Misc doc, code refactoring to improve documentation

This commit is contained in:
Bjørn Erik Pedersen
2022-12-30 09:20:58 +01:00
parent 3c51625c71
commit e402d91ee1
47 changed files with 238 additions and 95 deletions

View File

@@ -29,6 +29,7 @@ type ImageResource interface {
type ImageResourceOps interface {
// Height returns the height of the Image.
Height() int
// Width returns the width of the Image.
Width() int
@@ -37,8 +38,17 @@ type ImageResourceOps interface {
// Use the anchor option to change the crop box anchor point.
// {{ $image := $image.Crop "600x400" }}
Crop(spec string) (ImageResource, error)
// Fill scales the image to the smallest possible size that will cover the specified dimensions in spec,
// crops the resized image to the specified dimensions using the given anchor point.
// The spec is space delimited, e.g. `200x300 TopLeft`.
Fill(spec string) (ImageResource, error)
// Fit scales down the image using the given spec.
Fit(spec string) (ImageResource, error)
// Resize resizes the image to the given spec. If one of width or height is 0, the image aspect
// ratio is preserved.
Resize(spec string) (ImageResource, error)
// Filter applies one or more filters to an Image.