6#ifndef BACKENDS_GP_DPI_H
7#define BACKENDS_GP_DPI_H
20static inline unsigned int gp_dpi_from_size(
unsigned int w,
unsigned int w_mm,
21 unsigned int h,
unsigned int h_mm)
23 unsigned int dpi = ((w * 25.4) / w_mm + (h * 25.4) / h_mm + 1)/2;
25 GP_DEBUG(1,
"Resolution %ux%u - %ummx%umm - dpi %u", w, h, w_mm, h_mm, dpi);
36static inline float gp_dpi_to_ppmm(
unsigned int dpi)
47static inline gp_size gp_dpi_mm_to_px(
unsigned int dpi,
float mm)
49 return gp_dpi_to_ppmm(dpi) * mm + 0.5;
unsigned int gp_size
Integer type for sizes i.e. w, h, ...
#define GP_DEBUG(level,...)
A debug printf-like macro.