Package pyrobot :: Package vision :: Class Bitmap
[frames | no frames]

Class Bitmap

PyrobotImage --+
               |
              Bitmap


Bitmap class. Based on Image, but has methods for blobs, etc.

Method Summary
  __init__(self, width, height, init_val)
  avgColor(self, img)
Return an n-tuple of the average color of the image where the bitmap is true, where n is the depth of img.
  display(self)
Display bitmap ASCII art.
    Inherited from PyrobotImage
  convolve(self, convmask, bit, threshold)
  cropPixels(self, l, t, r, b)
cropPixels() ------------ crops pixels in the amount specified from left, top, right, and bottom if unspecified, right is assumed to be the same as left and bottom the same as top.
  get(self, x, y, offset)
Get a pixel value.
  getBitmap(self, cutoff, cutoff2, mode)
getBitmap()...
  getCol(self, x)
Get the entire col, in tuples...
  getColorFilter(self, r, g, b)
returns a filtered image r,g,b values indicate percentage of each color to keep eg.
  getDim(self)
  getGrayScale(self)
Method to convert depth 3 color into depth 1 grayscale...
  getPlane(self, colorPlane)
  getRow(self, y)
Get the entire row, in tuples...
  getScaledImage(self, xscale, yscale, mode)
return a scaled version of the current image...
  getVal(self, x, y)
Get the entire color value of the pixel in quetion, returned as a tuple.
  histogram(self, cols, rows, initvals)
Creates a histogram.
  incr(self, x, y, offset)
Method to increment a pixel value.
  loadFromFile(self, filename)
Method to load image from file.
  reset(self, vector)
Reset an image to a vector.
  resetToColor(self, r, g, b)
reset the image to a specified color...
  saveToFile(self, filename)
Method to save image to a file.
  setVal(self, x, y, val)
Method to set the entire RGB value of a pixel.
  swapPlanes(self, plane1, plane2)

Method Details

avgColor(self, img)

Return an n-tuple of the average color of the image where the bitmap is true,
where n is the depth of img.  That is, using the bitmap as a mask, find the average color of img.
img and self should have the same dimensions.

display(self)

Display bitmap ASCII art.
Overrides:
pyrobot.vision.PyrobotImage.display

Generated by Epydoc 2.1 on Mon Jul 25 01:39:28 2005 http://epydoc.sf.net