Documentation ¶
Overview ¶
Package jpeg contains utilities to work with the JPEG codec.
Index ¶
Constants ¶
View Source
const ( MarkerStartOfImage = 0xD8 MarkerDefineQuantizationTable = 0xDB MarkerDefineHuffmanTable = 0xC4 MarkerDefineRestartInterval = 0xDD MarkerStartOfFrame1 = 0xC0 MarkerStartOfScan = 0xDA MarkerEndOfImage = 0xD9 MarkerComment = 0xFE )
standard JPEG markers.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefineHuffmanTable ¶
DefineHuffmanTable is a DHT marker.
func (DefineHuffmanTable) Marshal ¶
func (m DefineHuffmanTable) Marshal(buf []byte) []byte
Marshal encodes the marker.
type DefineQuantizationTable ¶
type DefineQuantizationTable struct {
Tables []QuantizationTable
}
DefineQuantizationTable is a DQT marker.
func (DefineQuantizationTable) Marshal ¶
func (m DefineQuantizationTable) Marshal(buf []byte) []byte
Marshal encodes the marker.
func (*DefineQuantizationTable) Unmarshal ¶
func (m *DefineQuantizationTable) Unmarshal(buf []byte) error
Unmarshal decodes the marker.
type DefineRestartInterval ¶
type DefineRestartInterval struct {
Interval uint16
}
DefineRestartInterval is a DRI marker.
func (*DefineRestartInterval) Unmarshal ¶
func (m *DefineRestartInterval) Unmarshal(buf []byte) error
Unmarshal decodes the marker.
type QuantizationTable ¶
QuantizationTable is a DQT quantization table.
type StartOfFrame1 ¶
type StartOfFrame1 struct { Type uint8 Width int Height int QuantizationTableCount uint8 // write only }
StartOfFrame1 is a SOF1 marker.
func (StartOfFrame1) Marshal ¶
func (m StartOfFrame1) Marshal(buf []byte) []byte
Marshal encodes the marker.
func (*StartOfFrame1) Unmarshal ¶
func (m *StartOfFrame1) Unmarshal(buf []byte) error
Unmarshal decodes the marker.
type StartOfImage ¶
type StartOfImage struct{}
StartOfImage is a SOI marker.
func (StartOfImage) Marshal ¶
func (StartOfImage) Marshal(buf []byte) []byte
Marshal encodes the marker.
type StartOfScan ¶
type StartOfScan struct{}
StartOfScan is a SOS marker.
func (StartOfScan) Marshal ¶
func (StartOfScan) Marshal(buf []byte) []byte
Marshal encodes the marker.
func (StartOfScan) Unmarshal ¶
func (StartOfScan) Unmarshal(buf []byte) error
Unmarshal decodes the marker.
Click to show internal directories.
Click to hide internal directories.