ImageTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : Image Processing : ImageTools Package : ImageTools/Rotate

ImageTools

  

Rotate

  

rotate an image in increments of 90 degrees

 

Calling Sequence

Parameters

Options

Description

Examples

Calling Sequence

Rotate( img, angle, opts )

Parameters

img

-

Image; input image

angle

-

amount of rotation, in radians, counter-clockwise around the image center.

opts

-

(optional) equation(s) of the form option = value; specify options for the Rotate command

Options

• 

output = Image

  

Specifies a data structure into which the output is written. This can be used to avoid allocating memory. The size and number of layers must match that of the input. The dimensions of the output image are adjusted so that the row and column indices match the input. The default is NULL.

  

If no output option is specified, Rotate will allocate an output image based on what the extent option would return.

  

The degrees option is used to indicate that the rotation is given in degrees instead of radians.

  

If the extent option is given, Rotate returns the height and width of a (possibly larger) image in which the input image must be centered to ensure that no part of the input image is lost during the rotation. This can be used to allocate a suitable image for the output option.

  

The background option specifies a color to be used to fill in the extra space around the rotated input image. If not specified, Rotate will use a default of 50% gray. Furthermore, for RGBA images, the alpha channel will be set to 0 (i.e., completely transparent). The background can be specified as a numeric value, a list of 3 or 4 numeric values, or the names black or white.

Description

• 

The Rotate command returns an image that has been rotated by the specified angle.

• 

The img parameter is of type Image.

• 

The angle parameter specifies the angle of rotation in a counter-clockwise direction. It may be a numeric value, or one of the names left or right. An angle of Pi/2 radians is equivalent to left.

• 

If an image is rotated such that it would fit better in a rectangle rotated 90 degrees relative to the input, the output image will have its dimensions exchanged. For example, rotating a 400 by 300 image by Pi/3 radians (60 degrees) will produce a 300 x 400 image. Thus, the dimensions of the output image should always be checked before attempting to index into it.

Examples

withImageTools:

imgCreate100,200,r,c0.5+evalfexpc500.5sinr20

_rtable18446884025564705006

(5.1)

img1Rotateimg,90,degrees

_rtable18446884025483061958

(5.2)

img2Rotateimg,180,degrees

_rtable18446884025483050030

(5.3)

img3Rotateimg,270,degrees

_rtable18446884025483038102

(5.4)

img4Rotateimg,π4.0

_rtable18446884025483026174

(5.5)

img5Rotateimg,π3.0,background=white

_rtable18446884025463431406

(5.6)

Embedimg,img1,img2,img3,img4,img5

Rotateimg,π4.0,extent

270,354

(5.7)

See Also

ImageTools

ImageTools[Flip]

ImageTools[Transpose]