Documentation
¶
Index ¶
- Constants
- func ComposeCMYK(width int, height int, requests []*ComposeImageRequest) image.Image
- func ComposeRGBA(width int, height int, requests []*ComposeImageRequest) image.Image
- func LoadFont(path string, size float64) (font.Face, error)
- func Open(path string) (image.Image, error)
- func Resize(src image.Image, width, height int) *image.NRGBA
- func ResizeToFitLongSide(src image.Image, size int) *image.NRGBA
- func Write(w io.Writer, img image.Image, ft FormatType) error
- type ComposeImageRequest
- type FormatType
- type GomaType
- type StorageService
- func (s *StorageService) AddObjectACL(ctx context.Context, bucket string, object string, entity storage.ACLEntity, ...) error
- func (s *StorageService) Read(ctx context.Context, bucket string, object string) (image.Image, *GomaType, error)
- func (s *StorageService) Write(ctx context.Context, img image.Image, ft FormatType, bucket string, ...) (rerr error)
- type TextService
- type WithStorageWriteOption
Constants ¶
View Source
const ( Default = iota PNG JPEG )
Variables ¶
This section is empty.
Functions ¶
func ComposeCMYK ¶
func ComposeCMYK(width int, height int, requests []*ComposeImageRequest) image.Image
func ComposeRGBA ¶
func ComposeRGBA(width int, height int, requests []*ComposeImageRequest) image.Image
func ResizeToFitLongSide ¶
ResizeToFitLongSide is 長辺が指定したサイズになるようにアスペクト比を維持してリサイズする
Types ¶
type ComposeImageRequest ¶
type ComposeImageRequest struct {
// contains filtered or unexported fields
}
type FormatType ¶
type FormatType int
func (FormatType) ImagingFormat ¶
func (ft FormatType) ImagingFormat() imaging.Format
type GomaType ¶
type GomaType struct { FormatType FormatType ContentType string }
type StorageService ¶
type StorageService struct {
// contains filtered or unexported fields
}
func NewStorageService ¶
func NewStorageService(ctx context.Context, gcs *storage.Client) *StorageService
func (*StorageService) AddObjectACL ¶
func (*StorageService) Write ¶
func (s *StorageService) Write(ctx context.Context, img image.Image, ft FormatType, bucket string, object string, ops ...WithStorageWriteOption) (rerr error)
type TextService ¶
type TextService struct { BaseFont font.Face EmojiFont font.Face // カラー絵文字には対応してないので、今のところ使ってない https://github.com/tenntenn/nigari/issues/1 }
func NewTextService ¶
type WithStorageWriteOption ¶
type WithStorageWriteOption func(ctx context.Context, oh *storage.ObjectHandle, w *storage.Writer) error
func WithMaxAge ¶
func WithMaxAge(age int) WithStorageWriteOption
Click to show internal directories.
Click to hide internal directories.