public void decodeLastReadRowToInt(int[] buffer, int bytesRead) { if (ImgInfo.BitDepth <= 8) { int i = 0; int num = 1; for (; i < bytesRead; i++) { buffer[i] = rowb[num++]; } } else { int num2 = 0; int num3 = 1; while (num3 < bytesRead) { buffer[num2] = (rowb[num3++] << 8) + rowb[num3++]; num2++; } } if (ImgInfo.Packed && unpackedMode) { ImageLine.unpackInplaceInt(ImgInfo, buffer, buffer, Scale: false); } }
public static int[] Unpack(ImageInfo imgInfo, int[] src, int[] dst, bool scale) { int len1 = imgInfo.SamplesPerRow; int len0 = imgInfo.SamplesPerRowPacked; if (dst == null || dst.Length < len1) { dst = new int[len1]; } if (imgInfo.Packed) { ImageLine.unpackInplaceInt(imgInfo, src, dst, scale); } else { Array.Copy(src, 0, dst, 0, len0); } return(dst); }
private void decodeLastReadRowToInt(int[] buffer, int bytesRead) // see http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html { if (ImgInfo.BitDepth <= 8) { for (int i = 0, j = 1; i < bytesRead; i++) { buffer[i] = (rowb[j++]); } } else // 16 bitspc { for (int i = 0, j = 1; j < bytesRead; i++) { buffer[i] = (rowb[j++] << 8) + rowb[j++]; } } if (ImgInfo.Packed && unpackedMode) { ImageLine.unpackInplaceInt(ImgInfo, buffer, buffer, false); } }