예제 #1
0
        private string SaveRAW(string path)
        {
            Directory.CreateDirectory(Path.GetDirectoryName(path));
            IImageArray data       = Data;
            string      uniquePath = Utility.Utility.GetUniqueFilePath(path + "." + data.RAWType);

            File.WriteAllBytes(uniquePath, data.RAWData);
            return(uniquePath);
        }
예제 #2
0
 public ImageData(IImageArray imageArray, int width, int height, int bitDepth, bool isBayered, ImageMetaData metaData)
 {
     this.Data                  = imageArray;
     this.MetaData              = metaData;
     isBayered                  = metaData.Camera.SensorType != SensorType.Monochrome ? true : isBayered;
     this.Properties            = new ImageProperties(width: width, height: height, bitDepth: bitDepth, isBayered: isBayered, gain: metaData.Camera.Gain);
     this.StarDetectionAnalysis = new StarDetectionAnalysis();
     this.Statistics            = new Nito.AsyncEx.AsyncLazy <IImageStatistics>(async() => await Task.Run(() => ImageStatistics.Create(this)));
 }
예제 #3
0
        public static BitmapSource CreateSourceFromArray(IImageArray arr, ImageProperties props, System.Windows.Media.PixelFormat pf)
        {
            //int stride = C.CameraYSize * ((Convert.ToString(C.MaxADU, 2)).Length + 7) / 8;
            int    stride = (props.Width * pf.BitsPerPixel + 7) / 8;
            double dpi    = 96;

            BitmapSource source = BitmapSource.Create(props.Width, props.Height, dpi, dpi, pf, null, arr.FlatArray, stride);

            source.Freeze();
            return(source);
        }
예제 #4
0
 public ImageArrayExposureData(
     ushort[] input,
     int width,
     int height,
     int bitDepth,
     bool isBayered,
     ImageMetaData metaData)
     : base(bitDepth, metaData)
 {
     this.imageArray = new ImageArray(input);
     this.Width      = width;
     this.Height     = height;
     this.IsBayered  = isBayered;
 }