def get_mm(self): return dpi2px(1, 'mm')
def get_pt(self): return dpi2px(1, 'pt')
def get_cm(self): return dpi2px(1, 'cm')
def get_dp(self): return dpi2px(1, 'dp')
def get_sp(self): return dpi2px(1, 'sp')
def sp(value) -> float: '''Convert from scale-independent pixels to pixels ''' return dpi2px(value, 'sp')
def get_in(self): # we bind to all dpi, density, fontscale, even though not all may be # used for a specific suffix, because we don't want to rely on the # internal details of dpi2px. But it will be one of the three. But it's # an issue, since it won't trigger the prop if the value doesn't change return dpi2px(1, 'in')
def dp(value) -> float: '''Convert from density-independent pixels to pixels ''' return dpi2px(value, 'dp')
def mm(value) -> float: '''Convert from millimeters to pixels ''' return dpi2px(value, 'mm')
def cm(value) -> float: '''Convert from centimeters to pixels ''' return dpi2px(value, 'cm')
def inch(value) -> float: '''Convert from inches to pixels ''' return dpi2px(value, 'in')
def pt(value) -> float: '''Convert from points to pixels ''' return dpi2px(value, 'pt')