-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathimage.go
31 lines (26 loc) · 776 Bytes
/
image.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package mergi
import (
"image"
)
// Importer uses to plug any kind of image.Image importer
type Importer interface {
Import() (image.Image, error)
}
// Exporter uses to plug any kind of image.Image exporter
type Exporter interface {
Export() error
}
// Import uses to import image.Image from different sources
// Multiple io implementation can be find in io pkg
//
// for more Import usages https://github.com/noelyahan/mergi/examples
func Import(importer Importer) (image.Image, error) {
return importer.Import()
}
// Export uses to export output do different sources
// Multiple exporter implementation can be find in io pkg
//
// for more Import usages https://github.com/noelyahan/mergi/examples
func Export(exporter Exporter) error {
return exporter.Export()
}