예제 #1
0
 /// <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;
   }
예제 #2
0
        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);
        }