github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/image/jpeg/reader.go (about) 1 // Copyright 2009 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // パッケージjpegは、JPEG画像のデコーダとエンコーダを実装します。 6 // 7 // JPEGはITU-T T.81で定義されています:https://www.w3.org/Graphics/JPEG/itu-t81.pdf。 8 package jpeg 9 10 import ( 11 "github.com/shogo82148/std/image" 12 "github.com/shogo82148/std/io" 13 ) 14 15 // FormatErrorは、入力が有効なJPEGではないことを報告します。 16 type FormatError string 17 18 func (e FormatError) Error() string 19 20 // UnsupportedErrorは、入力が有効だが未実装のJPEG機能を使用していることを報告します。 21 type UnsupportedError string 22 23 func (e UnsupportedError) Error() string 24 25 // Deprecated: Readerは [image/jpeg] パッケージによって使用されておらず、 26 // 他の人によっても使用されるべきではありません。互換性のために保持されています。 27 type Reader interface { 28 io.ByteReader 29 io.Reader 30 } 31 32 // Decodeは、rからJPEG画像を読み取り、それを [image.Image] として返します。 33 func Decode(r io.Reader) (image.Image, error) 34 35 // DecodeConfigは、画像全体をデコードすることなく、JPEG画像のカラーモデルと寸法を返します。 36 func DecodeConfig(r io.Reader) (image.Config, error)