[
https://issues.apache.org/jira/browse/PDFBOX-2117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14020486#comment-14020486
]
John Hewson commented on PDFBOX-2117:
-------------------------------------
The real problem is that shading classes are still using the old per-pixel
toRGB method. However, I added a new toRGBImage method in 2.0 which performs an
order of magnitude faster by operating on an entire Raster at once.
The shading classes should be changed so that they draw onto a temporary Raster
in their native color space and then call toRGBImage once at the very end to
get an RGB BufferedImage. Take a look at the Indexed and DeviceN color space
classes, they already use this technique, with great success.
> AxialShadingContext is slow
> ---------------------------
>
> Key: PDFBOX-2117
> URL: https://issues.apache.org/jira/browse/PDFBOX-2117
> Project: PDFBox
> Issue Type: Improvement
> Reporter: Petr Slaby
> Attachments: AxialShading.patch, AxialShading1.patch,
> Shading2Function2text.pdf, asy-shade.pdf, color_gradient.pdf,
> shading_pattern.pdf
>
>
> AxialShadingContext#getRaster() is on top of profiler hot spots in documents
> that use an axial shading. Inside it, the slowest part is calling
> PDColorSpaceRGB#toRGB() and PDFunctionType3#eval() (in this order).
>
--
This message was sent by Atlassian JIRA
(v6.2#6252)