luadoc: add selection documentation
[awesome.git] / luadoc / image.lua
blobe4d369c066b8fb5dc9e307a044730f8ba34b03f0
1 --- awesome image API
2 -- @author Julien Danjou <julien@danjou.info>
3 -- @copyright 2008-2009 Julien Danjou
4 module("image")
6 --- Image objects.
7 -- @field width The image width. Immutable.
8 -- @field height The image height. Immutable.
9 -- @field alpha Boolean indiacating if the image alpha channel is present.
10 -- @class table
11 -- @name image
13 --- Performs 90 degree rotations on the current image. Passing 0 orientation does not rotate, 1
14 -- rotates clockwise by 90 degree, 2, rotates clockwise by 180 degrees, 3 rotates clockwise by 270
15 -- degrees.
16 -- @param rotation The rotation to perform.
17 -- @name rotate
18 -- @class function
20 --- Rotate an image with specified angle radians and return a new image.
21 -- @param angle The angle in radians.
22 -- @return A rotated image.
23 -- @name rotate
24 -- @class function
26 --- Crop an image to the given rectangle.
27 -- @param x The top left x coordinate of the rectangle.
28 -- @param y The top left y coordinate of the rectangle.
29 -- @param width The width of the rectangle.
30 -- @param height The height of the rectangle.
31 -- @return A cropped image.
32 -- @name crop
33 -- @class function
35 --- Crop the image to the given rectangle and scales it.
36 -- @param x The top left x coordinate of the source rectangle.
37 -- @param y The top left y coordinate of the source rectangle.
38 -- @param width The width of the source rectangle.
39 -- @param height The height of the source rectangle.
40 -- @param dest_width The width of the destination rectangle.
41 -- @param dest_height The height of the destination rectangle.
42 -- @param A cropped image.
43 -- @name crop_and_scale
44 -- @class function
46 --- Draw a pixel in an image.
47 -- @param x The x coordinate of the pixel to draw.
48 -- @param y The y coordinate of the pixel to draw.
49 -- @param The color to draw the pixel in.
50 -- @name draw_pixel
51 -- @class function
53 --- Draw a line in an image.
54 -- @param x1 The x1 coordinate of the line to draw.
55 -- @param y2 The y1 coordinate of the line to draw.
56 -- @param x2 The x2 coordinate of the line to draw.
57 -- @param y2 The y2 coordinate of the line to draw.
58 -- @param color The color to draw the line in.
59 -- @name draw_line
60 -- @class function
62 --- Draw a rectangle in an image.
63 -- @param x The x coordinate of the rectangles top left corner.
64 -- @param y The y coordinate of the rectangles top left corner.
65 -- @param width The width of the rectangle.
66 -- @param height The height of the rectangle.
67 -- @param fill True to fill the rectangle, false otherwise.
68 -- @param color The color to draw the rectangle with.
69 -- @name draw_rectangle
70 -- @class function
72 --- Draw a rectangle in an image with gradient color.
73 -- @param x The x coordinate of the rectangles top left corner.
74 -- @param y The y coordinate of the rectangles top left corner.
75 -- @param width The width of the rectangle.
76 -- @param height The height of the rectangle.
77 -- @param colors A table with the color to draw the rectangle. You can specified the color
78 -- distance from the previous one by setting t[color] = distance.
79 -- @param angle The angle of the gradient.
80 -- @name draw_rectangle_gradient
81 -- @class function
83 --- Draw a circle in an image.
84 -- @param x The x coordinate of the center of the circle.
85 -- @param y The y coordinate of the center of the circle.
86 -- @param width The horizontal amplitude.
87 -- @param height The vertical amplitude.
88 -- @param fill True if the circle should be filled, false otherwise.
89 -- @param color The color to draw the circle with.
90 -- @name draw_circle
91 -- @class function
93 --- Saves the image to the given path. The file extension (e.g. .png or .jpg) will affect the
94 -- output format.
95 -- @param path An image path.
96 -- @name save
97 -- @class function
99 --- Insert one image into another.
100 -- @param image The image to insert.
101 -- @param offset_x The x offset of the image to insert (optional).
102 -- @param ofsset_y The y offset of the image to insert (optional).
103 -- @param offset_h_up_right The horizontal offset of the upper right image corner (optional).
104 -- @param offset_v_up_right The vertical offset of the upper right image corner (optional).
105 -- @param offset_h_low_left The horizontal offset of the lower left image corner (optional).
106 -- @param offset_v_low_left The vertical offset of the lower left image corner (optional).
107 -- @param source_x The x coordinate of the source rectangle (optional).
108 -- @param source_y The y coordinate of the source rectangle (optional).
109 -- @param source_width The width of the source rectangle (optional).
110 -- @param source_height The height of the source rectangle (optional).
111 -- @name insert
112 -- @class function
114 --- Add a signal.
115 -- @param name A signal name.
116 -- @param func A function to call when the signal is emited.
117 -- @name add_signal
118 -- @class function
120 --- Remove a signal.
121 -- @param name A signal name.
122 -- @param func A function to remove.
123 -- @name remove_signal
124 -- @class function
126 --- Emit a signal.
127 -- @param name A signal name.
128 -- @param ... Various arguments, optional.
129 -- @name emit_signal
130 -- @class function