jpeg

package
v1.26.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

jpegパッケージは、JPEG画像のデコーダとエンコーダを実装します。

JPEGはITU-T T.81で定義されています:https://www.w3.org/Graphics/JPEG/itu-t81.pdf

Index

Constants

View Source
const DefaultQuality = 75

DefaultQualityは、デフォルトの品質エンコーディングパラメータです。

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader) (image.Image, error)

Decodeは、rからJPEG画像を読み取り、それを image.Image として返します。

func DecodeConfig

func DecodeConfig(r io.Reader) (image.Config, error)

DecodeConfigは、画像全体をデコードすることなく、JPEG画像のカラーモデルと寸法を返します。

func Encode

func Encode(w io.Writer, m image.Image, o *Options) error

Encodeは、与えられたオプションでJPEG 4:2:0ベースラインフォーマットでImage mをwに書き込みます。 nilの *Options が渡された場合、デフォルトのパラメータが使用されます。

Types

type FormatError

type FormatError string

FormatErrorは、入力が有効なJPEGではないことを報告します。

func (FormatError) Error

func (e FormatError) Error() string

type Options

type Options struct {
	Quality int
}

Optionsは、エンコーディングパラメータです。 Qualityは1から100までの範囲で、高いほど良いです。

type Reader deprecated

type Reader interface {
	io.ByteReader
	io.Reader
}

Deprecated: Readerは image/jpeg パッケージによって使用されておらず、 他の人によっても使用されるべきではありません。互換性のために保持されています。

type UnsupportedError

type UnsupportedError string

UnsupportedErrorは、入力が有効だが未実装のJPEG機能を使用していることを報告します。

func (UnsupportedError) Error

func (e UnsupportedError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL