in plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/util/pngj/chunks/ChunkCopyBehaviour.kt [76:103]
override fun match(chunk: PngChunk): Boolean {
if (chunk.crit) {
if (chunk.id == ChunkHelper.PLTE) {
if (imgInfo.indexed && maskMatch(copyFromMask, COPY_PALETTE)) return true
if (!imgInfo.greyscale && maskMatch(copyFromMask, COPY_ALL)) return true
}
} else { // ancillary
val text = chunk is PngChunkTextVar
val safe: Boolean = chunk.safe
// notice that these if are not exclusive
if (maskMatch(copyFromMask, COPY_ALL)) return true
if (safe && maskMatch(copyFromMask, COPY_ALL_SAFE)) return true
if (chunk.id == ChunkHelper.tRNS && maskMatch(copyFromMask, COPY_TRANSPARENCY)) return true
if (chunk.id == ChunkHelper.pHYs && maskMatch(copyFromMask, COPY_PHYS)) return true
if (text && maskMatch(copyFromMask, COPY_TEXTUAL)) return true
if (
maskMatch(copyFromMask, COPY_ALMOSTALL)
&& !(
isUnknown(chunk)
|| text
|| chunk.id == ChunkHelper.hIST
|| chunk.id == ChunkHelper.tIME
)
) return true
if (maskMatch(copyFromMask, COPY_UNKNOWN) && isUnknown(chunk)) return true
}
return false
}