.. _rimage: .. py:module:: rimage The class RImage =============== The class :py:class:`RImage` image represents raster images. You will have to implement it step by step along the lab sessions. The specification of the class will evolve along the course with new methods. .. py:class:: RImage (name, width=0, height=0, color=None, data=None) Creates an instance of the class with the given name. If color is not none, the image has the given width and height and is uniformly filled with the given color. Otherwise, if data is not None, it is a pixel_array and the image is filled with it. .. rubric:: Class methods .. py:method:: procedural(name) Returns an image created procedurally with the given procedure. .. py:method:: read(filename) Returns the image of the filename. The name of the image is the file basename. .. rubric:: Instance attributes: .. py:attribute:: name Name of the image (:py:class:`str`) .. rubric:: Instance methods: .. py:method:: width() Returns the width of the image .. py:method:: height() Returns the heigth of the image .. py:method:: nchannels() Returns the number of channels of the image .. py:method:: render_matplotlib(ax, params) Renders the image with matplotlib_ in the given subplot with the given parameters. .. rubric:: Supported operations +--------------------------+-------------------------------------------------+ | Operation | Result | +==========================+=================================================+ | ``ima[i, j]`` | Returns the color of the pixel (i, j) | | | :math:`0<=i