Glymur 0.13.6__py3-none-any.whl → 0.13.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {Glymur-0.13.6.dist-info → Glymur-0.13.8.dist-info}/METADATA +5 -3
- Glymur-0.13.8.dist-info/RECORD +25 -0
- {Glymur-0.13.6.dist-info → Glymur-0.13.8.dist-info}/WHEEL +1 -1
- glymur/_iccprofile.py +73 -72
- glymur/codestream.py +385 -308
- glymur/config.py +15 -14
- glymur/core.py +18 -22
- glymur/jp2box.py +736 -577
- glymur/jp2k.py +185 -149
- glymur/jp2kr.py +62 -48
- glymur/lib/openjp2.py +198 -285
- glymur/lib/tiff.py +1152 -1156
- glymur/options.py +33 -28
- glymur/tiff.py +105 -103
- glymur/version.py +1 -1
- Glymur-0.13.6.dist-info/RECORD +0 -25
- {Glymur-0.13.6.dist-info → Glymur-0.13.8.dist-info}/LICENSE.txt +0 -0
- {Glymur-0.13.6.dist-info → Glymur-0.13.8.dist-info}/entry_points.txt +0 -0
- {Glymur-0.13.6.dist-info → Glymur-0.13.8.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: Glymur
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.8
|
|
4
4
|
Home-page: https://github.com/quintusdias/glymur
|
|
5
5
|
Author: 'John Evans'
|
|
6
6
|
Author-email: "John Evans" <jevans667cc@proton.me>
|
|
@@ -9,12 +9,13 @@ Classifier: Programming Language :: Python
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.10
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
13
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
13
14
|
Classifier: License :: OSI Approved :: MIT License
|
|
14
15
|
Classifier: Intended Audience :: Science/Research
|
|
15
16
|
Classifier: Operating System :: OS Independent
|
|
16
17
|
Classifier: Topic :: Scientific/Engineering
|
|
17
|
-
Requires-Python: >=3.
|
|
18
|
+
Requires-Python: >=3.9
|
|
18
19
|
Description-Content-Type: text/markdown
|
|
19
20
|
License-File: LICENSE.txt
|
|
20
21
|
Requires-Dist: numpy
|
|
@@ -23,6 +24,7 @@ Requires-Dist: packaging
|
|
|
23
24
|
Provides-Extra: test
|
|
24
25
|
Requires-Dist: pytest; extra == "test"
|
|
25
26
|
Requires-Dist: pillow; extra == "test"
|
|
27
|
+
Requires-Dist: scikit-image; extra == "test"
|
|
26
28
|
|
|
27
29
|
|
|
28
30
|
**glymur** contains a Python interface to the OpenJPEG library which
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
glymur/__init__.py,sha256=k14IfdaYuTWXSpAIDR3LVDtXt9XKjr-ZSNXCyu8pQko,586
|
|
2
|
+
glymur/_iccprofile.py,sha256=v0nOhJuZsKViBUYCf8TWVJvs1k0vC9PGYdbkEIfGuI4,4156
|
|
3
|
+
glymur/codestream.py,sha256=wzRI8S5dlNfg6RqrSV7r5a4Rr2cDfk0n7CvytonBmHk,62680
|
|
4
|
+
glymur/command_line.py,sha256=jm-6dD2jcU_G7mJAJ0U5sanfG9kRy-j0-G3eSN_Ieek,7476
|
|
5
|
+
glymur/config.py,sha256=lVunNA-A475BX27L_qmrec_lm1InzHuL4_jkG8v_1FA,4140
|
|
6
|
+
glymur/core.py,sha256=O07TfaRW2YmurkFMiurl0DkDSGB0slDAAzP83K1HPFA,3613
|
|
7
|
+
glymur/jp2box.py,sha256=qd__DSllhzvv3YdJ6jCEHyPWtqLoUUIdmZ5h9WTH0M8,113345
|
|
8
|
+
glymur/jp2k.py,sha256=TmlfUsrRGcTD8gh-CxEUdc65tCSo2s0MGXzWShb01BQ,53888
|
|
9
|
+
glymur/jp2kr.py,sha256=DK4AQSc_30C1ZDAnxZubmZ6HBE1OwFj3VKpRg48wkVw,33143
|
|
10
|
+
glymur/options.py,sha256=TZApl6r_qCERHSIcTdM0iGvYuQLrZMbOtyFJB7XkvK0,4413
|
|
11
|
+
glymur/tiff.py,sha256=O7vodg--mEPHM2PQzb1ZnBTwQO7RfEgB4SqZM5ftuOo,41153
|
|
12
|
+
glymur/version.py,sha256=COjDoXQsY65BVg7DEFu2PXfyDUw6PDOoZEVk4MDpeBs,981
|
|
13
|
+
glymur/data/__init__.py,sha256=n2KZrHV15it7Wu4YCaBLXui1ZleQ30dnZ92dyP6q05k,955
|
|
14
|
+
glymur/data/goodstuff.j2k,sha256=xKQG68KMu33gYjRUDTQvam1Cue2tdio85rNp5J-rYZE,115220
|
|
15
|
+
glymur/data/heliov.jpx,sha256=KXnYdBZgl25jcGLu-m-QfhuP9pqUXV0Hp9HHEdJqr34,1399071
|
|
16
|
+
glymur/data/nemo.jp2,sha256=yJ1NkTEwU0B_gBtAiA1c5hxtGYSJtJgq6cHC2IHpj70,1132373
|
|
17
|
+
glymur/lib/__init__.py,sha256=JnM9oPfcZhBDLKo7_yLS-lIRQ1wXb1N9hKKQ-G7vYVk,127
|
|
18
|
+
glymur/lib/openjp2.py,sha256=0UWPp2mto8G43yRUhGfpcS1RV6l3ac1YQrlVyBhxvjs,44064
|
|
19
|
+
glymur/lib/tiff.py,sha256=75acs7v_CsfhQL7xWtnMa8zllrOkFeXZG8vmvfYDIRs,50564
|
|
20
|
+
Glymur-0.13.8.dist-info/LICENSE.txt,sha256=G9pvBgkJdPTtZqQmoRyIgAydtic1ZwWtOWBea9VMW7I,1077
|
|
21
|
+
Glymur-0.13.8.dist-info/METADATA,sha256=9qiTUBH6lEqByyQISEfJZpqt6_xNWu4i_d6Q5tt_fSg,1114
|
|
22
|
+
Glymur-0.13.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
23
|
+
Glymur-0.13.8.dist-info/entry_points.txt,sha256=inzxpDbDDfIxtdXpCncAHdAdwJfjtXt3xKvIOsuZsG8,93
|
|
24
|
+
Glymur-0.13.8.dist-info/top_level.txt,sha256=D0SvtBUoPxOs40OTRW3l-kjGFHM6VrXS8yZPK5Fx2wY,7
|
|
25
|
+
Glymur-0.13.8.dist-info/RECORD,,
|
glymur/_iccprofile.py
CHANGED
|
@@ -9,118 +9,119 @@ import numpy as np
|
|
|
9
9
|
|
|
10
10
|
class _ICCProfile(object):
|
|
11
11
|
"""Container for ICC profile information."""
|
|
12
|
+
|
|
12
13
|
profile_class = {
|
|
13
|
-
b
|
|
14
|
-
b
|
|
15
|
-
b
|
|
16
|
-
b
|
|
17
|
-
b
|
|
18
|
-
b
|
|
19
|
-
b
|
|
14
|
+
b"scnr": "input device profile",
|
|
15
|
+
b"mntr": "display device profile",
|
|
16
|
+
b"prtr": "output device profile",
|
|
17
|
+
b"link": "devicelink profile",
|
|
18
|
+
b"spac": "colorspace conversion profile",
|
|
19
|
+
b"abst": "abstract profile",
|
|
20
|
+
b"nmcl": "name colour profile",
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
colour_space_dict = {
|
|
23
|
-
b
|
|
24
|
-
b
|
|
25
|
-
b
|
|
26
|
-
b
|
|
27
|
-
b
|
|
28
|
-
b
|
|
29
|
-
b
|
|
30
|
-
b
|
|
31
|
-
b
|
|
32
|
-
b
|
|
33
|
-
b
|
|
34
|
-
b
|
|
35
|
-
b
|
|
36
|
-
b
|
|
37
|
-
b
|
|
38
|
-
b
|
|
39
|
-
b
|
|
40
|
-
b
|
|
41
|
-
b
|
|
42
|
-
b
|
|
43
|
-
b
|
|
44
|
-
b
|
|
45
|
-
b
|
|
46
|
-
b
|
|
47
|
-
b
|
|
24
|
+
b"XYZ ": "XYZ",
|
|
25
|
+
b"Lab ": "Lab",
|
|
26
|
+
b"Luv ": "Luv",
|
|
27
|
+
b"YCbr": "YCbCr",
|
|
28
|
+
b"Yxy ": "Yxy",
|
|
29
|
+
b"RGB ": "RGB",
|
|
30
|
+
b"GRAY": "gray",
|
|
31
|
+
b"HSV ": "hsv",
|
|
32
|
+
b"HLS ": "hls",
|
|
33
|
+
b"CMYK": "CMYK",
|
|
34
|
+
b"CMY ": "cmy",
|
|
35
|
+
b"2CLR": "2colour",
|
|
36
|
+
b"3CLR": "3colour",
|
|
37
|
+
b"4CLR": "4colour",
|
|
38
|
+
b"5CLR": "5colour",
|
|
39
|
+
b"6CLR": "6colour",
|
|
40
|
+
b"7CLR": "7colour",
|
|
41
|
+
b"8CLR": "8colour",
|
|
42
|
+
b"9CLR": "9colour",
|
|
43
|
+
b"ACLR": "10colour",
|
|
44
|
+
b"BCLR": "11colour",
|
|
45
|
+
b"CCLR": "12colour",
|
|
46
|
+
b"DCLR": "13colour",
|
|
47
|
+
b"ECLR": "14colour",
|
|
48
|
+
b"FCLR": "15colour",
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
rendering_intent_dict = {
|
|
51
|
-
0:
|
|
52
|
-
1:
|
|
53
|
-
2:
|
|
54
|
-
3:
|
|
52
|
+
0: "perceptual",
|
|
53
|
+
1: "media-relative colorimetric",
|
|
54
|
+
2: "saturation",
|
|
55
|
+
3: "ICC-absolute colorimetric",
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
def __init__(self, read_buffer):
|
|
58
59
|
self._raw_buffer = read_buffer
|
|
59
60
|
header = OrderedDict()
|
|
60
61
|
|
|
61
|
-
data = struct.unpack(
|
|
62
|
-
header[
|
|
63
|
-
header[
|
|
62
|
+
data = struct.unpack(">IIBB", self._raw_buffer[0:10])
|
|
63
|
+
header["Size"] = data[0]
|
|
64
|
+
header["Preferred CMM Type"] = data[1]
|
|
64
65
|
major = data[2]
|
|
65
|
-
minor = (data[3] &
|
|
66
|
-
bugfix =
|
|
67
|
-
header[
|
|
66
|
+
minor = (data[3] & 0xF0) >> 4
|
|
67
|
+
bugfix = data[3] & 0x0F
|
|
68
|
+
header["Version"] = f"{major}.{minor}.{bugfix}"
|
|
68
69
|
|
|
69
|
-
header[
|
|
70
|
-
header[
|
|
70
|
+
header["Device Class"] = self.profile_class[self._raw_buffer[12:16]]
|
|
71
|
+
header["Color Space"] = self.colour_space_dict[self._raw_buffer[16:20]]
|
|
71
72
|
data = self.colour_space_dict[self._raw_buffer[20:24]]
|
|
72
|
-
header[
|
|
73
|
+
header["Connection Space"] = data
|
|
73
74
|
|
|
74
|
-
data = struct.unpack(
|
|
75
|
+
data = struct.unpack(">HHHHHH", self._raw_buffer[24:36])
|
|
75
76
|
try:
|
|
76
|
-
header[
|
|
77
|
+
header["Datetime"] = datetime.datetime(*data)
|
|
77
78
|
except ValueError:
|
|
78
|
-
header[
|
|
79
|
-
header[
|
|
80
|
-
if read_buffer[40:44] == b
|
|
81
|
-
header[
|
|
79
|
+
header["Datetime"] = None
|
|
80
|
+
header["File Signature"] = read_buffer[36:40].decode("utf-8")
|
|
81
|
+
if read_buffer[40:44] == b"\x00\x00\x00\x00":
|
|
82
|
+
header["Platform"] = "unrecognized"
|
|
82
83
|
else:
|
|
83
|
-
header[
|
|
84
|
+
header["Platform"] = read_buffer[40:44].decode("utf-8")
|
|
84
85
|
|
|
85
|
-
fval, = struct.unpack(
|
|
86
|
-
header[
|
|
86
|
+
(fval,) = struct.unpack(">I", read_buffer[44:48])
|
|
87
|
+
header["Flags"] = (
|
|
87
88
|
f"{'' if fval & 0x01 else 'not '}embedded, "
|
|
88
89
|
f"{'cannot' if fval & 0x02 else 'can'} be used independently"
|
|
89
90
|
)
|
|
90
91
|
|
|
91
|
-
header[
|
|
92
|
-
if read_buffer[52:56] == b
|
|
93
|
-
device_model =
|
|
92
|
+
header["Device Manufacturer"] = read_buffer[48:52].decode("utf-8")
|
|
93
|
+
if read_buffer[52:56] == b"\x00\x00\x00\x00":
|
|
94
|
+
device_model = ""
|
|
94
95
|
else:
|
|
95
|
-
device_model = read_buffer[52:56].decode(
|
|
96
|
-
header[
|
|
96
|
+
device_model = read_buffer[52:56].decode("utf-8")
|
|
97
|
+
header["Device Model"] = device_model
|
|
97
98
|
|
|
98
|
-
val, = struct.unpack(
|
|
99
|
+
(val,) = struct.unpack(">Q", read_buffer[56:64])
|
|
99
100
|
attr = (
|
|
100
101
|
f"{'transparency' if val & 0x01 else 'reflective'}, "
|
|
101
102
|
f"{'matte' if val & 0x02 else 'glossy'}, "
|
|
102
103
|
f"{'negative' if val & 0x04 else 'positive'} media polarity, "
|
|
103
104
|
f"{'black and white' if val & 0x08 else 'color'} media"
|
|
104
105
|
)
|
|
105
|
-
header[
|
|
106
|
+
header["Device Attributes"] = attr
|
|
106
107
|
|
|
107
|
-
rval, = struct.unpack(
|
|
108
|
+
(rval,) = struct.unpack(">I", read_buffer[64:68])
|
|
108
109
|
try:
|
|
109
|
-
header[
|
|
110
|
+
header["Rendering Intent"] = self.rendering_intent_dict[rval]
|
|
110
111
|
except KeyError:
|
|
111
|
-
header[
|
|
112
|
+
header["Rendering Intent"] = "unknown"
|
|
112
113
|
|
|
113
|
-
data = struct.unpack(
|
|
114
|
-
header[
|
|
114
|
+
data = struct.unpack(">iii", read_buffer[68:80])
|
|
115
|
+
header["Illuminant"] = np.array(data, dtype=np.float64) / 65536
|
|
115
116
|
|
|
116
|
-
if read_buffer[80:84] == b
|
|
117
|
-
creator =
|
|
117
|
+
if read_buffer[80:84] == b"\x00\x00\x00\x00":
|
|
118
|
+
creator = "unrecognized"
|
|
118
119
|
else:
|
|
119
|
-
creator = read_buffer[80:84].decode(
|
|
120
|
-
header[
|
|
120
|
+
creator = read_buffer[80:84].decode("utf-8")
|
|
121
|
+
header["Creator"] = creator
|
|
121
122
|
|
|
122
|
-
if header[
|
|
123
|
-
header[
|
|
123
|
+
if header["Version"][0] == "4":
|
|
124
|
+
header["Profile Id"] = read_buffer[84:100]
|
|
124
125
|
|
|
125
126
|
# Final 27 bytes are reserved.
|
|
126
127
|
self.header = header
|