- leftmost = 15 #Initial value
- for y in range(16): #Loop by rows
- count = 0 #Count keeps track of the pixel position
- pos = 128 * y + 40 #Offset to the start of a row
- for x in range(8): #Loop now by the column. This keeps track of bytes
- if data[pos] >> 4 > 0: #Checking the first pixel in the byte for non-zero value
- if leftmost > count: #Update leftmost (if appropriate)
- leftmost = count
- break
- count += 1 #Increment pixel counter
- if data[pos] & 15 > 0: #Checking the 2nd pixel in the byte for non-zero value
- if leftmost > count: #Update leftmost (if appropriate)
- leftmost = count
- break
- count += 1 #Increment pixel counter
SHARE
TWEET

QB Image Processing Pseudocode




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.