Exemplo n.º 1
0
    def __init__(self, filename=None):
        """Initializes a new Raw object."""
        if filename is None:
            raise NoFileSpecified()
        self.libraw = LibRaw()
        self.data = self.libraw.libraw_init(0)
        self.libraw.libraw_open_file(self.data, filename.encode('ascii'))

        self.options = Options()

        self.image_unpacked = False
        self.thumb_unpacked = False
Exemplo n.º 2
0
    def __init__(self, filename=None):
        """Initializes a new Raw object."""
        if filename is None:
            raise NoFileSpecified()
        self.libraw = LibRaw()
        self.data = self.libraw.libraw_init(0)
        try:  # pragma: no cover
            _fname = os.fsencode(filename)
        except Exception:  # pragma: no cover
            _fname = filename
        self.libraw.libraw_open_file(self.data, _fname)

        self.options = Options()

        self.image_unpacked = False
        self.thumb_unpacked = False
Exemplo n.º 3
0
 def __init__(self, filename=None):
     """Initializes a new DarkFrame object."""
     super(DarkFrame, self).__init__(filename=filename)
     self.options = Options({
         'auto_brightness': False,
         'brightness': 1.0,
         'auto_stretch': True,
         'bps': 16,
         'gamma': (1, 1),
         'rotation': 0,
     })
     self._tmp = os.path.join(
         tempfile.gettempdir(), '{prefix}{rand}'.format(
             prefix=tempfile.gettempprefix(),
             rand=''.join(
                 random.SystemRandom().choice(string.ascii_uppercase +
                                              string.digits)
                 for _ in range(8))))
     self._filetype = None
Exemplo n.º 4
0
def options():
    return Options()