The Image class provides an interface to work with images and textures. The individual pixels of the image can be read or changed by the simulation as desired.The image class can read rendered images from the screen using the method read-pixels, so that agents in the 3D world can have access to real rendered data. In addition, the method get-pixel-pointer can be used to provide a pointer to the RGBA pixel data so that plugins can access and analyze image data. This could be used, among other things, to implement agent vision.
Returns the alpha channel pixel at the image coordinates (x, y). The pixel value is given on a scale from 0.0 to 1.0.
Returns the blue pixel at the image coordinates (x, y). The pixel value is given on a scale from 0.0 to 1.0.
Compresses the image and returns the compression size. Useful for generating simple complexity measures based on image compression.
Returns the green pixel at the image coordinates (x, y). The pixel value is given on a scale from 0.0 to 1.0.
Returns the width of the image.
Returns a pointer to the pixels this image is holding in RGBA format. The size of the buffer is 4 * height * width. This data is provided for plugin developers who wish to read or write pixel data directly.
Returns the red pixel at the image coordinates (x, y). The pixel value is given on a scale from 0.0 to 1.0.
Returns the red, green and blue components of the pixel at image coordinates (x, y) as a vector.
Internal use only.
Returns the width of the image.
Deprecated.
Loads an image from the file imageFile.
Reads the depth into this Image from the rendered image on the screen. The resulting image can be written to a file or analyzed if desired. This is only supported in graphical versions of breve. The linearize option (if true) linearizes the depth buffer to a maximum distance so that for each pixel, the value corresponds to the distance from the centre of the camera. Values above the maximum distance (max-dist) are set to the maximum distance. If linearize is false, then this returns the raw depth buffer. This is considerably faster, but the values are not linear in the distance.
Reads pixels into this Image from the rendered image on the screen. The resulting image can be written to a file or analyzed if desired. This is only supported in graphical versions of breve.
Sets the alpha pixel value at coordinates (x, y) to alphaPixel. alphaPixel should be a value between 0.0 and 1.0.
Sets the blue pixel value at coordinates (x, y) to bluePixel. bluePixel should be a value between 0.0 and 1.0.
Sets the green pixel value at coordinates (x, y) to greenPixel. greenPixel should be a value between 0.0 and 1.0.
Deprecated -- for compatibility only.
Sets the red pixel value at coordinates (x, y) to redPixel. redPixel should be a value between 0.0 and 1.0.
Sets the red, green and blue pixel values at image coordinates (x, y) from the values in pixelVector.
Creates an empty image buffer with width imageWidth and length imageLength.
Write the image to imageFile. The image is written as a PNG file, so imageFile should end with .PNG.
Write the image to imageFile. The image is written as a PNG file, so imageFile should end with .PNG.