IMAGE

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 CMM2

Syntax:
IMAGE RESIZE x, y, width, height, new_x, new_y, new_width, new_height [,page_number] 
IMAGE RESIZE_FAST x, y, width, height, new_x, new_y, new_width, new_height [,page_number] [,flag]
IMAGE ROTATE x, y, width, height, new_x, new_y, angle! [,page_number]
IMAGE ROTATE_FAST x, y, width, height, new_x, new_y, angle! [,page_number] [,flag]
IMAGE WARP_H x, y, w, h, x1, y1, h1, x2, y2, h2 [,readpage] [,dontcopyblack]
IMAGE WARP_V x, y, w, h, x1, y1, w1, x2, y2, w2 [,readpage] [,dontcopyblack]

Description:

IMAGE RESIZE x, y, width, height, new_x, new_y, new_width, new_height [,page_number] 
IMAGE RESIZE_FAST x, y, width, height, new_x, new_y, new_width, new_height [,page_number] [,flag]

This takes the part of the image with a top corner at 'x', 'y' and of specified 'width' and 'height' and resizes it writing it back to the area specified by 'new_x', 'new_y', 'new_width', new_height. 
The command will both increase and decrease the size of the part of the image chosen. It uses a bi-linear interpolation to generate the new pixels.
The 'page number' is the page that the image data is read from it is then written to the current write page as specified by the PAGE WRITE n command. 
If 'page_number' is omitted the data is read from the write page.
Use the text FRAMEBUFFER as the page no. to read from the framebuffer.
If flag is set to 1 then black pixels are not written in the resized image.  (only for _FAST)
IMAGE RESIZE uses bi-linear interpolation to resize the image. IMAGE RESIZE_FAST uses a nearest neighbour technique and is much faster but the resulting image quality will not be as good.

IMAGE ROTATE x, y, width, height, new_x, new_y, angle! [,page_number]
IMAGE ROTATE_FAST x, y, width, height, new_x, new_y, angle! [,page_number] [,flag]

Takes the part of the image with a top corner at 'x', 'y' and of specified 'width' and 'height' and rotates it about its centre by 'angle' (in degrees).
Areas of the image that after rotation are outside of the area specified are cropped. The image is then drawn with the top left corner specified by new_x and new_y
The 'page number' is the page that the image data is read from and it is written to the current write page as specified by the PAGE WRITE n command. 
If 'page_number' is omitted the data is read from the write page.
Use the text FRAMEBUFFER as the page no. to read from the framebuffer.
If flag is set to 1 then black pixels are not written in the rotated image. (only for _FAST)
IMAGE ROTATE uses bi-linear interpolation to resize the image. IMAGE RESIZE_ROTATE uses a nearest neighbour technique and is much faster but the resulting image quality will not be as good.

IMAGE WARP_H x, y, w, h, x1, y1, h1, x2, y2, h2 [,readpage] [,dontcopyblack]
IMAGE WARP_V x, y, w, h, x1, y1, w1, x2, y2, w2 [,readpage] [,dontcopyblack]

x, y, w, h defined the top left coordinates and the width and height to read from the current write page or optional read page
In both cases x1 and y1 define the top left corner of the area to write
In both cases x2 and y2 define the top right corner of the area to write
When warping horizontally h1 and h2 define the height of the transformed area at the left edge and right edge
When warping vertically w1 and w2 define the width of the transformed area at the top edge and bottom edge

mode 1,16
load jpg "image2"
image warp_h 0,0,400,385, 400,0,385, 600,85,385-170
image warp_v 0,0,400,385,  0,385,400,  100,385*1.5,200
DO:LOOP

 

Also see LOAD xxx and SAVE IMAGE

Last edited: 16 December, 2020