Documentation ¶
Index ¶
- Constants
- Variables
- func NewByteConverter(r io.Reader) (ByteConverter, Extension, error)
- func NewFileConverter(srcPath string) (FileConverter, Extension, error)
- func ReadTtf(ttfFilePath string) (*truetype.Font, error)
- func ReadTtfFromByte(ttfFile []byte) (*truetype.Font, error)
- func SupportedExtension(extension Extension) bool
- type ByteConverter
- type Converter
- type Extension
- type FileConverter
- type FilterModel
- type Font
- type Outline
- type StringOptions
Constants ¶
View Source
const ( // DefaultFontSize used when font size is not specified in StringOptions DefaultFontSize = 100 // DefaultOutlineWidth used when outline width is not specified in StringOptions DefaultOutlineWidth = 100 )
Variables ¶
View Source
var Gif = Extension("gif")
Gif is one of the supported extension
View Source
var GrayModel = FilterModel(color.GrayModel)
GrayModel convert image to gray
View Source
var Jpeg = Extension("jpeg")
Jpeg is one of the supported extension
View Source
var Png = Extension("png")
Png is one of the supported extension
View Source
var SepiaModel = FilterModel(color.ModelFunc(sepiaModel))
SepiaModel convert image to sepia
View Source
var SupportedExtensions = []Extension{ Png, Jpeg, Gif, }
SupportedExtensions are supported extensions
View Source
var TtfFile []byte
Functions ¶
func NewByteConverter ¶ added in v1.4.0
func NewByteConverter(r io.Reader) (ByteConverter, Extension, error)
NewByteConverter create byteConverter
func NewFileConverter ¶ added in v1.2.0
func NewFileConverter(srcPath string) (FileConverter, Extension, error)
NewFileConverter create fileConverter
func ReadTtfFromByte ¶ added in v1.3.0
ReadTtfFromByte return ttf from file byte
func SupportedExtension ¶ added in v1.2.0
SupportedExtension return true, if extension is in the SupportedExtensions
Types ¶
type ByteConverter ¶ added in v1.4.0
ByteConverter interface for image edit
type Converter ¶
type Converter interface { Resize(x, y int) ResizeRatio(ratio float64) Trim(left, top, width, height int) Reverse(isHorizon bool) // Deprecated: Replace Reverse(true). ReverseX() // Deprecated: Replace Reverse(false). ReverseY() Filter(filterModel FilterModel) // Deprecated: Replace Filter(imgedit.GrayModel). Grayscale() AddString(text string, options *StringOptions) Tile(xLength, yLength int) Convert() image.Image }
Converter interface for image edit
type FileConverter ¶ added in v1.2.0
FileConverter interface for image edit
type Font ¶ added in v1.3.0
type Font struct { // TrueTypeFont use ReadTtf to get font TrueTypeFont *truetype.Font // Size default 100 Size float64 // Color default color.Black Color color.Color }
Font used in the options
Click to show internal directories.
Click to hide internal directories.