Ejemplo n.º 1
0
        public static IImage ToUserImage(UserFrame frame)
        {
            ImageInfo         info  = new ImageInfo(frame.Cols, frame.Rows, PixelFormat.R16);
            ArrayImage <byte> image = new ArrayImage <byte>(frame.Data, info, true);

            return(image);
        }
Ejemplo n.º 2
0
        public void plot()
        {
            IFigure     f2  = ShoPlotHelper.Figure();
            DoubleArray pme = ArrayRandom.RandomDoubleArray(50, 50);

            ArrayImage.GetArrayImage(pme, -1.0, 1.0);
            ShoChart ch = new ShoContourChart(pme, null);
        }
Ejemplo n.º 3
0
 static void Main(string[] args)
 {
     ArrayImage img = new ArrayImage("p.jpg");
     //img.Pasterize(16.0f);
     img.Blur(Kernel.GaussianKernel(21));
     //TODO:Shit
     img.Save("p2.jpg");
 }
Ejemplo n.º 4
0
        public void Start(Png png)
        {
            int width = png.ihdr.width, height = png.ihdr.height, bitdepth = png.ihdr.bitdepth;
            ColorType colortype = png.ihdr.colortype;
            switch (colortype)
            {
                case ColorType.GRAY:
                    throw new NotSupportedException(); //support these later
                case ColorType.GRAY_ALPHA:
                    throw new NotSupportedException(); //support these later
                case ColorType.PALETTE:
                    throw new NotSupportedException(); //support these later
                case ColorType.RGB:
                    if (bitdepth == 16) throw new NotSupportedException();
                    else pf = 24;
                    break;
                case ColorType.RGB_ALPHA:
                    if (bitdepth == 16) throw new NotSupportedException();
                    else pf = 32;
                    break;
            }

            ArrayImage = new ArrayImage();
            ArrayImage.Width = width;
            ArrayImage.Height = height;
            ArrayImage.Pixels = new int[width * height];
        }
Ejemplo n.º 5
0
 public DepthImage(DepthFrame frame)
 {
     Frame = frame;
     Info  = new ImageInfo(frame.Cols, frame.Rows, PixelFormat.R16);
     image = new ArrayImage <byte>(frame.Data, Info, true);
 }
Ejemplo n.º 6
0
 public ColorImage(ColorFrame frame)
 {
     Frame = frame;
     Info  = new ImageInfo(frame.Cols, frame.Rows, PixelFormat.B8G8R8);
     image = new ArrayImage <byte>(frame.Data, Info, true);
 }