| 5625 | */ |
| 5626 | |
| 5627 | static void |
| 5628 | pwg_ppdize_resolution( |
| 5629 | ipp_attribute_t *attr, /* I - Attribute to convert */ |
| 5630 | int element, /* I - Element to convert */ |
| 5631 | int *xres, /* O - X resolution in DPI */ |
| 5632 | int *yres, /* O - Y resolution in DPI */ |
| 5633 | char *name, /* I - Name buffer */ |
| 5634 | size_t namesize) /* I - Size of name buffer */ |
| 5635 | { |
| 5636 | ipp_res_t units; /* Units for resolution */ |
| 5637 | |
| 5638 | |
| 5639 | *xres = ippGetResolution(attr, element, yres, &units); |
| 5640 | |
| 5641 | if (units == IPP_RES_PER_CM) |
| 5642 | { |
| 5643 | *xres = (int)(*xres * 2.54); |
| 5644 | *yres = (int)(*yres * 2.54); |
| 5645 | } |
| 5646 | |
| 5647 | if (name && namesize > 4) |
| 5648 | { |
| 5649 | if (*xres == *yres) |
| 5650 | snprintf(name, namesize, "%ddpi", *xres); |
| 5651 | else |
| 5652 | snprintf(name, namesize, "%dx%ddpi", *xres, *yres); |
| 5653 | } |
| 5654 | } |
| 5655 | |
| 5656 | |
| 5657 | /* |
no test coverage detected