starting work to allow full resolution slicing
This commit is contained in:
parent
3adb09e6f4
commit
276a74ecaa
1 changed files with 37 additions and 28 deletions
|
|
@ -770,10 +770,19 @@ class Jp2k(Jp2kBox):
|
||||||
else:
|
else:
|
||||||
raise IndexError("Illegal syntax.")
|
raise IndexError("Illegal syntax.")
|
||||||
|
|
||||||
if isinstance(pargs[0], tuple):
|
if not isinstance(pargs[0], tuple):
|
||||||
|
msg = "Unexpected situation, slicing invoked, but not passed "
|
||||||
|
msg += "a slice or tuple."
|
||||||
|
raise RuntimeError(msg)
|
||||||
|
|
||||||
|
# Assuming tuple from now on.
|
||||||
ridx = pargs[0][0]
|
ridx = pargs[0][0]
|
||||||
cidx = pargs[0][1]
|
cidx = pargs[0][1]
|
||||||
|
|
||||||
|
if ((ridx.step is None) and (cidx.step is None)):
|
||||||
|
# Slicing with full resolution.
|
||||||
|
return self.read()[ridx, cidx]
|
||||||
|
|
||||||
if ((ridx.start is not None) or
|
if ((ridx.start is not None) or
|
||||||
(ridx.stop is not None) or
|
(ridx.stop is not None) or
|
||||||
(cidx.start is not None) or
|
(cidx.start is not None) or
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue