mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-03 03:25:28 -04:00
#483 Minor optimization
(cherry picked from commit 06bcf22242504361ef73cc9d369b235e6034d7fa)
This commit is contained in:
parent
8a8c6b1931
commit
d52522fb80
@ -131,14 +131,15 @@ public final class PSDImageWriter extends ImageWriterBase {
|
||||
imageOutput.skipBytes(byteCounts.length * (largeFormat ? 4 : 2));
|
||||
|
||||
// TODO: Loop over tiles?
|
||||
Raster tile = sampleModel.getTransferType() == DataBuffer.TYPE_INT && sampleModel instanceof SinglePixelPackedSampleModel
|
||||
? RasterUtils.asByteRaster(image.getTile(0, 0))
|
||||
: image.getTile(0, 0);
|
||||
|
||||
for (int channel = 0; channel < channels; channel++) {
|
||||
// TODO: Alpha issues:
|
||||
// 1. Alpha channel is written (but not read, because there are no layers, and alpha is considered present only if layer count is negative)
|
||||
// - Can we write a small hidden layer, just to have -1 layers?
|
||||
// 2. Alpha needs to be premultiplied against white background (to avoid inverse halo)
|
||||
Raster tile = sampleModel.getTransferType() == DataBuffer.TYPE_INT && sampleModel instanceof SinglePixelPackedSampleModel
|
||||
? RasterUtils.asByteRaster(image.getTile(0, 0))
|
||||
: image.getTile(0, 0);
|
||||
Raster channelRaster = tile.createChild(0, 0, width, height, 0, 0, new int[] {channel});
|
||||
|
||||
switch (bits) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user