Esempio n. 1
0
File: Image.cs Progetto: JuRogn/OA
 public Image(FluxJpeg.Core.ColorModel cm, byte[][,] raster)
 {
     this.width = raster[0].GetLength(0);
     this.height = raster[0].GetLength(1);
     this._cm = cm;
     this._raster = raster;
 }
Esempio n. 2
0
        public static bool ResizeNeeded(FluxJpeg.Core.Image image, int maxEdgeLength)
        {
            double scale = (image.Width > image.Height) ? 
                (double)maxEdgeLength / image.Width : 
                (double)maxEdgeLength / image.Height;

            return scale < 1.0; // true if we must downscale
        }
Esempio n. 3
0
 public DecodedJpeg(FluxJpeg.Core.Image image) : this(image, null)
 {
     this._metaHeaders = new List<JpegHeader>();
     string s = "Jpeg Codec | fluxcapacity.net ";
     JpegHeader item = new JpegHeader();
     item.Marker = 0xfe;
     item.Data = Encoding.UTF8.GetBytes(s);
     this._metaHeaders.Add(item);
 }
Esempio n. 4
0
 public DecodedJpeg(FluxJpeg.Core.Image image, IEnumerable<JpegHeader> metaHeaders)
 {
     this.Precision = 8;
     this.HsampFactor = new int[] { 1, 1, 1 };
     this.VsampFactor = new int[] { 1, 1, 1 };
     this.lastColumnIsDummy = new bool[3];
     this.lastRowIsDummy = new bool[3];
     this._image = image;
     this._metaHeaders = (metaHeaders == null) ? new List<JpegHeader>(0) : new List<JpegHeader>(metaHeaders);
     foreach (JpegHeader header in this._metaHeaders)
     {
         if (header.IsJFIF)
         {
           //  this.HasJFIF = true;
             break;
         }
     }
     int componentCount = this._image.ComponentCount;
     this.compWidth = new int[componentCount];
     this.compHeight = new int[componentCount];
     this.BlockWidth = new int[componentCount];
     this.BlockHeight = new int[componentCount];
     this.Initialize();
 }