private void ReadData(PsdReader reader, int bps, CompressionType compressionType, int[] rlePackLengths) { int length = PsdUtility.DepthToPitch(bps, this.width); this.data = new byte[length * this.height]; switch (compressionType) { case CompressionType.Raw: reader.Read(this.data, 0, this.data.Length); break; case CompressionType.RLE: for (int i = 0; i < this.height; i++) { byte[] buffer = new byte[rlePackLengths[i]]; byte[] dst = new byte[length]; reader.Read(buffer, 0, rlePackLengths[i]); DecodeRLE(buffer, dst, rlePackLengths[i], length); for (int j = 0; j < length; j++) { this.data[(i * length) + j] = (byte)(dst[j] * this.opacity); } } break; } }
public BlendMode ReadBlendMode() { return(PsdUtility.ToBlendMode(this.ReadAscii(4))); }