# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info

if _swig_python_version_info >= (2, 7, 0):
    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_kfbReader')).lstrip('.')
        try:
            return importlib.import_module(mname)
            # return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_kfbReader')


    _kfbReader = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_kfbReader', [dirname(__file__)])
        except ImportError:
            import _kfbReader
            return _kfbReader
        try:
            _mod = imp.load_module('_kfbReader', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod


    _kfbReader = swig_import_helper()
    del swig_import_helper
else:
    import _kfbReader
del _swig_python_version_info

try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

import builtins as __builtin__


def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


try:
    _object = object
    _newclass = 1
except __builtin__.Exception:
    class _object:
        pass


    _newclass = 0
import os
import numpy as np


class reader(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, reader, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, reader, name)
    __repr__ = _swig_repr

    def __init__(self):
        curdir = os.path.abspath(os.curdir)
        os.chdir(os.path.dirname(__file__))
        this = _kfbReader.new_reader()
        os.chdir(curdir)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

    __swig_destroy__ = _kfbReader.delete_reader
    __del__ = lambda self: None

    def ReadInfo(self, kfbPath, scale=0, readAll=False):
        return _kfbReader.reader_ReadInfo(self, kfbPath, scale, readAll)

    def ReadRoi(self, x, y, w, h, scale):
        arr = _kfbReader.reader_ReadRoi(self,
                                        int(x), int(y), int(w), int(h),
                                        scale)
        arr = np.reshape(arr, [int(h), int(w), 3]).astype(np.uint8)
        return arr

    def ReadPreview(self):
        w, img = _kfbReader.reader_ReadPreview(self)
        if w == 0: return
        img = np.array(img).astype(np.uint8)
        l = img.shape[0]
        img = img.reshape((l // w // 3, w, 3))
        return img

    def getWidth(self):
        return _kfbReader.reader_getWidth(self)

    def getHeight(self):
        return _kfbReader.reader_getHeight(self)

    def getReadScale(self):
        return _kfbReader.reader_getReadScale(self)

    def setReadScale(self, scale):
        return _kfbReader.reader_setReadScale(self, scale)

    def readLabelImage(self):
        w, img = _kfbReader.reader_readLabelImage(self)
        if w == 0: return
        img = np.array(img).astype(np.uint8)
        l = img.shape[0]
        img = img.reshape((l // w // 3, w, 3))
        return img


reader_swigregister = _kfbReader.reader_swigregister
reader_swigregister(reader)

# This file is compatible with both classic and new-style classes.

81b03618370e99f1623d0d60fb80d11d591c8ac6
<mask token>


class reader(_object):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def ReadInfo(self, kfbPath, scale=0, readAll=False):
        return _kfbReader.reader_ReadInfo(self, kfbPath, scale, readAll)
    <mask token>
    <mask token>
    <mask token>

    def getHeight(self):
        return _kfbReader.reader_getHeight(self)

    def getReadScale(self):
        return _kfbReader.reader_getReadScale(self)
    <mask token>
    <mask token>


<mask token>

<mask token>


class reader(_object):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __init__(self):
        curdir = os.path.abspath(os.curdir)
        os.chdir(os.path.dirname(__file__))
        this = _kfbReader.new_reader()
        os.chdir(curdir)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    <mask token>
    <mask token>

    def ReadInfo(self, kfbPath, scale=0, readAll=False):
        return _kfbReader.reader_ReadInfo(self, kfbPath, scale, readAll)

    def ReadRoi(self, x, y, w, h, scale):
        arr = _kfbReader.reader_ReadRoi(self, int(x), int(y), int(w), int(h
            ), scale)
        arr = np.reshape(arr, [int(h), int(w), 3]).astype(np.uint8)
        return arr

    def ReadPreview(self):
        w, img = _kfbReader.reader_ReadPreview(self)
        if w == 0:
            return
        img = np.array(img).astype(np.uint8)
        l = img.shape[0]
        img = img.reshape((l // w // 3, w, 3))
        return img

    def getWidth(self):
        return _kfbReader.reader_getWidth(self)

    def getHeight(self):
        return _kfbReader.reader_getHeight(self)

    def getReadScale(self):
        return _kfbReader.reader_getReadScale(self)

    def setReadScale(self, scale):
        return _kfbReader.reader_setReadScale(self, scale)

    def readLabelImage(self):
        w, img = _kfbReader.reader_readLabelImage(self)
        if w == 0:
            return
        img = np.array(img).astype(np.uint8)
        l = img.shape[0]
        img = img.reshape((l // w // 3, w, 3))
        return img


<mask token>

<mask token>
if _swig_python_version_info >= (2, 7, 0):

    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_kfbReader')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_kfbReader')
    _kfbReader = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):

    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_kfbReader', [
                dirname(__file__)])
        except ImportError:
            import _kfbReader
            return _kfbReader
        try:
            _mod = imp.load_module('_kfbReader', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _kfbReader = swig_import_helper()
    del swig_import_helper
else:
    import _kfbReader
del _swig_python_version_info
try:
    _swig_property = property
except NameError:
    pass
<mask token>


def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if name == 'thisown':
        return self.this.own(value)
    if name == 'this':
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if not static:
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError('You cannot add attributes to %s' % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if name == 'thisown':
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.
        __name__, name))


def _swig_repr(self):
    try:
        strthis = 'proxy of ' + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ''
    return '<%s.%s; %s >' % (self.__class__.__module__, self.__class__.
        __name__, strthis)


try:
    _object = object
    _newclass = 1
except __builtin__.Exception:


    class _object:
        pass
    _newclass = 0
<mask token>


class reader(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, reader,
        name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, reader, name)
    __repr__ = _swig_repr

    def __init__(self):
        curdir = os.path.abspath(os.curdir)
        os.chdir(os.path.dirname(__file__))
        this = _kfbReader.new_reader()
        os.chdir(curdir)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _kfbReader.delete_reader
    __del__ = lambda self: None

    def ReadInfo(self, kfbPath, scale=0, readAll=False):
        return _kfbReader.reader_ReadInfo(self, kfbPath, scale, readAll)

    def ReadRoi(self, x, y, w, h, scale):
        arr = _kfbReader.reader_ReadRoi(self, int(x), int(y), int(w), int(h
            ), scale)
        arr = np.reshape(arr, [int(h), int(w), 3]).astype(np.uint8)
        return arr

    def ReadPreview(self):
        w, img = _kfbReader.reader_ReadPreview(self)
        if w == 0:
            return
        img = np.array(img).astype(np.uint8)
        l = img.shape[0]
        img = img.reshape((l // w // 3, w, 3))
        return img

    def getWidth(self):
        return _kfbReader.reader_getWidth(self)

    def getHeight(self):
        return _kfbReader.reader_getHeight(self)

    def getReadScale(self):
        return _kfbReader.reader_getReadScale(self)

    def setReadScale(self, scale):
        return _kfbReader.reader_setReadScale(self, scale)

    def readLabelImage(self):
        w, img = _kfbReader.reader_readLabelImage(self)
        if w == 0:
            return
        img = np.array(img).astype(np.uint8)
        l = img.shape[0]
        img = img.reshape((l // w // 3, w, 3))
        return img


<mask token>
reader_swigregister(reader)

from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):

    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_kfbReader')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_kfbReader')
    _kfbReader = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):

    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_kfbReader', [
                dirname(__file__)])
        except ImportError:
            import _kfbReader
            return _kfbReader
        try:
            _mod = imp.load_module('_kfbReader', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _kfbReader = swig_import_helper()
    del swig_import_helper
else:
    import _kfbReader
del _swig_python_version_info
try:
    _swig_property = property
except NameError:
    pass
import builtins as __builtin__


def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if name == 'thisown':
        return self.this.own(value)
    if name == 'this':
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if not static:
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError('You cannot add attributes to %s' % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if name == 'thisown':
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.
        __name__, name))


def _swig_repr(self):
    try:
        strthis = 'proxy of ' + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ''
    return '<%s.%s; %s >' % (self.__class__.__module__, self.__class__.
        __name__, strthis)


try:
    _object = object
    _newclass = 1
except __builtin__.Exception:


    class _object:
        pass
    _newclass = 0
import os
import numpy as np


class reader(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, reader,
        name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, reader, name)
    __repr__ = _swig_repr

    def __init__(self):
        curdir = os.path.abspath(os.curdir)
        os.chdir(os.path.dirname(__file__))
        this = _kfbReader.new_reader()
        os.chdir(curdir)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _kfbReader.delete_reader
    __del__ = lambda self: None

    def ReadInfo(self, kfbPath, scale=0, readAll=False):
        return _kfbReader.reader_ReadInfo(self, kfbPath, scale, readAll)

    def ReadRoi(self, x, y, w, h, scale):
        arr = _kfbReader.reader_ReadRoi(self, int(x), int(y), int(w), int(h
            ), scale)
        arr = np.reshape(arr, [int(h), int(w), 3]).astype(np.uint8)
        return arr

    def ReadPreview(self):
        w, img = _kfbReader.reader_ReadPreview(self)
        if w == 0:
            return
        img = np.array(img).astype(np.uint8)
        l = img.shape[0]
        img = img.reshape((l // w // 3, w, 3))
        return img

    def getWidth(self):
        return _kfbReader.reader_getWidth(self)

    def getHeight(self):
        return _kfbReader.reader_getHeight(self)

    def getReadScale(self):
        return _kfbReader.reader_getReadScale(self)

    def setReadScale(self, scale):
        return _kfbReader.reader_setReadScale(self, scale)

    def readLabelImage(self):
        w, img = _kfbReader.reader_readLabelImage(self)
        if w == 0:
            return
        img = np.array(img).astype(np.uint8)
        l = img.shape[0]
        img = img.reshape((l // w // 3, w, 3))
        return img


reader_swigregister = _kfbReader.reader_swigregister
reader_swigregister(reader)

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info

if _swig_python_version_info >= (2, 7, 0):
    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_kfbReader')).lstrip('.')
        try:
            return importlib.import_module(mname)
            # return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_kfbReader')


    _kfbReader = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_kfbReader', [dirname(__file__)])
        except ImportError:
            import _kfbReader
            return _kfbReader
        try:
            _mod = imp.load_module('_kfbReader', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod


    _kfbReader = swig_import_helper()
    del swig_import_helper
else:
    import _kfbReader
del _swig_python_version_info

try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

import builtins as __builtin__


def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


try:
    _object = object
    _newclass = 1
except __builtin__.Exception:
    class _object:
        pass


    _newclass = 0
import os
import numpy as np


class reader(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, reader, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, reader, name)
    __repr__ = _swig_repr

    def __init__(self):
        curdir = os.path.abspath(os.curdir)
        os.chdir(os.path.dirname(__file__))
        this = _kfbReader.new_reader()
        os.chdir(curdir)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

    __swig_destroy__ = _kfbReader.delete_reader
    __del__ = lambda self: None

    def ReadInfo(self, kfbPath, scale=0, readAll=False):
        return _kfbReader.reader_ReadInfo(self, kfbPath, scale, readAll)

    def ReadRoi(self, x, y, w, h, scale):
        arr = _kfbReader.reader_ReadRoi(self,
                                        int(x), int(y), int(w), int(h),
                                        scale)
        arr = np.reshape(arr, [int(h), int(w), 3]).astype(np.uint8)
        return arr

    def ReadPreview(self):
        w, img = _kfbReader.reader_ReadPreview(self)
        if w == 0: return
        img = np.array(img).astype(np.uint8)
        l = img.shape[0]
        img = img.reshape((l // w // 3, w, 3))
        return img

    def getWidth(self):
        return _kfbReader.reader_getWidth(self)

    def getHeight(self):
        return _kfbReader.reader_getHeight(self)

    def getReadScale(self):
        return _kfbReader.reader_getReadScale(self)

    def setReadScale(self, scale):
        return _kfbReader.reader_setReadScale(self, scale)

    def readLabelImage(self):
        w, img = _kfbReader.reader_readLabelImage(self)
        if w == 0: return
        img = np.array(img).astype(np.uint8)
        l = img.shape[0]
        img = img.reshape((l // w // 3, w, 3))
        return img


reader_swigregister = _kfbReader.reader_swigregister
reader_swigregister(reader)

# This file is compatible with both classic and new-style classes.
