CImage:Reorient
The Reorient method performs one of a variety of reorientation transformations on an image.
bResult = CImage:Reorient( method, bResize=false ) |
This method is a single function that embodies the functionality or Hflip, Vflip, Rot90, Rot180, Rot270, and Transpose. Using this method avoids constructing a if...elseif table when the method is unknown or several transformations are applied in succession. The methods are defined in the following table:
Reorient Methods
Operation |
Method |
Description |
1 |
Horizontal flip |
|
2 |
Vertical flip |
|
3 |
Rotate 90 degrees |
|
4 |
Rotate 180 degrees |
|
5 |
Rotate 270 degrees |
|
6 |
Flip about main diagonal
|
If the optional bResize argument is omitted or set to false, the image retains its original number of columns and rows.
Suppose that a CImage I exists. The following script fragment rotates the image 180 degrees, then flips it horizontally:
|
-- perform 180 degree rotation |
|
-- perform horizontal flip |