11#ifndef BACKENDS_GP_DPI_H
12#define BACKENDS_GP_DPI_H
26 unsigned int h,
unsigned int h_mm)
28 unsigned int dpi = ((w * 25.4) / w_mm + (h * 25.4) / h_mm + 1)/2;
30 GP_DEBUG(1,
"Resolution %ux%u - %ummx%umm - dpi %u", w, h, w_mm, h_mm, dpi);
unsigned int gp_size
Integer type for sizes i.e. w, h, ...
#define GP_DEBUG(level,...)
A debug printf-like macro.
static gp_size gp_dpi_mm_to_px(unsigned int dpi, float mm)
Converts milimeters to pixels.
static unsigned int gp_dpi_from_size(unsigned int w, unsigned int w_mm, unsigned int h, unsigned int h_mm)
Calculates DPI from display physical size and resolution.
static float gp_dpi_to_ppmm(unsigned int dpi)
Converts DPI to dots/pixels per mm.