transformLabel
Apply geometric transformations to a label (rotate, flip, scale, translate).
Parameter
| Key | Type | Description |
|---|---|---|
| labelName | string | Name of the label in the database. Mutually exclusive with labelData. |
| labelData | object | A Label object. Mutually exclusive with labelName. |
| scale | number | Scale factor. Default is 1.0. |
| flipX | boolean | Mirror horizontally. Default is false. |
| flipY | boolean | Mirror vertically. Default is false. |
| transpose | boolean | Swap X and Y axes. Default is false. |
| rotation | number | Rotation in degrees. Must be 0, 90, 180, or 270. Default is 0. |
| dx | number | Horizontal translation in millimeters. |
| dy | number | Vertical translation in millimeters. |
| newLabelName | string | If provided, saves the transformed label to the database under this name and returns null. |
Return value
If newLabelName is provided, the transformed label is saved to the database and null is returned. Otherwise, the transformed Label object is returned.
Example
Rotate a label 90 degrees and save under a new name:
transformLabel {"labelName": "MyLabel", "rotation": 90, "newLabelName": "MyLabel-Rotated"}