(self, index)
return self._pixels[self._convert_slice(index)]
Get pixels in viewport.
Get pixels in viewport.
Get pixels in viewport .
def __getitem__(self, index):
        """Get pixels in viewport."""
        yslice, xslice = index
        if not isinstance(yslice, slice) and not isinstance(xslice, slice):
            # single pixel read can go outside of viewport
            x, y = self._convert_coords(xslice, yslice)
            return self._pixels[y, x]
        return self._pixels[self._convert_slice(index)]
def __getitem__ ( self , index ) : yslice , xslice = index if not isinstance ( yslice , slice ) and not isinstance ( xslice , slice ) : # single pixel read can go outside of viewport x , y = self . _convert_coords ( xslice , yslice ) return self . _pixels [ y , x ] return self . _pixels [ self . _convert_slice ( index ) ]