[Poppler-bugs] [Bug 68360] Add option to manually disable bilinear filtering

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 29 09:29:07 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=68360

--- Comment #26 from Charles Hyder <dr.hyder at gmail.com> ---
Created attachment 84866
  --> https://bugs.freedesktop.org/attachment.cgi?id=84866&action=edit
Force Image Interpolation Option

I have done more than what I planned to:

1) Wrote expandRowInt() and Splash::scaleImageYuXuBilinearInt() which use
integer math - should work much faster; they also use more accurate geometry
math, but that would be visible only for scaling, say, a 2x2 pixel image to
3x3;

2) Rewrote isImageInterpolationRequired():

--------------

// determine if a scaled image requires interpolation based on the scale and
// the interpolate flag from the image dictionary
static GBool isImageInterpolationRequired(int srcWidth, int srcHeight,
                                          int scaledWidth, int scaledHeight,
                                          GBool interpolate, GBool
forceImageInterpolationA) {
  if (interpolate)
    return gTrue;

  /* When asked not to interpolate, or when scale factor is >= 400% we don't
interpolate. See bugs #25268, #9860, #68360 */
  if (!forceImageInterpolationA || scaledWidth / srcWidth >= 4 || scaledHeight
/ srcHeight >= 4)
    return gFalse;

  return gTrue;
}

----------------

By default, forceImageInterpolation == gTrue everywhere, so the behaviour is
exactly as before: ad hoc, but what are you gonna do if people are used to
that? If it's set to false no interpolation is done, unless the PDF file
requests it by itself.

The forceImageInterpolationA parameter is eventually settable via globalParams
similar to the antialiasing options.

3) Changed the constructors of splashOutputDev and Splash to incorporate the
forceImageInterpolationA argument. This allows one to create instances of those
classes that behave just as pre-0.20 versions of Poppler would. At the same
time, all code that assumes the post-0.20 behavior is 100% compatible.

4) added command line parsing for the new "-fii" option in pdftoppm. This
allows one to control the forceImageInterpolation option.

5) updated the pdftoppm.1 man page

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20130829/84da58f5/attachment.html>


More information about the Poppler-bugs mailing list