dng

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT-0 Imports: 6 Imported by: 0

Documentation

Overview

Package dng provides support for reading and writing DNG files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDCPProfileName

func GetDCPProfileName(path string) (string, error)

GetDCPProfileName extracts the profile name from a DCP file.

func GetTemperatureFromXY

func GetTemperatureFromXY(x, y float64) (temperature, tint int)

GetTemperatureFromXY computes a correlated color temperature and offset (tint) from x-y chromaticity coordinates.

This can be used to convert an AsShotWhiteXY DNG tag to a temperature and tint.

func GetXYFromTemperature

func GetXYFromTemperature(temperature, tint int) (x, y float64)

GetXYFromTemperature computes the x-y chromaticity coordinates of a correlated color temperature and offset (tint).

This can be used to convert a temperature and tint to an AsShotWhiteXY DNG tag.

Types

type CameraProfile

type CameraProfile struct {
	CalibrationIlluminant1, CalibrationIlluminant2 LightSource // Light sources for up to two calibrations.
	ColorMatrix1, ColorMatrix2                     []float64   // Color matrices for up to two calibrations.
	CameraCalibration1, CameraCalibration2         []float64   // Individual camera calibrations.
	AnalogBalance                                  []float64   // Amount by which each channel has already been scaled.
	// contains filtered or unexported fields
}

CameraProfile encapsulates DNG camera color profile and calibration data.

This data can be extracted from the same named DNG tags.

func (*CameraProfile) GetTemperature

func (p *CameraProfile) GetTemperature(neutral []float64) (temperature, tint int, err error)

GetTemperature computes a correlated color temperature and offset (tint) from camera color space coordinates of a perfectly neutral color.

This can be used to convert an AsShotNeutral DNG tag to a temperature and tint.

func (*CameraProfile) Init

func (p *CameraProfile) Init() error

Init initializes the profile.

Init is called implicitly when necessary, but changes to profile fields made after Init is called are ignored until Init is called explicitly again.

type LightSource

type LightSource uint16

LightSource represents a kind of light source.

const (
	LSUnknown LightSource = iota
	LSDaylight
	LSFluorescent
	LSTungsten
	LSFlash

	LSFineWeather
	LSCloudyWeather
	LSShade
	LSDaylightFluorescent  // D  5700 - 7100K
	LSDayWhiteFluorescent  // N  4600 - 5500K
	LSCoolWhiteFluorescent // W  3800 - 4500K
	LSWhiteFluorescent     // WW 3250 - 3800K
	LSWarmWhiteFluorescent // L  2600 - 3250K
	LSStandardLightA
	LSStandardLightB
	LSStandardLightC
	LSD55
	LSD65
	LSD75
	LSD50
	LSISOStudioTungsten

	LSOther LightSource = 255
)

Values for the LightSource EXIF tag.

func (LightSource) Temperature

func (ls LightSource) Temperature() float64

Temperature gets the color temperature of the illuminant.

Jump to

Keyboard shortcuts

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