MCPcopy Create free account
hub / github.com/creatale/node-dv / pixScaleByIntSampling

Function pixScaleByIntSampling

deps/leptonica/src/scale1.c:1404–1422  ·  view source on GitHub ↗

! * \brief pixScaleByIntSampling() * * \param[in] pixs 1, 2, 4, 8, 16, 32 bpp * \param[in] factor integer subsampling * \return pixd, or NULL on error * * * Notes: * (1) Simple interface to pixScaleBySampling(), for * isotropic integer reduction. * (2) If %factor == 1, returns a copy. * */

Source from the content-addressed store, hash-verified

1402 * </pre>
1403 */
1404PIX *
1405pixScaleByIntSampling(PIX *pixs,
1406 l_int32 factor)
1407{
1408l_float32 scale;
1409
1410 PROCNAME("pixScaleByIntSampling");
1411
1412 if (!pixs)
1413 return (PIX *)ERROR_PTR("pixs not defined", procName, NULL);
1414 if (factor <= 1) {
1415 if (factor < 1)
1416 L_ERROR("factor must be >= 1; returning a copy\n", procName);
1417 return pixCopy(NULL, pixs);
1418 }
1419
1420 scale = 1. / (l_float32)factor;
1421 return pixScaleBySampling(pixs, scale, scale);
1422}
1423
1424
1425/*------------------------------------------------------------------*

Callers 4

pixHasHighlightRedFunction · 0.85
pixGetPerceptualDiffFunction · 0.85
pixGetRankColorArrayFunction · 0.85
pixaAddPixWithTextFunction · 0.85

Calls 2

pixCopyFunction · 0.85
pixScaleBySamplingFunction · 0.85

Tested by

no test coverage detected