ROTBIT

Bitmap rotation


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Examples :: Related

Back to top

Description


Rotates bitmap data in an image file by 90 degrees, 180 degrees or 270 degrees.
Back to top

Parameters


rotbit(fili, filo, dbib, angle)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
FILO * str Output file name 1 -    
DBIB * List[int] Input bitmap segment 1 -    
ANGLE * List[int] Rotation angle (degrees) 1 - 1  

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the PCIDSK image file containing the bitmap to rotate.

FILO

Specifies the name of the PCIDSK image file to receive the rotated bitmap. If the specified file does not already exist. it will be created.

If the specified rotation angle (ANGLE) is 90 or 270 degrees, the output file must have exactly as many lines as the input file has pixels, and exactly as many pixels as the input file has lines. If ANGLE is 180 degrees, the output file must be exactly the same size as the input file, and may be the same file.

DBIB

Specifies the input bitmap segment(s) to be rotated.

ANGLE

Specifies the clockwise angle (in degrees) by which to rotate the input bitmap(s).

Supported rotation angles are 90, 180 or 270 degrees.

Back to top

Details

ROTBIT rotates specified bitmap segment(s) about the bitmap center, by an angle of 90, 180 or 270 degrees.

The result is placed in a newly created bitmap segment(s) in the output image file.

If the angle of rotation (ANGLE) is 90 or 270 degrees, the output file must have exactly as many lines as the input file has pixels, and exactly as many pixels as the input file has lines. If ANGLE is 180 degrees, the output file must be exactly the same size as the input file, and may be the same file.

If the output file (FILO) does not already exist, it will be created with the appropriate size to contain the results.

Back to top

Examples

A large plot (10,000 pixels by 2000 lines) has been generated to print on the CalComp Electrostatic Plotter. If printed directly using the CALCOMP function, the plot will be produced as several short strips which must be pasted together. To avoid this, ROTBIT is used to rotate the plot into 2000 x 10000 which will all fit on one strip.

from pci.rotbit import rotbit

fili	=	"plotwide.pix"	# input plot file
filo	=	"plotlong.pix"	# output plot file
dbib	=	[1,2,3]	# bitmaps to rotate
angle	=	[90]	# rotate 90 degrees

rotbit( fili, filo, dbib, angle )

Rotate channels 9, 10, and 11 in the input file by 180 degrees.

from pci.rotbit import rotbit

fili	=	"irvine.pix"	    # input file
filo	=	"rotate_bit.pix"	# output file
dbib	=	[9,10,11]	        # bitmaps to rotate
angle	=	[180]	            # rotate 180 degrees

rotbit( fili, filo, dbib, angle )
 	

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.