Package pyrobot :: Package camera :: Package fake :: Class ManualFakeCamera
[frames | no frames]

Class ManualFakeCamera

      Device --+    
               |    
PyrobotImage --+    
               |    
          Camera --+
                   |
                  ManualFakeCamera


camera = ManualFakeCamera(w, h, d)

Used when you are creating the image from Python, and wish
to have the camera class show or manipulate the image.

Currently only depth 3 works.

Values in camera array are ints between 0 and 255.

Method Summary
  __init__(self, width, height, depth)
  blankImage(self, val)
  setGrayImage(self, array)
Will set the RGB camera image from a grayscale array (depth 1) assuming column major order.
  setRGBImage(self, array)
Will set the RGB camera image from a RGB array (depth 3) assuming column major order.
    Inherited from Camera
  addFilter(self, func, *args)
Add a filter to the filter list.
  apply(self, command, *args)
  clearCallbackList(self)
  clearFilters(self)
  delFilter(self, pos)
  getCanvasHeight(self)
  getCanvasWidth(self)
  getData(self)
  getDeviceData(self)
Returns the device data, whatever it might be.
  getDeviceState(self)
Returns the .state.
  getFilterList(self)
  getImage(self)
  hideWindow(self)
  listCallbackList(self)
  loadFilters(self)
  makeFilterMenu(self, data)
  makeMenu(self, bar, name, commands)
Assumes self.menuButtons exists...
  makeWindow(self)
Method to make and show the device window.
  pauseButton(self)
  playButton(self)
  popCallbackList(self)
  popFilterList(self)
  printit(self, event)
  processAll(self)
  processLeftClickDown(self, event)
  processLeftClickUp(self, event)
  processMiddleClick(self, event)
  processRightClick(self, event)
  saveAsTGA(self, path)
Save a copy of the image to disk, in TGA format (Gimp and display can read it).
  saveFilters(self)
  saveImage(self)
  setFilterList(self, filterList)
Filters take the form: ("name", (args))...
  setTitle(self, title)
Sets the title of the device.
  setUpdateInterval(self, val)
  startDevice(self)
Starts the device (sets the .state).
  stopDevice(self)
Stops the device (sets the .state).
  toggleFilterMode(self)
  togglePlay(self, event)
  update(self)
Update method for getting next sequence from a video camera.
  updateButton(self)
  updateDevice(self)
Method called to update the device properties.
  updateOnce(self)
  updateWindow(self)
Method to update the device window.
    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.
  display(self)
Display PyrobotImage in ASCII Art.
  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)
    Inherited from Device
  __getitem__(self, item)
Get a SensorValue, a range, or a set.
  __iter__(self)
Used to iterate through SensorValues of device.
  addWidgets(self, window)
Method to addWidgets to the device window.
  angle(self, *args, **kwargs)
Device-level method to get all of the angles.
  destroy(self)
Hides the window.
  distance(self, *args, **kwargs)
Device-level method to get all of the distances.
  getActive(self)
Returns the value of .active.
  getGroupNames(self, pos)
Return all of the groups a pos is in.
  getMaxvalue(self)
Get the maxvalue of the sensor.
  getSensorValue(self, pos)
Returns a specific SensorValue from the range device.
  getVisible(self)
Returns the .visible of the sensor.
  rawToUnits(self, raw, noise, units)
Convert the sensor units into default units.
  setActive(self, value)
Sets the .active property.
  setMaxvalue(self, value)
Set the maxvalue of the sensor.
  setup(self)
Use this to put setup code in (instead of in __init__).
  setVisible(self, value)
Sets the .visible attribute, and hides/shows window.

Property Summary
    Inherited from Device
  geometry
  noise
  pos
  rawValue
  value

Method Details

setGrayImage(self, array)

Will set the RGB camera image from a grayscale array (depth 1)
assuming column major order.

setRGBImage(self, array)

Will set the RGB camera image from a RGB array (depth 3)
assuming column major order.

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