scales annotations

This commit is contained in:
franksim
2025-11-09 13:01:46 +01:00
parent 85fd327052
commit 93d752209f
52 changed files with 84 additions and 2 deletions

View File

@@ -20,6 +20,12 @@ class AnnotationRect:
def __array__(self) -> np.ndarray:
return np.array([self.x1, self.y1, self.x2, self.y2])
def scale(self, factor: float):
self.x1 *= factor
self.x2 *= factor
self.y1 *= factor
self.y2 *= factor
@staticmethod
def fromarray(arr: np.ndarray):
return AnnotationRect(arr[0], arr[1], arr[2], arr[3])