SHARE
TWEET

QB Image Processing Pseudocode

a guest Nov 10th, 2015 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. leftmost = 15           #Initial value
  2. for y in range(16):     #Loop by rows
  3.         count = 0       #Count keeps track of the pixel position
  4.         pos = 128 * y + 40                              #Offset to the start of a row
  5.         for x in range(8):                              #Loop now by the column. This keeps track of bytes
  6.                 if data[pos] >> 4 > 0:                  #Checking the first pixel in the byte for non-zero value
  7.                         if leftmost > count:            #Update leftmost (if appropriate)
  8.                                 leftmost = count
  9.                                 break
  10.                 count += 1                              #Increment pixel counter
  11.                 if data[pos] & 15 > 0:                  #Checking the 2nd pixel in the byte for non-zero value
  12.                         if leftmost > count:            #Update leftmost (if appropriate)
  13.                                 leftmost = count
  14.                                 break
  15.                 count += 1                              #Increment pixel counter
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. OK, I Understand
 
Top