MCPcopy Create free account
hub / github.com/kiibohd/controller / setpixel

Method setpixel

Scan/Devices/STLcd/bitmap2Struct.py:45–59  ·  view source on GitHub ↗
( self, x, y )

Source from the content-addressed store, hash-verified

43 self.page_data.append( array( 'B', [0] * self.page_length ) )
44
45 def setpixel( self, x, y ):
46 # Calculate which page
47 page = int( ( self.height - y ) / self.page_width )
48
49 if page == 4:
50 print("YAR", (x,y))
51
52 # Calculate which byte
53 byte = x
54
55 # Calculate which bit
56 bit = int( ( self.height - y ) % self.page_width )
57
58 # Set pixel bit
59 self.page_data[ page ][ byte ] |= (1 << bit)
60
61 def getpage( self, page ):
62 return self.page_data[ page ]

Callers 1

prepare_viewMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected