PICTools Programmer's Reference
Rotate

Rotates and/or shears an image.  This operation works on all color depths supported by the opcode.To rotate an image, both u.SC3.HorizontalRotationAngle and u.SC3.VerticalRotationAngle should be set to the same value, the number of degrees counterclockwise to rotate the image.

ItalicsA  →  RitA

To shear an image, set one of u.SC3.HorizontalRotationAngle and u.SC3.VerticalRotationAngle to zero and the other to a value from -70 to 70, indicating the number of degrees counterclockwise to shear the image.

ItalicsA  →  ItalicsAShear

u.SC3.HorizontalRotationAngle and u.SC3.VerticalRotationAngle can also be set to non-zero values that differ by as much as 70 degrees. In this case, the operation will perform a rotation, followed by a shear.

ItalicsA  →  ItalicsADiffRot

The aspect ratio (the ratio of horizontal to vertical resolution) of the image is very important to this operation. If the aspect ratio is not set correctly, the image will be stretched horizontally or vertically during rotation. If the rotation angle is very close to -360, -180, 0, 180, or 360, there will be little distortion. If the rotation angle is much different from those values, there may significant distortion.

For example, coarse faxes have an aspect ratio of 1 to 2, meaning that each pixel is rectangular and is twice as tall as it is wide, and are typically 1728 pixels wide and 1100 pixels tall (8.5" x 11"). If a coarse fax is rotated 90 degrees, ignoring the aspect ratio, it will become 1100 pixels wide and 1728 pixels tall (5.5" x 17") and will appear to have been stretched by 4 times vertically. If the resolution is set properly, this opcode would produce an image that is 2200 pixels wide and 864 pixels tall (11" x 8.5").

If possible, the horizontal and vertical resolution should be set to the correct values in the Head structure within PIC_PARM before REQ_INIT. If the exact resolution is unknown, then the horizontal and vertical resolution should be set to values that yield the correct aspect ratio. If both are set to zero, then a 1 to 1 aspect ratio is assumed.

Note that there are situations where the aspect ratio handling is not desirable. For example, if a 200 DPI x 100 DPI image is rotated 90 degrees and the desired output is 100 DPI x 200 DPI, then the horizontal and vertical resolutions should be set to the same values and the final resolution should be overridden with the desired values after the operation has completed.

The uncompressed image to be processed must reside in the Get Queue prior to REQ_EXEC. Typically, the image will be fully contained in the Get Queue, but that is not a requirement. The output image will be placed into the Put Queue during REQ_EXEC.

Padding pixels present at the end of each line may be modified by this operation.

In addition to placing an output image into the Put Queue, this operation stores some output information into the PIC_PARM structure in the following locations.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback