Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

Commit

Permalink
Make WhiteBalance a named tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWhited committed May 24, 2015
1 parent 6f1ef2c commit 300c4b5
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions rawkit/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"""


class WhiteBalance(object):
class WhiteBalance(namedtuple('WhiteBalance',
['auto', 'camera', 'greybox', 'rgbg'])):

"""
Represents the white balance of a photo. If the camera white balance is
Expand All @@ -55,16 +56,9 @@ class WhiteBalance(object):
:rtype: :class:`WhiteBalance`
"""

def __init__(self,
auto=False,
camera=False,
greybox=None,
rgbg=None):
"""Initialize a white balance object."""
self.auto = auto
self.camera = camera
self.greybox = greybox
self.rgbg = rgbg
def __new__(cls, auto=True, camera=True, greybox=None, rgbg=None):
return super(WhiteBalance, cls).__new__(
cls, auto, camera, greybox, rgbg)


class Options(object):
Expand Down Expand Up @@ -150,8 +144,8 @@ def white_balance(self):
:default: WhiteBalance(auto=True, camera=True)
:dcraw: ``-a``
``-w``
``-A x y w h``
``-r mul0 mul1 mul2 mul3``
``-A``
``-r``
:libraw: :class:`rawkit.libraw.libraw_output_params_t.use_auto_wb`
:class:`rawkit.libraw.libraw_output_params_t.use_camera_wb`
:class:`rawkit.libraw.libraw_output_params_t.greybox`
Expand Down

0 comments on commit 300c4b5

Please sign in to comment.