MCPcopy Create free account
hub / github.com/OpenPrinting/cups / pwg_ppdize_resolution

Function pwg_ppdize_resolution

cups/ppd-cache.c:5627–5654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5625 */
5626
5627static void
5628pwg_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/*

Callers 1

_ppdCreateFromIPP2Function · 0.85

Calls 1

ippGetResolutionFunction · 0.85

Tested by

no test coverage detected