예제 #1
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Filter = "Lytro Files (*.lfp)|*.lfp|All Files (*.*)|*.*";
                if (ofd.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    if (File.Exists(ofd.FileName))
                    {
                        try
                        {
                            lfp = new LytroFile(ofd.FileName);
                            lfp.Load();
                        }
                        catch (Exception ex)
                        {
                            ShowError("Could not load Lytro file:" + Environment.NewLine + ex.Message);
                            return;
                        }

                        ComboItem[] items = new ComboItem[lfp.JpegSections.Count];
                        for (int i = 0; i < items.Length; i++)
                        {
                            items[i] = new ComboItem(string.Format("{0}_{1}", lfp.Filename, i), i);
                        }
                        cbImages.DataSource = items;
                        cbImages.DisplayMember = "Text";
                        cbImages.ValueMember = "Value";
                    }
                }
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: behnam/Lytro.Net
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                WL("Usage: lytrosplitter file[.lfp] [... fileN[.lfp]]");
                return;
            }

            foreach (string arg in args)
            {
                try
                {
                    FileInfo fi = new FileInfo(arg);

                    if (!fi.Exists)
                    {
                        throw new FileNotFoundException("Could not find file", arg);
                    }

                    string dir = Directory.GetParent(arg).FullName;

                    LytroFile lfp = new LytroFile(arg);
                    lfp.Load();
                    lfp.Export(dir);
                }
                catch (Exception ex)
                {
                    WL(ex.Message);
                }
            }

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
예제 #3
0
 internal RawImageSection(LytroFile file, SectionData sectionData)
     : base(file, sectionData)
 {
     this.SectionType = SectionTypes.LFP_RAW_IMAGE;
     this.Name = "raw";
 }
예제 #4
0
 public TextSection(LytroFile file, SectionData sectionData)
     : base(file, sectionData)
 {
     this.SectionType = SectionTypes.LFP_TEXT;
 }
예제 #5
0
 internal TableOfContentsSection(LytroFile file, SectionData sectionData)
     : base(file, sectionData)
 {
     this.SectionType = SectionTypes.LFP_TEXT;
     this.Name = "table";
 }
예제 #6
0
 internal JpegSection(LytroFile file, SectionData sectionData)
     : base(file, sectionData)
 {
     this.SectionType = SectionTypes.LFP_JPEG;
     this.Name = "image";
 }
예제 #7
0
 internal LookUpTableSection(LytroFile file, SectionData sectionData)
     : base(file, sectionData)
 {
     this.SectionType = SectionTypes.LFP_DEPTH_LUT;
     this.Name = "depth";
 }