コード例 #1
0
        public LookUpTablesSet(ImageForm imageForm)
        {
            this.imageForm = imageForm;
            this.bitmap    = imageForm.PictureBox.Image as Bitmap;


            MinLevelR    = bitmap.GetPixel(0, 0).R;
            MaxLevelR    = bitmap.GetPixel(0, 0).R;
            MinLevelG    = bitmap.GetPixel(0, 0).G;
            MaxLevelG    = bitmap.GetPixel(0, 0).G;
            MinLevelB    = bitmap.GetPixel(0, 0).B;
            MaxLevelB    = bitmap.GetPixel(0, 0).B;
            MinLevelMono = (int)Math.Round(MinLevelR * RED_MULTIPLIER + MinLevelG * GREEN_MULTIPLIER + MinLevelB * BLUE_MULTIPLIER, 0);
            MaxLevelMono = (int)Math.Round(MaxLevelR * RED_MULTIPLIER + MaxLevelG * GREEN_MULTIPLIER + MaxLevelB * BLUE_MULTIPLIER, 0);

            BitmapWidth  = (int)bitmap.GetBounds(ref imageSizeUnit).Width;
            BitmapHeight = (int)bitmap.GetBounds(ref imageSizeUnit).Height;

            populateLUTs(bitmap);
            setExtremums();
        }
コード例 #2
0
 public HistogramForm(ImageForm imageForm)
 {
     InitializeComponent();
     this.imageForm = imageForm;
     //this.lookUpTable = lookUpTable;
     this.LookUpTablesSet = new LookUpTablesSet(imageForm);
     Histograms           = new List <HistogramDrafter>(4);
     PctMonoHist.Visible  = true;
     PctRedHist.Visible   = false;
     PctGreenHist.Visible = false;
     PctBlueHist.Visible  = false;
     Shown         += HistogramForm_Shown;
     MonoHistogram  = new HistogramDrafter(PctMonoHist, Color.DarkGray);
     RedHistogram   = new HistogramDrafter(PctRedHist, Color.Crimson);
     GreenHistogram = new HistogramDrafter(PctGreenHist, Color.ForestGreen);
     BlueHistogram  = new HistogramDrafter(PctBlueHist, Color.RoyalBlue);
     Histograms.Add(MonoHistogram);
     Histograms.Add(RedHistogram);
     Histograms.Add(GreenHistogram);
     Histograms.Add(BlueHistogram);
     stretchHistogramCommand = new StretchHistogramCommand(LookUpTablesSet, imageForm);
 }