cmm

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CxFObject

type CxFObject struct {
	Data []byte // XML data
}

CxFObject represents a Color Exchange Format object (PDF 2.0).

type Factory

type Factory interface {
	NewProfile(data []byte) (Profile, error)
	NewTransform(src, dst Profile, intent RenderingIntent) (Transform, error)
}

Factory creates profiles and transforms.

func NewFactory

func NewFactory() Factory

NewFactory returns a default CMM factory.

type ICCProfile

type ICCProfile struct {
	// contains filtered or unexported fields
}

ICCProfile implements Profile for ICC data.

func NewICCProfile

func NewICCProfile(data []byte) (*ICCProfile, error)

NewICCProfile creates a new ICCProfile from bytes.

func (*ICCProfile) Class

func (p *ICCProfile) Class() string

func (*ICCProfile) ColorSpace

func (p *ICCProfile) ColorSpace() string

func (*ICCProfile) Data

func (p *ICCProfile) Data() []byte

func (*ICCProfile) GetTag

func (p *ICCProfile) GetTag(sig string) ([]byte, bool)

GetTag returns the raw data for a tag if it exists.

func (*ICCProfile) Name

func (p *ICCProfile) Name() string

func (*ICCProfile) ReadCurveTag

func (p *ICCProfile) ReadCurveTag(sig string) (float64, error)

ReadCurveTag reads a curveType or parametricCurveType tag. Returns a gamma value (if simple gamma) or error if complex/LUT.

func (*ICCProfile) ReadXYZTag

func (p *ICCProfile) ReadXYZTag(sig string) ([3]float64, error)

ReadXYZTag reads an XYZType tag (array of 3 XYZ numbers).

type Profile

type Profile interface {
	// Name returns the profile description or name.
	Name() string
	// ColorSpace returns the color space signature (e.g., "RGB ", "CMYK").
	ColorSpace() string
	// Class returns the profile class (e.g., "mntr", "prtr").
	Class() string
	// Data returns the raw profile bytes.
	Data() []byte
}

Profile represents a color profile (e.g., ICC).

type RenderingIntent

type RenderingIntent int

RenderingIntent specifies the rendering intent for color conversion.

const (
	IntentPerceptual RenderingIntent = iota
	IntentRelativeColorimetric
	IntentSaturation
	IntentAbsoluteColorimetric
)

type SpectrallyDefinedColor

type SpectrallyDefinedColor struct {
	Name string
	CxF  *CxFObject
}

SpectrallyDefinedColor represents a color defined by spectral data.

type Transform

type Transform interface {
	// Convert transforms a color value from source to destination space.
	Convert(src []float64) ([]float64, error)
}

Transform represents a color transformation between two profiles.

Jump to

Keyboard shortcuts

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