Data TransformationsThe Gds_rip user may need to apply certain transformations to the data during rasterization. The sample application, gds2tiff, supports the following transformations by passing the correct arguments to the library:
it is possible to mirror in X, Y or both directions simultaneously. This transform is applied before any other. Scaleit is possible to scale X and Y independently. Scaling is applied after mirroring but before rotation. Rotateit is possible to rotate the data in increments of 90 degrees. This is the last vector transformation. Polarity Reversalit is possible to reverse the polarity of the pixels. |
Examples - Command Line and ImagesWe will illustrate the behavior of the transforms using a simple GDSII file as shown below: |
|||
![]() |
This file has data extents from 7, 3 to 49, 72.5 (42 x 69.5) and units of mm with database resolution of 10000. If rasterized at 50 um per pixel the resulting bitmap is 840 x 1390. trans_test.gds 4KB |
||
Case 1: No Transformation
gds2tiff
trans_test.gds
=
+0
-out:trans_test_m0_s1_r0_
-pixelsize:50
-ram:8
-thrnum:2
-rotate:0
-scale:1
|
![]() |
Case 2: Polarity Inversion
gds2tiff
trans_test.gds
=
+0
-out:trans_test_complement
-pixelsize:50
-ram:8
-thrnum:2
-rotate:0
-scale:1
-complement
Notes: -complement actually reverses the values of the bits in the raster buffer. there is no extra margin in the bitmap produced during the reversal. |
![]() |
Case 3: Polarity Inversion (TIFF header)
gds2tiff
trans_test.gds
=
+0
-out:trans_test_invert
-pixelsize:50
-ram:8
-thrnum:2
-rotate:0
-scale:1
-invert
Notes: -invert does not change the value of the bits in the raster image buffer. Instead, when the TIFF file is written out, a flag is placed into the TIFF file header indicating that the polarity should be reversed. This only is useful for those writing TIFF output. |
![]() |
Case 4: Mirror in X Direction
gds2tiff
trans_test.gds
=
+0
-out:trans_test_mx_s2_r0
-pixelsize:50
-ram:8
-thrnum:2
-mirror:x
-rotate:0
-scale:2
Notes: -mirror:x means mirror in the X direction; not mirror along the X-axis. Same for mirror:Y. The bitmap is twice as large but that cannot be shown here due to space restrictions. |
![]() |
Case 5: Mirror in Y Direction
gds2tiff
trans_test.gds
=
+0
-out:trans_test_my_s2_r0
-pixelsize:50
-ram:8
-thrnum:2
-mirror:y
-rotate:0
-scale:2
|
![]() |
Case 6:
|
![]() |
|
|
Notes Mirroring is performed before rotation -rotate directive takes 1,2,3,4.... as arguments with 1=90, 2=180, 3=270 4=360 and so on. Rotation is CCW. |
||
Case 7:
|
![]() |
|
|
Notes Mirroring is performed before rotation -rotate directive takes 1,2,3,4.... as arguments with 1=90, 2=180, 3=270 4=360 and so on. Rotation is CCW. |
||
Case 8: Mirror in X and Rotate 180
gds2tiff
trans_test.gds
=
+0
-out:trans_test_mx_s2_r2
-pixelsize:50
-ram:8
-thrnum:2
-mirror:x
-rotate:2
-scale:2
|
![]() |