Pylint work, #99

This commit is contained in:
John Evans 2013-08-10 14:39:25 -04:00
commit fbc9bbcf14
3 changed files with 673 additions and 582 deletions

View file

@ -807,6 +807,8 @@ class COCsegment(Segment):
Coding style for this component.
spcoc : byte array
Coding style parameters for this component.
precinct_size : list of tuples
Dimensions of precinct.
References
----------
@ -820,13 +822,13 @@ class COCsegment(Segment):
self.scoc = scoc
self.spcoc = spcoc
self._code_block_size = (4 * math.pow(2, self.spcoc[2]),
4 * math.pow(2, self.spcoc[1]))
self.code_block_size = (4 * math.pow(2, self.spcoc[2]),
4 * math.pow(2, self.spcoc[1]))
if len(self.spcoc) > 5:
self._precinct_size = _parse_precinct_size(self.spcoc[5:])
self.precinct_size = _parse_precinct_size(self.spcoc[5:])
else:
self._precinct_size = None
self.precinct_size = None
self.length = length
self.offset = offset
@ -847,16 +849,16 @@ class COCsegment(Segment):
msg += '\n Code block height, width: ({1} x {2})'
msg += '\n Wavelet transform: {3}'
msg = msg.format(self.spcoc[0] + 1,
int(self._code_block_size[0]),
int(self._code_block_size[1]),
int(self.code_block_size[0]),
int(self.code_block_size[1]),
_WAVELET_TRANSFORM_DISPLAY[self.spcoc[4]])
msg += '\n '
msg += _context_string(self.spcoc[3])
if self._precinct_size is not None:
if self.precinct_size is not None:
msg += '\n Precinct size: '
for pps in self._precinct_size:
for pps in self.precinct_size:
msg += '(%d, %d)'.format(pps)
return msg
@ -876,10 +878,16 @@ class CODsegment(Segment):
two bytes constituting the marker.
scod : int
Default coding style.
layers : int
Quality layers.
code_block_size : tuple
Size of code block.
spcod : bytes
Coding style parameters, including quality layers, multicomponent
transform usage, decomposition levels, code block size, style of code-
block passes, and which wavelet transform is used.
Encoded coding style parameters, including quality layers,
multi component transform usage, decomposition levels, code block size,
style of code-block passes, and which wavelet transform is used.
precinct_size : list of tuples
Dimensions of precinct.
References
----------
@ -895,7 +903,7 @@ class CODsegment(Segment):
self.offset = offset
params = struct.unpack('>BHBBBBBB', self.spcod[0:9])
self._layers = params[1]
self.layers = params[1]
self._numresolutions = params[3]
if params[3] > opj2.J2K_MAXRLVLS:
@ -906,12 +914,12 @@ class CODsegment(Segment):
cblk_width = 4 * math.pow(2, params[4])
cblk_height = 4 * math.pow(2, params[5])
code_block_size = (cblk_height, cblk_width)
self._code_block_size = code_block_size
self.code_block_size = code_block_size
if len(self.spcod) > 9:
self._precinct_size = _parse_precinct_size(self.spcod[9:])
self.precinct_size = _parse_precinct_size(self.spcod[9:])
else:
self._precinct_size = None
self.precinct_size = None
def __str__(self):
msg = Segment.__str__(self)
@ -944,18 +952,18 @@ class CODsegment(Segment):
msg += '\n '.join(lines)
msg = msg.format(_PROGRESSION_ORDER_DISPLAY[self.spcod[0]],
self._layers,
self.layers,
mct,
self.spcod[4] + 1,
int(self._code_block_size[0]),
int(self._code_block_size[1]),
int(self.code_block_size[0]),
int(self.code_block_size[1]),
_WAVELET_TRANSFORM_DISPLAY[self.spcod[8]])
msg += '\n Precinct size: '
if self._precinct_size is None:
if self.precinct_size is None:
msg += 'default, 2^15 x 2^15'
else:
for pps in self._precinct_size:
for pps in self.precinct_size:
msg += '({0}, {1})'.format(pps[0], pps[1])
msg += '\n '
@ -1411,7 +1419,11 @@ class SIZsegment(Segment):
xtosiz, ytosiz : int
Horizontal and vertical offsets of tile from origin of reference grid.
ssiz : iterable bytes
Precision (depth) in bits and sign of each component.
Encoded precision (depth) in bits and sign of each component.
bitdepth : iterable bytes
Precision (depth) in bits of each component.
signed : iterable bool
Signedness of each component.
xrsiz, yrsiz : int
Horizontal and vertical sample separations with respect to reference
grid.
@ -1459,8 +1471,8 @@ class SIZsegment(Segment):
self.xrsiz = data[1::3]
self.yrsiz = data[2::3]
self._bitdepth = tuple(((x & 0x7f) + 1) for x in self.ssiz)
self._signed = tuple(((x & 0xb0) > 0) for x in self.ssiz)
self.bitdepth = tuple(((x & 0x7f) + 1) for x in self.ssiz)
self.signed = tuple(((x & 0xb0) > 0) for x in self.ssiz)
self.length = length
self.offset = offset
@ -1483,8 +1495,8 @@ class SIZsegment(Segment):
self.yosiz, self.xosiz,
self.ytsiz, self.xtsiz,
self.ytosiz, self.xtosiz,
self._bitdepth,
self._signed,
self.bitdepth,
self.signed,
tuple(zip(self.yrsiz, self.xrsiz)))
return msg

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff