componentmapping box
This commit is contained in:
parent
256ebbf9ec
commit
ab75ffdca3
1 changed files with 15 additions and 8 deletions
|
|
@ -946,19 +946,26 @@ class ComponentMappingBox(Jp2kBox):
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
msg = Jp2kBox.__str__(self)
|
title = Jp2kBox.__str__(self)
|
||||||
if _printoptions['short'] is True:
|
if _printoptions['short'] is True:
|
||||||
return msg
|
return title
|
||||||
|
|
||||||
|
lst = []
|
||||||
for k in range(len(self.component_index)):
|
for k in range(len(self.component_index)):
|
||||||
if self.mapping_type[k] == 1:
|
if self.mapping_type[k] == 1:
|
||||||
msg += '\n Component {0} ==> palette column {1}'
|
text = 'Component {0} ==> palette column {1}'
|
||||||
msg = msg.format(self.component_index[k],
|
text = text.format(self.component_index[k],
|
||||||
self.palette_index[k])
|
self.palette_index[k])
|
||||||
else:
|
else:
|
||||||
msg += '\n Component {0} ==> {1}'
|
text = 'Component {0} ==> {1}'
|
||||||
msg = msg.format(self.component_index[k], k)
|
text = text.format(self.component_index[k], k)
|
||||||
return msg
|
lst.append(text)
|
||||||
|
|
||||||
|
text = '\n'.join(lst)
|
||||||
|
text = self._indent(text)
|
||||||
|
text = '\n'.join([title, text])
|
||||||
|
|
||||||
|
return text
|
||||||
|
|
||||||
def write(self, fptr):
|
def write(self, fptr):
|
||||||
"""Write a Component Mapping box to file.
|
"""Write a Component Mapping box to file.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue