@@ -72,59 +72,3 @@ def data(self, dat):
7272 self .spi_device .write (dat )
7373 self ._cs .value = True
7474 self .spi_device .unlock ()
75-
76- def draw_pixel (self , x , y , color ):
77- pass
78-
79- #framebuf methods
80- def fill (self , color ):
81- self .fill_rect (self , 0 , 0 , self .width , self .height , color )
82-
83- def fill_rect (self , x , y , width , height , color ):
84- if width < 1 or height < 1 or (x + width ) <= 0 :
85- return
86- if (y + height ) <= 0 or y >= self .height or x >= self .width :
87- return
88- xend = min (self .width , x + width )
89- yend = min (self .height , y + height )
90- x = max (x , 0 )
91- y = max (y , 0 )
92- for _x in range (xend - x ):
93- for _y in range (yend - y ):
94- self .draw_pixel (x + _x , y + _y , color )
95- return
96-
97- def pixel (self , x , y , color = None ):
98- if x < 0 or x >= self .width or y < 0 or y >= self .height :
99- return None
100- #TODO: figure this out when we know what framebuffer we
101- # will actually use
102- #if color is None:
103- # return self.get_pixel(self, x, y)
104-
105- self .draw_pixel (self , x , y , color )
106- return None
107-
108- def hline (self , x , y , width , color ):
109- self .fill_rect (x , y , width , 1 , color )
110-
111- def vline (self , x , y , height , color ):
112- self .fill_rect (x , y , 1 , height , color )
113-
114- def rect (self , x , y , width , height , color ):
115- self .fill_rect (x , y , width , 1 , color )
116- self .fill_rect (x , y + height , width , 1 , color )
117- self .fill_rect (self , x , y , 1 , height , color )
118- self .fill_rect (self , x + width , y , 1 , height , color )
119-
120- def line (self ):
121- raise NotImplementedError ()
122-
123- def blit (self ):
124- raise NotImplementedError ()
125-
126- def scroll (self ):
127- raise NotImplementedError ()
128-
129- def text (self ):
130- raise NotImplementedError ()
0 commit comments