Bases: Boost.Python.instance
Class representing a rectangular set of pixels. Bitmaps can be obtained from any RasterNode. For nodes of type Image, the current bitmap can be set as well.
The layout of the pixels in the bitmap is determined by it’s pixel format. Possible return values are B5G6R5, B8G8R8, B8G8R8A8, B8G8R8X8, A8B8G8R8, X8B8G8R8, R5G6B5, R8G8B8, R8G8B8A8, R8G8B8X8, A8R8G8B8, X8R8G8B8, I8 and YCbCr422.
Creates an uninitialized bitmap of the given size and pixel format. name is a name to be used in debug output.
Creates a copy of an already existing bitmap.
Loads an image file from disk and returns it as bitmap object.
Returns the average of all bitmap pixels.
Returns the bitmap’s pixel format.
Returns one image pixel als a color tuple. This should only be used for single pixels, as it is very slow.
Returns the raw pixel data in the bitmap as a python string. This method can be used to interface to the python imaging library PIL (http://www.pythonware.com/products/pil/).
Returns the size of the image in pixels.
Returns the standard deviation of all bitmap pixels.
Writes the image to a file. File format is determined using the extension. Any file format supported by ImageMagick (http://www.imagemagick.org) can be used.
Changes the raw pixel data in the bitmap. Doesn’t change dimensions or pixel format. Can be used to interface to the python imaging library PIL (http://www.pythonware.com/products/pil/).
| Parameters: |
|
|---|
Subtracts two bitmaps and returns the result. Used mainly to compare test images with the intended results (along with getAvg() and getStdDev()).
Bases: Boost.Python.instance
Interface to one or more conrad relais cards connected to a serial port. Per card, up to eight 220V devices can be connected.
Deprecated since version 1.5.
Opens a connection to the relais card(s) connected to a serial port.
| Parameters: |
|
|---|
Returns the state of one of the relais.
| Parameters: |
|
|---|
Returns the number of cards connected to the serial port.
Sets or resets one of the relais.
| Parameters: |
|
|---|
Bases: Boost.Python.instance
Interface to the logger used by the avg player. Enables the setting of different logging categories. Categories can be set either by calling Logger.setCategories or by setting the AVG_LOG_CATEGORIES environment variable. When set through the environment, log categories are separated by colons. In bash syntax:
export AVG_LOG_CATEGORIES=ERROR:WARNING:CONFIG:PROFILE
Log categories are:
Default categories are ERROR, WARNING and APP.
Log output is sent to the console (stderr). Each log entry contains the time the message was written, the category of the entry and the message itself.
Pops the current set of categories from the internal stack, restoring the state when the corresponding push was called.
Pushes the current set of categories on an internal stack. Useful for saving and restoring the logging state so it can be changed for a short amount of time.
Sets the types of messages that should be logged. categories is an or’ed sequence of categories.
Logs message to the log if category is active.
| Parameters: |
|
|---|
This method gives access to the logger. There is only one instance.
Bases: Boost.Python.instance
Used for low-level control of the parallel port’s data, status and control lines. Linux only.
Deprecated since version 1.5.
Opens a parallel port.
| Parameters: |
|
|---|
Clears data lines.
| Parameters: |
|
|---|---|
| Returns: | True if the lines were cleared, False otherwise. |
Returns the value of one of the parallel port status lines.
| Parameters: |
|
|---|---|
| Returns: | True if the line is set. |
Returns True if the parallel port has been opened successfully, False otherwise.
Changes the value of all data lines.
| Parameters: |
|
|---|---|
| Returns: | True if the lines were set, False otherwise. |
Sets or clears one of the control lines.
| Parameters: |
|
|---|---|
| Returns: | True if the value was set successfully, False otherwise. |
Sets data lines.
| Parameters: |
|
|---|---|
| Returns: | True if the lines were set, False otherwise. |
Bases: Boost.Python.instance
A point in 2D space. Supports most arithmetic operations on vectors. The operators +, -, == and != are defined for two Point2D parameters. Unary - (negation) is defined as well. Point2D objects can also be multiplied and divided by a scalar.
Point2D implicitly converts from and to 2-element float tuples and lists, so in most cases you can use one of these types whenever a point is needed.
Creates a point initialized to (0,0).
Returns the euclidian norm of the point, that is sqrt(x*x+y*y).
Returns a normalized version of the point with the same angle but a norm of one. Throws an exception if called on Point2D(0,0).
Return the position of point rotated around the origin.
Return the position of point rotated around pivot.
Returns True if one of the components is infinite.
Returns True if one of the components is Not a Number.
Converts polar to cartesian coordinates. angle is in radians with 0 being the positive x axis. Angle is clockwise (assuming that y points downward).
Bases: Boost.Python.instance
Miscellaneous routines used by tests. Not intended for normal application usage.
Returns the amount of memory used by the application in bytes. More precisely, this function returns the resident set size of the process in bytes. This does not include shared libraries or memory paged out to disk.
Checks if a point is inside a polygon.
| Parameters: |
|
|---|---|
| Returns: | True if point is inside, False otherwise. |