public void Initialize(double[] data, int width, int height, IColorTable colorTable, IColorMap colorMap) { // set members _width = width; _height = height; _rawData = data; // set default for this _invalidPixelValueColor = Color.White; // allocate image buffer _data = new int[width * height]; // set color table now, we need it during raw buffer creation // TODO: throw if null, initialize? _colorTable = colorTable; // create color map if (colorMap != null) { _colorMap = colorMap; } else { _colorMap = ColorMapFactory.Create(ColorMapTypes.Gray); _colorMap.Initialize(); _colorMap.Bias = 0.5; _colorMap.Contrast = 1; } // create raw image buffer. // separating this will add more granularity saving time if we want to rebuild // since we dont want to recalc extremes again...etc CreateRawImageBuffer(); }
static public IColorTable FromFile(string path) { IColorTable ct = null; XmlReader r = null; try { r = XmlReader.Create(path); r.ReadToFollowing("ColorTable"); ColorTableType ctt = (ColorTableType)Enum.Parse(typeof(ColorTableType), r["Type"]); int cts = int.Parse(r["Size"]); ScalingAlgorithms sa = (ScalingAlgorithms)Enum.Parse(typeof(ScalingAlgorithms), r["Scale"]); double min = double.Parse(r["Minimum"]); double max = double.Parse(r["Maximum"]); ct = ColorTableFactory.Create(ctt); if (ct != null) { ct.ScalingAlgorithm = ScalingAlgorithmFactory.Create(sa); ct.Initialize(cts, min, max); } } finally { if (r != null) { r.Close(); } } return(ct); }
private void ResetColorTable() { IColorTable ct = ColorTableFactory.Create(_modelState.ColorTable.Type); ct.Initialize(1 << _modelState.ColorTable.Depth, _modelState.PixelMinimum, _modelState.PixelMaximum); ct.ScalingAlgorithm = ScalingAlgorithmFactory.Create(_modelState.ColorTable.ScalingAlgorithmType); _colorTable = ct; }
public ColorTheme( ISystemThemeDetector systemThemeDetector, LogJoint.Settings.IGlobalSettingsAccessor settings ) { this.systemThemeDetector = systemThemeDetector; this.threadColors = new LogThreadsColorsTable(this, () => settings.Appearance.ColoringBrightness); this.highlightingColors = new HighlightBackgroundColorsTable(this); }
public Presenter( IFiltersList filtersList, IView view, FilterDialog.IPresenter filtersDialogPresenter, IColorTable highlightColorsTable ) { this.filtersList = filtersList; this.view = view; this.filtersDialogPresenter = filtersDialogPresenter; this.highlightColorsTable = highlightColorsTable; view.SetPresenter(this); }
public Presenter( ILogSourcesManager logSources, IFiltersList filtersList, IView view, IColorTable highlightColorsTable ) { this.logSources = logSources; this.view = view; this.highlightColorsTable = highlightColorsTable; this.actionsOptions = MakeActionsOptions(filtersList.Purpose, highlightColorsTable); this.scopeSupported = filtersList.Purpose == FiltersListPurpose.Highlighting; view.SetEventsHandler(this); }
/// <summary>Creates new color table based on existing color table.</summary> /// <param name="colorTable">Color table to copy colors from.</param> /// <exception cref="ArgumentNullException"><paramref name="colorTable"/> == <c>null</c>.</exception> public CustomColorTable(IColorTable colorTable) { Verify.Argument.IsNotNull(colorTable, "colorTable"); Background = colorTable.Background; ArrowNormal = colorTable.ArrowNormal; ArrowHover = colorTable.ArrowHover; ArrowPressed = colorTable.ArrowPressed; ArrowDisabled = colorTable.ArrowDisabled; ThumbNormal = colorTable.ThumbNormal; ThumbHover = colorTable.ThumbHover; ThumbPressed = colorTable.ThumbPressed; ThumbDisabled = colorTable.ThumbDisabled; }
public static IColorTable Create(ColorTableType ctt) { IColorTable ct = null; switch (ctt) { case ColorTableType.ReducedColors: ct = new ReducedColorTable(); break; case ColorTableType.FullScale: ct = new FullScaledColorTable(); break; case ColorTableType.Indexed: ct = new IndexedColorTable(); break; } return(ct); }
static public IImage FromFile(string nicFile) { IImage ii = null; StreamReader sr = null; XmlReader r = null; ImageTypes it = ImageTypes.Indexed; Color nan = Color.Empty; try { sr = new StreamReader(nicFile); r = XmlReader.Create(sr.BaseStream); r.ReadToFollowing("ImageConfig"); it = (ImageTypes)Enum.Parse(typeof(ImageTypes), r["Type"]); nan = Color.FromArgb(int.Parse(r["NaNColor"])); r.Close(); r = null; sr.Close(); sr = null; IColorTable ct = ColorTableFactory.FromFile(nicFile); IColorMap cm = ColorMapFactory.FromFile(nicFile); ii = ImageFactory.Create(it); if (ii != null) { ii.ColorTable = ct; ii.ColorMap = cm; ii.InvalidPixelValueColor = nan; } } finally { if (r != null) { r.Close(); } if (sr != null) { sr.Close(); } } return(ii); }
public MSVS2012CheckBoxRenderer(IColorTable colorTable) { Verify.Argument.IsNotNull(colorTable, "colorTable"); _colorTable = colorTable; }
public MSVS2012CustomListBoxRenderer(IColorTable colorTable) { Verify.Argument.IsNotNull(colorTable, nameof(colorTable)); _colorTable = colorTable; }
public static Color GetByIndex(this IColorTable table, int index) { return(GetByIndex(table.Items, index)); }
public MSVS2012ScrollBarRenderer(IColorTable colorTable) { Verify.Argument.IsNotNull(colorTable, "colorTable"); _colorTable = colorTable; }
public MSVS2012ButtonRenderer(IColorTable colorTable) { Verify.Argument.IsNotNull(colorTable, nameof(colorTable)); _colorTable = colorTable; }
public MSVS2012StyleToolStripRenderer(IColorTable colorTable) { Verify.Argument.IsNotNull(colorTable, "colorTable"); _colorTable = colorTable; }
static List <Tuple <FilterAction, string, Color?> > MakeActionsOptions(FiltersListPurpose purpose, IColorTable highlightColorsTable) { var actionOptions = new List <Tuple <FilterAction, string, Color?> >(); string excludeDescription; if (purpose == FiltersListPurpose.Highlighting) { excludeDescription = "Exclude from highlighting"; } else if (purpose == FiltersListPurpose.Search) { excludeDescription = "Exclude from search results"; } else { excludeDescription = "Exclude"; } actionOptions.Add(Tuple.Create(FilterAction.Exclude, excludeDescription, new Color?())); if (purpose == FiltersListPurpose.Search) { actionOptions.Add(Tuple.Create(FilterAction.Include, "Include to search result", new Color?())); } string includeAndColorizeFormat; if (purpose == FiltersListPurpose.Highlighting) { includeAndColorizeFormat = " Highlight with color #{0} "; } else if (purpose == FiltersListPurpose.Search) { includeAndColorizeFormat = " Include to search result and highlight with color #{0} "; } else { includeAndColorizeFormat = " Include and highlight with color #{0} "; } for (var a = FilterAction.IncludeAndColorizeFirst; a <= FilterAction.IncludeAndColorizeLast; ++a) { actionOptions.Add(Tuple.Create(a, string.Format(includeAndColorizeFormat, a - FilterAction.IncludeAndColorizeFirst + 1), a.ToColor(highlightColorsTable.Items))); } return(actionOptions); }
public TemporaryColorTheme(IColorTheme appTheme, IChangeNotification changeNotification) { this.appTheme = appTheme; this.changeNotification = changeNotification; this.threadsColorTable = new LogThreadsColorsTable(this, () => paletteBrightness); }
public ModelThreads(IColorTable colors) { this.colors = colors; }
public IColorTableObject(IColorTable IColorTableinstance) { IColorTableInstance = IColorTableinstance; }
public AdjustingColorsGenerator(IColorTable innerTable, PaletteBrightness paletteBrightness) { this.innerTable = innerTable; this.paletteBrightness = paletteBrightness; }