private void WriteFirstChunks() { int nw = 0; CurrentChunkGroup = ChunksList.CHUNK_GROUP_1_AFTERIDHR; nw = chunksList.writeChunks(outputStream, CurrentChunkGroup); CurrentChunkGroup = ChunksList.CHUNK_GROUP_2_PLTE; nw = chunksList.writeChunks(outputStream, CurrentChunkGroup); if (nw > 0 && ImgInfo.Greyscale) throw new PngjOutputException("cannot write palette for this format"); if (nw == 0 && ImgInfo.Indexed) throw new PngjOutputException("missing palette"); CurrentChunkGroup = ChunksList.CHUNK_GROUP_3_AFTERPLTE; nw = chunksList.writeChunks(outputStream, CurrentChunkGroup); CurrentChunkGroup = ChunksList.CHUNK_GROUP_4_IDAT; }
public void WriteFirstChunks() { CurrentChunkGroup = 1; chunksList.writeChunks(outputStream, CurrentChunkGroup); CurrentChunkGroup = 2; int num = chunksList.writeChunks(outputStream, CurrentChunkGroup); if (num > 0 && ImgInfo.Greyscale) { throw new PngjOutputException("cannot write palette for this format"); } if (num == 0 && ImgInfo.Indexed) { throw new PngjOutputException("missing palette"); } CurrentChunkGroup = 3; chunksList.writeChunks(outputStream, CurrentChunkGroup); CurrentChunkGroup = 4; }