Skip to content
This repository has been archived by the owner on Nov 22, 2019. It is now read-only.

Commit

Permalink
Add WideGamut colorspace #8
Browse files Browse the repository at this point in the history
  • Loading branch information
mfe committed Jan 22, 2014
1 parent a415de5 commit c8a23e8
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion utils/colorspaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.. moduleauthor:: `Marie FETIVEAU <github.com/mfe>`_
"""
from utils import colors_helper
from abc import ABCMeta, abstractmethod
import math

Expand Down Expand Up @@ -140,9 +141,37 @@ def gamma_to_lin(self, value):
value = (value / 0.9661776 - 0.04378604) * 0.18 - 0.00937677
return value


class WideGamut(AbstractColorspace):
"""WideGamut colorspace
"""
def __init__(self):
self._gamma = 2.2

def get_red_primaries(self):
return 0.7347, 0.2653

def get_green_primaries(self):
return 0.1152, 0.8264

def get_blue_primaries(self):
return 0.1566, 0.0177

def get_white_point(self):
return 0.3457, 0.3585

def lin_to_gamma(self, value):
return colors_helper.lin_to_gamma(value, self._gamma)

def gamma_to_lin(self, value):
return colors_helper.gamma_to_lin(value, self._gamma)

REC709 = Rec709()
ALEXALOGCV3 = AlexaLogCV3()
WIDEGAMUT = WideGamut()
COLORSPACES = {
'REC709': REC709,
'ALEXALOGCV3': ALEXALOGCV3
'ALEXALOGCV3': ALEXALOGCV3,
'WIDEGAMUT': WIDEGAMUT
}

0 comments on commit c8a23e8

Please sign in to comment.