rreq masks and standard features now printed together. #174
Masks are printed in hex.
This commit is contained in:
parent
5c971a6981
commit
db92f3fea7
3 changed files with 14 additions and 24 deletions
|
|
@ -11,7 +11,7 @@ References
|
||||||
Extensions
|
Extensions
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# pylint: disable=C0302,R0903,R0913
|
# pylint: disable=C0302,R0903,R0913,W0142
|
||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
import datetime
|
import datetime
|
||||||
|
|
@ -1866,20 +1866,14 @@ class ReaderRequirementsBox(Jp2kBox):
|
||||||
if _printoptions['short'] == True:
|
if _printoptions['short'] == True:
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
msg += '\n Fully Understands Aspect Mask: {0}'.format(self.fuam)
|
msg += '\n Fully Understands Aspect Mask: 0x{0:x}'.format(self.fuam)
|
||||||
msg += '\n Display Completely Mask: {0}'.format(self.dcm)
|
msg += '\n Display Completely Mask: 0x{0:x}'.format(self.dcm)
|
||||||
|
|
||||||
msg += '\n Standard Features and Masks:'
|
msg += '\n Standard Features and Masks:'
|
||||||
for j in range(len(self.standard_flag)):
|
for j in range(len(self.standard_flag)):
|
||||||
sfl = self.standard_flag[j]
|
args = (self.standard_flag[j], self.standard_mask[j],
|
||||||
mask = self.standard_mask[j]
|
_READER_REQUIREMENTS_DISPLAY[self.standard_flag[j]])
|
||||||
msg += '\n Feature {0:03d}: {1}'.format(sfl, mask)
|
msg += '\n Feature {0:03d}: 0x{1:x} {2}'.format(*args)
|
||||||
|
|
||||||
msg += '\n Standard Features:'
|
|
||||||
for j in range(len(self.standard_flag)):
|
|
||||||
sfl = self.standard_flag[j]
|
|
||||||
rrdisp = _READER_REQUIREMENTS_DISPLAY[self.standard_flag[j]]
|
|
||||||
msg += '\n Feature {0:03d}: {1}'.format(sfl, rrdisp)
|
|
||||||
|
|
||||||
msg += '\n Vendor Features:'
|
msg += '\n Vendor Features:'
|
||||||
for j in range(len(self.vendor_feature)):
|
for j in range(len(self.vendor_feature)):
|
||||||
|
|
|
||||||
|
|
@ -683,14 +683,10 @@ Contiguous Codestream Box (jp2c) @ (3223, 1132296)"""
|
||||||
|
|
||||||
# Output of reader requirement printing for file7.jp2
|
# Output of reader requirement printing for file7.jp2
|
||||||
file7_rreq = r"""Reader Requirements Box (rreq) @ (44, 24)
|
file7_rreq = r"""Reader Requirements Box (rreq) @ (44, 24)
|
||||||
Fully Understands Aspect Mask: 160
|
Fully Understands Aspect Mask: 0xa0
|
||||||
Display Completely Mask: 192
|
Display Completely Mask: 0xc0
|
||||||
Standard Features and Masks:
|
Standard Features and Masks:
|
||||||
Feature 005: 128
|
Feature 005: 0x80 Unrestricted JPEG 2000 Part 1 codestream, ITU-T Rec. T.800 | ISO/IEC 15444-1
|
||||||
Feature 060: 96
|
Feature 060: 0x60 e-sRGB enumerated colorspace
|
||||||
Feature 043: 64
|
Feature 043: 0x40 Deprecated - compositing layer uses restricted ICC profile
|
||||||
Standard Features:
|
|
||||||
Feature 005: Unrestricted JPEG 2000 Part 1 codestream, ITU-T Rec. T.800 | ISO/IEC 15444-1
|
|
||||||
Feature 060: e-sRGB enumerated colorspace
|
|
||||||
Feature 043: Deprecated - compositing layer uses restricted ICC profile
|
|
||||||
Vendor Features:"""
|
Vendor Features:"""
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class TestPrinting(unittest.TestCase):
|
||||||
with self.assertRaises(TypeError):
|
with self.assertRaises(TypeError):
|
||||||
glymur.set_printoptions(hi='low')
|
glymur.set_printoptions(hi='low')
|
||||||
|
|
||||||
def test_printopt_no_codestr_then_no_xml(self):
|
def test_propts_no_codestream_then_no_xml(self):
|
||||||
"""Verify printed output when codestream=False and xml=False, #162"""
|
"""Verify printed output when codestream=False and xml=False, #162"""
|
||||||
# The print options should be persistent across invocations.
|
# The print options should be persistent across invocations.
|
||||||
glymur.set_printoptions(codestream=False)
|
glymur.set_printoptions(codestream=False)
|
||||||
|
|
@ -629,7 +629,7 @@ class TestPrinting(unittest.TestCase):
|
||||||
def test_xml_latin1(self):
|
def test_xml_latin1(self):
|
||||||
"""Should be able to print an XMLBox with utf-8 encoding (latin1)."""
|
"""Should be able to print an XMLBox with utf-8 encoding (latin1)."""
|
||||||
# Seems to be inconsistencies between different versions of python2.x
|
# Seems to be inconsistencies between different versions of python2.x
|
||||||
# as to what gets printed.
|
# as to what gets printed.
|
||||||
#
|
#
|
||||||
# 2.7.5 (fedora 19) prints xml entities.
|
# 2.7.5 (fedora 19) prints xml entities.
|
||||||
# 2.7.3 seems to want to print hex escapes.
|
# 2.7.3 seems to want to print hex escapes.
|
||||||
|
|
@ -658,7 +658,7 @@ class TestPrinting(unittest.TestCase):
|
||||||
def test_xml_cyrrilic(self):
|
def test_xml_cyrrilic(self):
|
||||||
"""Should be able to print an XMLBox with utf-8 encoding (cyrrillic)."""
|
"""Should be able to print an XMLBox with utf-8 encoding (cyrrillic)."""
|
||||||
# Seems to be inconsistencies between different versions of python2.x
|
# Seems to be inconsistencies between different versions of python2.x
|
||||||
# as to what gets printed.
|
# as to what gets printed.
|
||||||
#
|
#
|
||||||
# 2.7.5 (fedora 19) prints xml entities.
|
# 2.7.5 (fedora 19) prints xml entities.
|
||||||
# 2.7.3 seems to want to print hex escapes.
|
# 2.7.3 seems to want to print hex escapes.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue