# Encoding: UTF-8ever again :) (UTF-8 is the default now.)
to_blobon it (be sure to cache the result) and parse the binary data. Something like:
def (x, y) # Returns a binary string with r/g/b/a as the characters
@blob ||= self.to_blob
if x < 0 or x >= width or y < 0 or y >= height
"\0\0\0\0" # return transparent pixels by default; you could also return nil
@blob[(y * width + x) * 4, 4]
some_image[x, y] # to read a pixel
||=operator does the caching here.
record-ed ones), unlike
gl_tex_infoetc. which can fail for very large images.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill