Module image
Funtions to create, convert and modify images
Functions
new (image_file) | Loads an image file onto the GPU memory. |
free (image) | Releases a image from memory. |
getwidth (image) | Gets the current width (in pixels) of the image. |
getinitialwidth (image) | Gets the width (in pixels) of the image. |
getheight (image) | Gets the current height (in pixels) of the image. |
getinitialheight (image) | Gets the height (in pixels) of the image. |
resize (image, width, height) | Resizes the image. |
getrotation (image) | Gets the rotation angle (in radians) of the image. |
rotate (image, angle) | Rotates the image. |
isvflip (image) | Checks if the image is vertically flipped. |
vflip (image, vflip) | Flips the image vertically. |
ishflip (image) | Checks if the image is horizontally flipped. |
hflip (image, hflip) | Flips the image vertically. |
getfilter (image) | Gets the image filter. |
setfilter (image, filter) | Sets the image filter. |
getpixel (image, x, y) | Gets the colour pixel of the image. |
setpixel (image, colour, x, y) | Sets the colour pixel of the image. |
tostring (image) | Gets the string representation of the image. |
Functions
- new (image_file)
-
Loads an image file onto the GPU memory.
Parameters:
- image_file Path of the image file.
Returns:
-
New image object.
- free (image)
-
Releases a image from memory.
Parameters:
- image The image which will be released.
- getwidth (image)
-
Gets the current width (in pixels) of the image.
If the image was modified, the returned value will be the value of the last modification. If you need the real one, you should use getinitialwidth.
Parameters:
- image An image object.
Returns:
-
Current width value (in pixels).
- getinitialwidth (image)
-
Gets the width (in pixels) of the image.
Parameters:
- image An image object.
Returns:
-
Width value (in pixels).
- getheight (image)
-
Gets the current height (in pixels) of the image.
If the image was modified, the returned value will be the value of the last modification. If you need the real one, you should use getinitialheight.
Parameters:
- image An image object.
Returns:
-
Current height value (in pixels).
- getinitialheight (image)
-
Gets the height (in pixels) of the image.
Parameters:
- image An image object.
Returns:
-
Height value (in pixels).
- resize (image, width, height)
-
Resizes the image.
Parameters:
- image An image object.
- width The new width (in pixels).
- height The new height (in pixels).
- getrotation (image)
-
Gets the rotation angle (in radians) of the image.
Parameters:
- image An image object.
Returns:
-
Rotation angle value (in radians).
- rotate (image, angle)
-
Rotates the image.
Parameters:
- image An image object.
- angle The new value (in radians).
- isvflip (image)
-
Checks if the image is vertically flipped.
Parameters:
- image An image object.
Returns:
-
true if the image is vertically flipped, false otherwise.
- vflip (image, vflip)
-
Flips the image vertically.
Parameters:
- image An image object.
- vflip True to flip the image vertically, false otherwise.
- ishflip (image)
-
Checks if the image is horizontally flipped.
Parameters:
- image An image object.
Returns:
-
true if the image is horizontally flipped, false otherwise.
- hflip (image, hflip)
-
Flips the image vertically.
Parameters:
- image An image object.
- hflip True to flip the image horizontally, false otherwise.
- getfilter (image)
-
Gets the image filter.
Parameters:
- image An image object.
Returns:
-
Current filter of the image.
- setfilter (image, filter)
-
Sets the image filter.
Parameters:
- image An image object.
- filter The filter to apply to the image.
- getpixel (image, x, y)
-
Gets the colour pixel of the image.
Parameters:
- image An image object.
- x x-axis image position (in pixels).
- y y-axis image position (in pixels).
- setpixel (image, colour, x, y)
-
Sets the colour pixel of the image.
Parameters:
- image An image object.
- colour An colour object.
- x x-axis image position (in pixels).
- y y-axis image position (in pixels).
- tostring (image)
-
Gets the string representation of the image.
Parameters:
- image A image object.
Returns:
-
String representation of the image.