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

Method center_image

Scan/Devices/STLcd/bitmap2Struct.py:148–154  ·  view source on GitHub ↗
(self, input_image)

Source from the content-addressed store, hash-verified

146 )
147
148 def center_image(self, input_image):
149 # Center the image
150 height_start = int( ( self.max_height - input_image.size[1] ) / 2 )
151 height_end = int( height_start + input_image.size[1] )
152 width_start = int( ( self.max_width - input_image.size[0] ) / 2 )
153 width_end = int( width_start + input_image.size[0] )
154 return height_start, height_end, width_start, width_end
155
156 def prepare_view(self, input_image, height_start, height_end, width_start, width_end):
157 # Iterate over all of the pixels

Callers 1

prepMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected