meta

package
v1.8.9 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package meta and its subpackages provide support for embedded image metadata.

Index

Constants

This section is empty.

Variables

View Source
var DISPLAY_P3 = CodingIndependentCodePoints{12, 13, 0, 1, true}
View Source
var SRGB = CodingIndependentCodePoints{1, 13, 0, 1, true}

Functions

This section is empty.

Types

type CodingIndependentCodePoints added in v1.8.2

type CodingIndependentCodePoints struct {
	ColorPrimaries, TransferCharacteristics, MatrixCoefficients, VideoFullRange uint8
	IsSet                                                                       bool
}

func (CodingIndependentCodePoints) IsSRGB added in v1.8.2

func (c CodingIndependentCodePoints) IsSRGB() bool

func (CodingIndependentCodePoints) PipelineTo added in v1.8.2

func (CodingIndependentCodePoints) PipelineToSRGB added in v1.8.2

func (c CodingIndependentCodePoints) PipelineToSRGB() *icc.Pipeline

func (CodingIndependentCodePoints) String added in v1.8.2

func (CodingIndependentCodePoints) VideoFullRangeIsValid added in v1.8.2

func (c CodingIndependentCodePoints) VideoFullRangeIsValid() bool

type Data

type Data struct {
	Format              types.Format
	PixelWidth          uint32
	PixelHeight         uint32
	BitsPerComponent    uint32
	HasFrames           bool
	NumFrames, NumPlays int
	CICP                CodingIndependentCodePoints
	// contains filtered or unexported fields
}

Data represents the metadata for an image.

func (*Data) Clone added in v1.8.4

func (s *Data) Clone() *Data

func (*Data) Exif added in v1.8.2

func (md *Data) Exif() (*exif.Exif, error)

Returns an extracted EXIF metadata object from this metadata.

An error is returned if the EXIF profile could not be correctly parsed.

If no EXIF data was found, nil is returned without an error.

func (*Data) ExifData

func (md *Data) ExifData() []byte

func (*Data) ICCProfile

func (md *Data) ICCProfile() (*icc.Profile, error)

ICCProfile returns an extracted ICC profile from this metadata.

An error is returned if the ICC profile could not be correctly parsed.

If no profile data was found, nil is returned without an error.

func (*Data) ICCProfileData

func (md *Data) ICCProfileData() ([]byte, error)

ICCProfileData returns the raw ICC profile data from this metadata.

An error is returned if the ICC profile could not be correctly extracted from the image.

If no profile data was found, nil is returned without an error.

func (*Data) IsSRGB added in v1.8.6

func (s *Data) IsSRGB() bool

func (*Data) SetExif added in v1.8.2

func (md *Data) SetExif(e *exif.Exif)

func (*Data) SetExifData added in v1.8.2

func (md *Data) SetExifData(data []byte)

func (*Data) SetExifError added in v1.8.2

func (md *Data) SetExifError(e error)

func (*Data) SetICCProfileData

func (md *Data) SetICCProfileData(data []byte)

func (*Data) SetICCProfileError

func (md *Data) SetICCProfileError(err error)

type Primaries added in v1.8.2

type Primaries struct {
	Name  string
	Red   XY
	Green XY
	Blue  XY
	White XY
}

ColorSpace defines the primaries and white point of a color space.

func (*Primaries) CalculateRGBtoXYZMatrix added in v1.8.2

func (cs *Primaries) CalculateRGBtoXYZMatrix() icc.Matrix3

CalculateRGBtoXYZMatrix computes the matrix to convert from a linear RGB color space to CIE XYZ.

type TransferFunction added in v1.8.2

type TransferFunction struct {
	ID   int
	Name string
	OETF func(float64) float64 // To non-linear
	EOTF func(float64) float64 // To linear
}

TransferFunction defines an Opto-Electronic Transfer Function (OETF) and its inverse Electro-Optical Transfer Function (EOTF).

type WellKnownPrimaries added in v1.8.2

type WellKnownPrimaries int

type XY added in v1.8.2

type XY struct {
	X, Y float64
}

XY holds CIE xy chromaticity coordinates.

Directories

Path Synopsis
Package autometa provides support for embedded metadata and automatic detection of image formats.
Package autometa provides support for embedded metadata and automatic detection of image formats.
Package icc provides support for working with ICC colour profile data.
Package icc provides support for working with ICC colour profile data.
Package jpegmeta provides support for working with embedded JPEG metadata.
Package jpegmeta provides support for working with embedded JPEG metadata.
Package pngmeta provides support for working with embedded PNG metadata.
Package pngmeta provides support for working with embedded PNG metadata.
Package webpmeta provides support for working with embedded WebP metadata.
Package webpmeta provides support for working with embedded WebP metadata.

Jump to

Keyboard shortcuts

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