Implement border detection
This commit is contained in:
parent
b0eabd1297
commit
7eae871fc6
5 changed files with 224 additions and 18 deletions
|
|
@ -2,7 +2,7 @@ import dataclasses
|
|||
import math
|
||||
from typing import List, Tuple
|
||||
|
||||
from base_proxy import CARD_W_INCHES, CARD_H_INCHES, LEAVE_BLEED_INCHES
|
||||
from base_proxy import *
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
|
|
@ -122,10 +122,10 @@ class SheetLayout:
|
|||
print(self.__dict__)
|
||||
|
||||
def in_to_px(self, inches: float) -> int:
|
||||
return round(inches * self.dpi)
|
||||
return in_to_px(inches, self.dpi)
|
||||
|
||||
def mil_to_px(self, mils: int) -> int:
|
||||
return mils * self.dpi // 1000
|
||||
return mil_to_px(mils, self.dpi)
|
||||
|
||||
def create_card_image_transfer(self, y_index: int, x_index: int) -> CardImageTransfer:
|
||||
top_row = y_index == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue