Browse Source

setPixel(): throw an error in case invalid coordinates are specified

feature/balanceutils
Fr3deric 8 years ago committed by Frederic
parent
commit
c21452ce80
  1. 4
      blup/frame.py

4
blup/frame.py

@ -122,6 +122,10 @@ class Frame(object):
for v in value: for v in value:
if v < 0 or v >= self.__dimension.depth: if v < 0 or v >= self.__dimension.depth:
raise ValueError('pixel value not in depth range') raise ValueError('pixel value not in depth range')
if x < 0 or x >= self.dimension.width:
raise ValueError('invalid x coordinate')
if y < 0 or y >= self.dimension.height:
raise ValueError('invalid y coordinate')
self.__pixels[y][x] = value self.__pixels[y][x] = value

Loading…
Cancel
Save