# Path: glymur/core.py
# LRCP = 0
# 
# RLCP = 1
# 
# RPCL = 2
# 
# PCRL = 3
# 
# CPRL = 4
# 
# WAVELET_XFORM_9X7_IRREVERSIBLE = 0
# 
# WAVELET_XFORM_5X3_REVERSIBLE = 1
# 
# Path: glymur/lib/openjp2.py
# OPENJP2 = glymur_config('openjp2')
#     _MAJOR, _MINOR, _PATCH = [int(x) for x in version().split('.')]
#     _MAJOR, _MINOR, _PATCH = 0, 0, 0
# ERROR_MSG_LST = queue.Queue()
# BOOL_TYPE = ctypes.c_int32
# CODEC_TYPE = ctypes.c_void_p
# PROG_ORDER_TYPE = ctypes.c_int32
# CINEMA_MODE_TYPE = ctypes.c_int32
# RSIZ_CAPABILITIES_TYPE = ctypes.c_int32
# STREAM_TYPE_P = ctypes.c_void_p
# PATH_LEN = 4096
# J2K_MAXRLVLS = 33
# J2K_MAXBANDS = (3 * J2K_MAXRLVLS - 2)
# JPWL_MAX_NO_TILESPECS = 16
# TRUE = 1
# FALSE = 0
# CLRSPC_UNKNOWN = -1
# CLRSPC_UNSPECIFIED = 0
# CLRSPC_SRGB = 1
# CLRSPC_GRAY = 2
# CLRSPC_YCC = 3
# CLRSPC_EYCC = 4
# COLOR_SPACE_TYPE = ctypes.c_int
# CODEC_FORMAT_TYPE = ctypes.c_int
# CODEC_UNKNOWN = -1
# CODEC_J2K = 0
# CODEC_JPT = 1
# CODEC_JP2 = 2
#     ARGTYPES = [
#         ctypes.c_uint32,
#         ctypes.POINTER(ImageComptParmType),
#         COLOR_SPACE_TYPE
#     ]
#     ARGTYPES = [
#         CODEC_TYPE,
#         ctypes.POINTER(ctypes.c_char_p)
#     ]
#     ARGTYPES = [
#         STREAM_TYPE_P,
#         CODEC_TYPE,
#         ctypes.POINTER(ctypes.POINTER(ImageType))
#     ]
#     ARGTYPES = [
#         CODEC_TYPE,
#         STREAM_TYPE_P,
#         ctypes.POINTER(ctypes.c_uint32),
#         ctypes.POINTER(ctypes.c_uint32),
#         ctypes.POINTER(ctypes.c_int32),
#         ctypes.POINTER(ctypes.c_int32),
#         ctypes.POINTER(ctypes.c_int32),
#         ctypes.POINTER(ctypes.c_int32),
#         ctypes.POINTER(ctypes.c_uint32),
#         ctypes.POINTER(BOOL_TYPE)
#     ]
#     ARGTYPES = [ctypes.POINTER(DecompressionParametersType)]
#     ARGTYPES = [ctypes.POINTER(CompressionParametersType)]
#     ARGTYPES = [CODEC_TYPE, ctypes.POINTER(DecompressionParametersType)]
#     ARGTYPES = [
#         CODEC_TYPE,
#         ctypes.POINTER(CompressionParametersType),
#         ctypes.POINTER(ImageType)
#     ]
#     ARGTYPES = [ctypes.c_char_p, ctypes.c_int32]
# class OpenJPEGLibraryError(IOError):
# class PocType(ctypes.Structure):
# class DecompressionParametersType(ctypes.Structure):
# class CompressionParametersType(ctypes.Structure):
# class ImageCompType(ctypes.Structure):
# class ImageType(ctypes.Structure):
# class ImageComptParmType(ctypes.Structure):
# def version():
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
# def check_error(status):
# def create_compress(codec_format):
# def codec_set_threads(codec, num_threads):
# def decode(codec, stream, image):
# def decode_tile_data(codec, tidx, data, data_size, stream):
# def create_decompress(codec_format):
# def destroy_codec(codec):
# def encode(codec, stream):
# def get_decoded_tile(codec, stream, imagep, tile_index):
# def end_compress(codec, stream):
# def end_decompress(codec, stream):
# def get_num_cpus():
# def has_thread_support():
# def image_destroy(image):
# def image_create(comptparms, clrspc):
# def image_tile_create(comptparms, clrspc):
# def encoder_set_extra_options(codec, plt=False):
# def read_header(stream, codec):
# def read_tile_header(codec, stream):
# def set_decode_area(codec, image, start_x=0, start_y=0, end_x=0, end_y=0):
# def set_decoded_components(codec, comp_indices):
# def set_default_decoder_parameters():
# def set_default_encoder_parameters():
# def set_error_handler(codec, handler, data=None):
# def set_info_handler(codec, handler, data=None):
# def set_warning_handler(codec, handler, data=None):
# def setup_decoder(codec, dparams):
# def setup_encoder(codec, cparams, image):
# def start_compress(codec, image, stream):
# def stream_create_default_file_stream(fname, isa_read_stream):
# def stream_destroy(stream):
# def write_tile(codec, tile_index, data, *pargs):
# def set_error_message(msg):


import struct
import sys
import warnings
import numpy as np
from .core import (
    LRCP, RLCP, RPCL, PCRL, CPRL,
    WAVELET_XFORM_9X7_IRREVERSIBLE, WAVELET_XFORM_5X3_REVERSIBLE
)
from .lib import openjp2 as opj2
"""Codestream information.

The module contains classes used to store information parsed from JPEG 2000
codestreams.
"""

# standard library imports

# 3rd party library imports

# local imports


_PROGRESSION_ORDER_DISPLAY = {
    LRCP: 'LRCP',
    RLCP: 'RLCP',
    RPCL: 'RPCL',
    PCRL: 'PCRL',
    CPRL: 'CPRL',
}

_WAVELET_XFORM_DISPLAY = {

# Path: glymur/core.py
# LRCP = 0
# 
# RLCP = 1
# 
# RPCL = 2
# 
# PCRL = 3
# 
# CPRL = 4
# 
# WAVELET_XFORM_9X7_IRREVERSIBLE = 0
# 
# WAVELET_XFORM_5X3_REVERSIBLE = 1
# 
# Path: glymur/lib/openjp2.py
# OPENJP2 = glymur_config('openjp2')
#     _MAJOR, _MINOR, _PATCH = [int(x) for x in version().split('.')]
#     _MAJOR, _MINOR, _PATCH = 0, 0, 0
# ERROR_MSG_LST = queue.Queue()
# BOOL_TYPE = ctypes.c_int32
# CODEC_TYPE = ctypes.c_void_p
# PROG_ORDER_TYPE = ctypes.c_int32
# CINEMA_MODE_TYPE = ctypes.c_int32
# RSIZ_CAPABILITIES_TYPE = ctypes.c_int32
# STREAM_TYPE_P = ctypes.c_void_p
# PATH_LEN = 4096
# J2K_MAXRLVLS = 33
# J2K_MAXBANDS = (3 * J2K_MAXRLVLS - 2)
# JPWL_MAX_NO_TILESPECS = 16
# TRUE = 1
# FALSE = 0
# CLRSPC_UNKNOWN = -1
# CLRSPC_UNSPECIFIED = 0
# CLRSPC_SRGB = 1
# CLRSPC_GRAY = 2
# CLRSPC_YCC = 3
# CLRSPC_EYCC = 4
# COLOR_SPACE_TYPE = ctypes.c_int
# CODEC_FORMAT_TYPE = ctypes.c_int
# CODEC_UNKNOWN = -1
# CODEC_J2K = 0
# CODEC_JPT = 1
# CODEC_JP2 = 2
#     ARGTYPES = [
#         ctypes.c_uint32,
#         ctypes.POINTER(ImageComptParmType),
#         COLOR_SPACE_TYPE
#     ]
#     ARGTYPES = [
#         CODEC_TYPE,
#         ctypes.POINTER(ctypes.c_char_p)
#     ]
#     ARGTYPES = [
#         STREAM_TYPE_P,
#         CODEC_TYPE,
#         ctypes.POINTER(ctypes.POINTER(ImageType))
#     ]
#     ARGTYPES = [
#         CODEC_TYPE,
#         STREAM_TYPE_P,
#         ctypes.POINTER(ctypes.c_uint32),
#         ctypes.POINTER(ctypes.c_uint32),
#         ctypes.POINTER(ctypes.c_int32),
#         ctypes.POINTER(ctypes.c_int32),
#         ctypes.POINTER(ctypes.c_int32),
#         ctypes.POINTER(ctypes.c_int32),
#         ctypes.POINTER(ctypes.c_uint32),
#         ctypes.POINTER(BOOL_TYPE)
#     ]
#     ARGTYPES = [ctypes.POINTER(DecompressionParametersType)]
#     ARGTYPES = [ctypes.POINTER(CompressionParametersType)]
#     ARGTYPES = [CODEC_TYPE, ctypes.POINTER(DecompressionParametersType)]
#     ARGTYPES = [
#         CODEC_TYPE,
#         ctypes.POINTER(CompressionParametersType),
#         ctypes.POINTER(ImageType)
#     ]
#     ARGTYPES = [ctypes.c_char_p, ctypes.c_int32]
# class OpenJPEGLibraryError(IOError):
# class PocType(ctypes.Structure):
# class DecompressionParametersType(ctypes.Structure):
# class CompressionParametersType(ctypes.Structure):
# class ImageCompType(ctypes.Structure):
# class ImageType(ctypes.Structure):
# class ImageComptParmType(ctypes.Structure):
# def version():
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
# def check_error(status):
# def create_compress(codec_format):
# def codec_set_threads(codec, num_threads):
# def decode(codec, stream, image):
# def decode_tile_data(codec, tidx, data, data_size, stream):
# def create_decompress(codec_format):
# def destroy_codec(codec):
# def encode(codec, stream):
# def get_decoded_tile(codec, stream, imagep, tile_index):
# def end_compress(codec, stream):
# def end_decompress(codec, stream):
# def get_num_cpus():
# def has_thread_support():
# def image_destroy(image):
# def image_create(comptparms, clrspc):
# def image_tile_create(comptparms, clrspc):
# def encoder_set_extra_options(codec, plt=False):
# def read_header(stream, codec):
# def read_tile_header(codec, stream):
# def set_decode_area(codec, image, start_x=0, start_y=0, end_x=0, end_y=0):
# def set_decoded_components(codec, comp_indices):
# def set_default_decoder_parameters():
# def set_default_encoder_parameters():
# def set_error_handler(codec, handler, data=None):
# def set_info_handler(codec, handler, data=None):
# def set_warning_handler(codec, handler, data=None):
# def setup_decoder(codec, dparams):
# def setup_encoder(codec, cparams, image):
# def start_compress(codec, image, stream):
# def stream_create_default_file_stream(fname, isa_read_stream):
# def stream_destroy(stream):
# def write_tile(codec, tile_index, data, *pargs):
# def set_error_message(msg):


# Path: glymur/codestream.py
import struct
import sys
import warnings
import numpy as np
from .core import (
    LRCP, RLCP, RPCL, PCRL, CPRL,
    WAVELET_XFORM_9X7_IRREVERSIBLE, WAVELET_XFORM_5X3_REVERSIBLE
)
from .lib import openjp2 as opj2

"""Codestream information.

The module contains classes used to store information parsed from JPEG 2000
codestreams.
"""

# standard library imports

# 3rd party library imports

# local imports


_PROGRESSION_ORDER_DISPLAY = {
    LRCP: 'LRCP',
    RLCP: 'RLCP',
    RPCL: 'RPCL',
    PCRL: 'PCRL',
    CPRL: 'CPRL',
}

_WAVELET_XFORM_DISPLAY = {

    WAVELET_XFORM_9X7_IRREVERSIBLE: '9-7 irreversible',