Skip to content

Commit 97d197e

Browse files
author
Jonathan Dahan
committed
remove comments
1 parent 3959f9b commit 97d197e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_framebuf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ class GS2HMSBFormat:
4646
@staticmethod
4747
def set_pixel(framebuf, x, y, color):
4848
"""Set a given pixel to a color."""
49-
index = (y * framebuf.stride + x) >> 2 # why 2?
49+
index = (y * framebuf.stride + x) >> 2
5050
pixel = framebuf.buf[index]
5151

52-
shift = (x & 0b11) << 1 # why 1?
52+
shift = (x & 0b11) << 1
5353
mask = 0b11 << shift
5454
color = (color & 0b11) << shift
5555

@@ -58,10 +58,10 @@ def set_pixel(framebuf, x, y, color):
5858
@staticmethod
5959
def get_pixel(framebuf, x, y):
6060
"""Get the color of a given pixel"""
61-
index = (y * framebuf.stride + x) >> 2 # same as // 8? why?
61+
index = (y * framebuf.stride + x) >> 2
6262
pixel = framebuf.buf[index]
6363

64-
shift = (x & 0b11) << 1 # why 1?
64+
shift = (x & 0b11) << 1
6565
return (pixel >> shift) & 0b11
6666

6767
@staticmethod

0 commit comments

Comments
 (0)