mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-16 02:45:54 -07:00
feat(docs): update docs
This commit is contained in:
parent
2bc5756fad
commit
16b8301f5b
1 changed files with 78 additions and 2 deletions
80
README.md
80
README.md
|
|
@ -243,7 +243,7 @@ Determines the image type format by name (jpeg, png, webp or tiff)
|
||||||
```go
|
```go
|
||||||
func Initialize()
|
func Initialize()
|
||||||
```
|
```
|
||||||
Explicit thread-safe start of libvips. You should only call this function if you
|
Explicit thread-safe start of libvips. Only call this function if you've
|
||||||
previously shutdown libvips
|
previously shutdown libvips
|
||||||
|
|
||||||
#### func IsTypeNameSupported
|
#### func IsTypeNameSupported
|
||||||
|
|
@ -260,6 +260,13 @@ func IsTypeSupported(t ImageType) bool
|
||||||
```
|
```
|
||||||
Check if a given image type is supported
|
Check if a given image type is supported
|
||||||
|
|
||||||
|
#### func PrintMemoryStats
|
||||||
|
|
||||||
|
```go
|
||||||
|
func PrintMemoryStats()
|
||||||
|
```
|
||||||
|
Print Go memory and garbage collector stats. Useful for debugging
|
||||||
|
|
||||||
#### func Read
|
#### func Read
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
|
@ -285,7 +292,7 @@ already initialized, the function is no-op
|
||||||
```go
|
```go
|
||||||
func VipsDebug()
|
func VipsDebug()
|
||||||
```
|
```
|
||||||
Output to stdout collected data for debugging purposes
|
Output to stdout vips collected data. Useful for debugging
|
||||||
|
|
||||||
#### func Write
|
#### func Write
|
||||||
|
|
||||||
|
|
@ -309,6 +316,16 @@ const (
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### type Color
|
||||||
|
|
||||||
|
```go
|
||||||
|
type Color struct {
|
||||||
|
R, G, B uint8
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Color represents a traditional RGB color scheme
|
||||||
|
|
||||||
#### type Direction
|
#### type Direction
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
|
@ -411,6 +428,13 @@ func (i *Image) Flop() ([]byte, error)
|
||||||
```
|
```
|
||||||
Flop the image about the horizontal X axis
|
Flop the image about the horizontal X axis
|
||||||
|
|
||||||
|
#### func (*Image) Image
|
||||||
|
|
||||||
|
```go
|
||||||
|
func (i *Image) Image() []byte
|
||||||
|
```
|
||||||
|
Get image buffer
|
||||||
|
|
||||||
#### func (*Image) Metadata
|
#### func (*Image) Metadata
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
|
@ -460,6 +484,20 @@ func (i *Image) Type() string
|
||||||
```
|
```
|
||||||
Get image type format (jpeg, png, webp, tiff)
|
Get image type format (jpeg, png, webp, tiff)
|
||||||
|
|
||||||
|
#### func (*Image) Watermark
|
||||||
|
|
||||||
|
```go
|
||||||
|
func (i *Image) Watermark(w Watermark) ([]byte, error)
|
||||||
|
```
|
||||||
|
Add text as watermark on the given image
|
||||||
|
|
||||||
|
#### func (*Image) Zoom
|
||||||
|
|
||||||
|
```go
|
||||||
|
func (i *Image) Zoom(level int) ([]byte, error)
|
||||||
|
```
|
||||||
|
Zoom the image by the given factor
|
||||||
|
|
||||||
#### type ImageMetadata
|
#### type ImageMetadata
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
|
@ -531,6 +569,7 @@ Determines the image type format (jpeg, png, webp or tiff)
|
||||||
type Interpolator int
|
type Interpolator int
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
```go
|
```go
|
||||||
const (
|
const (
|
||||||
BICUBIC Interpolator = iota
|
BICUBIC Interpolator = iota
|
||||||
|
|
@ -558,18 +597,55 @@ type Options struct {
|
||||||
Extend int
|
Extend int
|
||||||
Quality int
|
Quality int
|
||||||
Compression int
|
Compression int
|
||||||
|
Zoom int
|
||||||
Crop bool
|
Crop bool
|
||||||
Enlarge bool
|
Enlarge bool
|
||||||
Embed bool
|
Embed bool
|
||||||
Flip bool
|
Flip bool
|
||||||
Flop bool
|
Flop bool
|
||||||
|
NoAutoRotate bool
|
||||||
Rotate Angle
|
Rotate Angle
|
||||||
Gravity Gravity
|
Gravity Gravity
|
||||||
|
Watermark Watermark
|
||||||
Type ImageType
|
Type ImageType
|
||||||
Interpolator Interpolator
|
Interpolator Interpolator
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### type VipsMemoryInfo
|
||||||
|
|
||||||
|
```go
|
||||||
|
type VipsMemoryInfo struct {
|
||||||
|
Memory int64
|
||||||
|
MemoryHighwater int64
|
||||||
|
Allocations int64
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### func VipsMemory
|
||||||
|
|
||||||
|
```go
|
||||||
|
func VipsMemory() VipsMemoryInfo
|
||||||
|
```
|
||||||
|
Get memory info stats from vips (cache size, memory allocs...)
|
||||||
|
|
||||||
|
#### type Watermark
|
||||||
|
|
||||||
|
```go
|
||||||
|
type Watermark struct {
|
||||||
|
Width int
|
||||||
|
DPI int
|
||||||
|
Margin int
|
||||||
|
Opacity float32
|
||||||
|
NoReplicate bool
|
||||||
|
Text string
|
||||||
|
Font string
|
||||||
|
Background Color
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Special Thanks
|
## Special Thanks
|
||||||
|
|
||||||
- [John Cupitt](https://github.com/jcupitt)
|
- [John Cupitt](https://github.com/jcupitt)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue