/// <summary> /// Computes compressed size/raw size, approximate /// </summary> /// <remarks>Actually: compressed size = total size of IDAT data , raw size = uncompressed pixel bytes = rows * (bytesPerRow + 1) /// </remarks> /// <returns></returns> public double ComputeCompressionRatio() { if (CurrentChunkGroup < ChunksList.CHUNK_GROUP_6_END) throw new PngjException("must be called after End()"); double compressed = (double)datStream.GetCountFlushed(); double raw = (ImgInfo.BytesPerRow + 1) * ImgInfo.Rows; return compressed / raw; }
public double ComputeCompressionRatio() { if (CurrentChunkGroup < 6) { throw new PngjException("must be called after End()"); } double num = datStream.GetCountFlushed(); double num2 = (ImgInfo.BytesPerRow + 1) * ImgInfo.Rows; return(num / num2); }