Nächste: Functions and Variables for worldmap, Vorige: Functions and Variables for draw, Nach oben: draw [Inhalt][Index]
Returns pixel from picture. Coordinates x and y range from 0 to
width-1
and height-1
, respectively.
Returns a levels picture object. make_level_picture(data)
builds the picture object from matrix data.
make_level_picture(data, width, height)
builds the
object from a list of numbers; in this case, both the width and the
height must be given.
The returned picture object contains the following four parts:
level
Example:
Level picture from matrix.
(%i1) load("draw")$ (%i2) make_level_picture(matrix([3,2,5],[7,-9,3000])); (%o2) picture(level, 3, 2, {Array: #(3 2 5 7 0 255)})
Level picture from numeric list.
(%i1) load("draw")$ (%i2) make_level_picture([-2,0,54,%pi],2,2); (%o2) picture(level, 2, 2, {Array: #(0 0 54 3)})
Returns an rgb-coloured picture object. All three arguments must be levels picture; with red, green and blue levels.
The returned picture object contains the following four parts:
rgb
Example:
(%i1) load("draw")$ (%i2) red: make_level_picture(matrix([3,2],[7,260])); (%o2) picture(level, 2, 2, {Array: #(3 2 7 255)}) (%i3) green: make_level_picture(matrix([54,23],[73,-9])); (%o3) picture(level, 2, 2, {Array: #(54 23 73 0)}) (%i4) blue: make_level_picture(matrix([123,82],[45,32.5698])); (%o4) picture(level, 2, 2, {Array: #(123 82 45 33)}) (%i5) make_rgb_picture(red,green,blue); (%o5) picture(rgb, 2, 2, {Array: #(3 54 123 2 23 82 7 73 45 255 0 33)})
Returns the negative of a (level or rgb) picture.
Returns true
in case of equal pictures, and false
otherwise.
Returns true
if the argument is a well formed image,
and false
otherwise.
Reads a file in xpm and returns a picture object.
Transforms an rgb picture into a level one by averaging the red, green and blue channels.
If argument color is red
, green
or blue
,
function take_channel
returns the corresponding color channel of
picture im.
Example:
(%i1) load("draw")$ (%i2) red: make_level_picture(matrix([3,2],[7,260])); (%o2) picture(level, 2, 2, {Array: #(3 2 7 255)}) (%i3) green: make_level_picture(matrix([54,23],[73,-9])); (%o3) picture(level, 2, 2, {Array: #(54 23 73 0)}) (%i4) blue: make_level_picture(matrix([123,82],[45,32.5698])); (%o4) picture(level, 2, 2, {Array: #(123 82 45 33)}) (%i5) make_rgb_picture(red,green,blue); (%o5) picture(rgb, 2, 2, {Array: #(3 54 123 2 23 82 7 73 45 255 0 33)}) (%i6) take_channel(%,'green); /* simple quote!!! */ (%o6) picture(level, 2, 2, {Array: #(54 23 73 0)})
Nächste: Functions and Variables for worldmap, Vorige: Functions and Variables for draw, Nach oben: draw [Inhalt][Index]