[
https://issues.apache.org/jira/browse/PDFBOX-2258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14088227#comment-14088227
]
John Hewson commented on PDFBOX-2258:
-------------------------------------
Actually it's probably simpler than I said, looking at the PDF spec, the source
image formats for stencil masks are quite limited, it's always 1-bit per
sample. In that context, color key masking wouldn't make sense so it won't need
to be handled either. What the code in getStencilImage() is doing is copying
the alpha channel from the (gray, binary) color channel of the source image
over to the destination image which has been filled with the paint already.
> Speed up SampledImageReader#getStencilImage()
> ---------------------------------------------
>
> Key: PDFBOX-2258
> URL: https://issues.apache.org/jira/browse/PDFBOX-2258
> Project: PDFBox
> Issue Type: Wish
> Components: Rendering
> Affects Versions: 2.0.0
> Reporter: simon steiner
>
> PDF from PDFBOX-1437
> java -jar ~/pdfbox_th/app/target/pdfbox-app-2.0.0-SNAPSHOT.jar PDFToImage
> AA.pdf
> org.apache.pdfbox.pdmodel.graphics.color.PDDeviceGray.toRGBImage()
> 31.69913 11,472 ms (31.7%) 11,472 ms
> org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.getStencilImage()
> 29.439924 10,654 ms (29.4%) 10,654 ms
> is there some alternative to
> for (int y = 0; y < height; y++)
> {
> for (int x = 0; x < width; x++)
> {
> op
> }
> }
--
This message was sent by Atlassian JIRA
(v6.2#6252)