mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-17 16:32:11 +01:00
lib/handsum: add EncodeOptions type
This commit is contained in:
1 parent
6e91caf241
commit
263bbfabf0
2 files changed
+12
-3
No files matched your search
+2
-2
@@ -105,7 +105,7 @@ func encode(inFile *os.File) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return handsum.Encode(os.Stdout, src)
|
||||
return handsum.Encode(os.Stdout, src, nil)
|
||||
}
|
||||
|
||||
func roundtrip(inFile *os.File) error {
|
||||
@@ -114,7 +114,7 @@ func roundtrip(inFile *os.File) error {
|
||||
return err
|
||||
}
|
||||
buf := &bytes.Buffer{}
|
||||
err = handsum.Encode(buf, src)
|
||||
err = handsum.Encode(buf, src, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
+10
-1
@@ -64,8 +64,17 @@ var (
|
||||
ErrUnsupportedFileVersion = errors.New("handsum: unsupported file version")
|
||||
)
|
||||
|
||||
// EncodeOptions are optional arguments to Encode. The zero value is valid and
|
||||
// means to use the default configuration.
|
||||
//
|
||||
// There are no fields for now, but there may be some in the future.
|
||||
type EncodeOptions struct {
|
||||
}
|
||||
|
||||
// Encode writes src to w in the Handsum format.
|
||||
func Encode(w io.Writer, src image.Image) error {
|
||||
//
|
||||
// options may be nil, which means to use the default configuration.
|
||||
func Encode(w io.Writer, src image.Image, options *EncodeOptions) error {
|
||||
if (w == nil) || (src == nil) {
|
||||
return ErrBadArgument
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user