public blur() { m_rbuf2 = new ImageBuffer(); m_shape_bounds = new RectangleDouble(); m_method = new RadioButtonGroup(new Vector2(10.0, 10.0), new Vector2(130.0, 60.0)); m_radius = new Slider(new Vector2(130 + 10.0, 10.0 + 4.0), new Vector2(290, 8.0)); m_shadow_ctrl = new PolygonEditWidget(4); m_channel_r = new CheckBox(10.0, 80.0, "Red"); m_channel_g = new CheckBox(10.0, 95.0, "Green"); m_channel_b = new CheckBox(10.0, 110.0, "Blue"); m_FlattenCurves = new CheckBox(10, 315, "Convert And Flatten Curves"); m_FlattenCurves.Checked = true; AddChild(m_method); m_method.AddRadioButton("Stack Blur"); m_method.AddRadioButton("Recursive Blur"); m_method.AddRadioButton("Channels"); m_method.SelectedIndex = 1; AddChild(m_radius); m_radius.SetRange(0.0, 40.0); m_radius.Value = 15.0; m_radius.Text = "Blur Radius={0:F2}"; AddChild(m_shadow_ctrl); AddChild(m_channel_r); AddChild(m_channel_g); AddChild(m_channel_b); AddChild(m_FlattenCurves); m_channel_g.Checked = true; m_sl = new ScanlineCachePacked8(); StyledTypeFace typeFaceForLargeA = new StyledTypeFace(LiberationSansFont.Instance, 300, flattenCurves: false); m_path = typeFaceForLargeA.GetGlyphForCharacter('a'); Affine shape_mtx = Affine.NewIdentity(); shape_mtx *= Affine.NewTranslation(150, 100); m_path = new VertexSourceApplyTransform(m_path, shape_mtx); m_shape = new FlattenCurves(m_path); bounding_rect.bounding_rect_single(m_shape, 0, ref m_shape_bounds); m_shadow_ctrl.SetXN(0, m_shape_bounds.Left); m_shadow_ctrl.SetYN(0, m_shape_bounds.Bottom); m_shadow_ctrl.SetXN(1, m_shape_bounds.Right); m_shadow_ctrl.SetYN(1, m_shape_bounds.Bottom); m_shadow_ctrl.SetXN(2, m_shape_bounds.Right); m_shadow_ctrl.SetYN(2, m_shape_bounds.Top); m_shadow_ctrl.SetXN(3, m_shape_bounds.Left); m_shadow_ctrl.SetYN(3, m_shape_bounds.Top); m_shadow_ctrl.line_color(new ColorF(0, 0.3, 0.5, 0.3)); }
public PolygonPathingDemo() : base(740, 520) { BackgroundColor = RGBA_Bytes.White; pathTypeRadioGroup.AddRadioButton("Stay Inside"); pathTypeRadioGroup.AddRadioButton("Stay Outside"); pathTypeRadioGroup.SelectedIndex = 0; AddChild(pathTypeRadioGroup); shapeTypeRadioGroup.AddRadioButton("Simple Map"); shapeTypeRadioGroup.AddRadioButton("Multiple Pegs"); shapeTypeRadioGroup.AddRadioButton("Circle Holes"); shapeTypeRadioGroup.AddRadioButton("Great Britain"); shapeTypeRadioGroup.AddRadioButton("Arrows"); shapeTypeRadioGroup.AddRadioButton("Spiral"); shapeTypeRadioGroup.AddRadioButton("Glyph"); shapeTypeRadioGroup.SelectedIndex = 0; AddChild(shapeTypeRadioGroup); AnchorAll(); }
public PolygonClippingDemo() { BackgroundColor = RGBA_Bytes.White; m_operation.AddRadioButton("None"); m_operation.AddRadioButton("OR"); m_operation.AddRadioButton("AND"); m_operation.AddRadioButton("XOR"); m_operation.AddRadioButton("A-B"); m_operation.AddRadioButton("B-A"); m_operation.SelectedIndex = 2; AddChild(m_operation); m_polygons.AddRadioButton("Two Simple Paths"); m_polygons.AddRadioButton("Closed Stroke"); m_polygons.AddRadioButton("Great Britain and Arrows"); m_polygons.AddRadioButton("Great Britain and Spiral"); m_polygons.AddRadioButton("Spiral and Glyph"); m_polygons.SelectedIndex = 3; AddChild(m_polygons); AnchorAll(); }
public PolygonClippingDemo() { BackgroundColor = Color.White; m_operation = new RadioButtonGroup(new Vector2(555, 5), new Vector2(80, 130)) { HAnchor = HAnchor.Right | HAnchor.Fit, VAnchor = VAnchor.Bottom | VAnchor.Fit, Margin = new BorderDouble(5), }; m_polygons = new RadioButtonGroup(new Vector2(5, 5), new Vector2(205, 110)) { HAnchor = HAnchor.Left | HAnchor.Fit, VAnchor = VAnchor.Bottom | VAnchor.Fit, Margin = new BorderDouble(5), }; m_operation.AddRadioButton("None"); m_operation.AddRadioButton("OR"); m_operation.AddRadioButton("AND"); m_operation.AddRadioButton("XOR"); m_operation.AddRadioButton("A-B"); m_operation.AddRadioButton("B-A"); m_operation.SelectedIndex = 2; AddChild(m_operation); m_polygons.AddRadioButton("Two Simple Paths"); m_polygons.AddRadioButton("Closed Stroke"); m_polygons.AddRadioButton("Great Britain and Arrows"); m_polygons.AddRadioButton("Great Britain and Spiral"); m_polygons.AddRadioButton("Spiral and Glyph"); m_polygons.SelectedIndex = 3; AddChild(m_polygons); AnchorAll(); }
public image_filters() : base(FlowDirection.BottomToTop) { m_step = new Slider(new Vector2(115, 5), new Vector2(285, 6)); m_radius = new Slider(new Vector2(115, 5 + 15), new Vector2(285, 6)); filterSelectionButtons = new RadioButtonGroup(new Vector2(0.0, 10.0), new Vector2(110.0, 210.0)); m_normalize = new CheckBox(8.0, 215.0, "Normalize Filter"); m_refresh = new Button(8.0, 273.0, new ButtonViewText("Refresh", 8, 1, 3)); m_refresh.Click += RefreshImage; m_run = new Button(8.0, 253.0, new ButtonViewText("RUN Test!", 8, 1, 3)); m_run.Click += RunTest; m_single_step = new Button(8.0, 233.0, new ButtonViewText("Single Step", 8, 1, 3)); m_single_step.Click += SingleStep; m_cur_angle = (0.0); m_cur_filter = (1); m_num_steps = (0); m_num_pix = (0.0); m_time1 = (0); m_time2 = (0); m_ScanlinePacked = new ScanlineCachePacked8(); m_Rasterizer = new ScanlineRasterizer(); m_ScanlineUnpacked = new scanline_unpacked_8(); m_SpanAllocator = new span_allocator(); AddChild(m_radius); AddChild(m_step); AddChild(filterSelectionButtons); AddChild(m_run); AddChild(m_single_step); AddChild(m_normalize); AddChild(m_refresh); m_normalize.Checked = true; m_radius.Text = "Filter Radius={0:F2}"; m_step.Text = "Step={0:F2}"; m_radius.SetRange(2.0, 8.0); m_radius.Value = 4.0; m_step.SetRange(1.0, 10.0); m_step.Value = 5.0; filterSelectionButtons.AddRadioButton("simple (NN)"); filterSelectionButtons.AddRadioButton("bilinear"); filterSelectionButtons.AddRadioButton("bicubic"); filterSelectionButtons.AddRadioButton("spline16"); filterSelectionButtons.AddRadioButton("spline36"); filterSelectionButtons.AddRadioButton("hanning"); filterSelectionButtons.AddRadioButton("hamming"); filterSelectionButtons.AddRadioButton("hermite"); filterSelectionButtons.AddRadioButton("kaiser"); filterSelectionButtons.AddRadioButton("quadric"); filterSelectionButtons.AddRadioButton("catrom"); filterSelectionButtons.AddRadioButton("gaussian"); filterSelectionButtons.AddRadioButton("bessel"); filterSelectionButtons.AddRadioButton("mitchell"); filterSelectionButtons.AddRadioButton("sinc"); filterSelectionButtons.AddRadioButton("lanczos"); filterSelectionButtons.AddRadioButton("blackman"); filterSelectionButtons.SelectedIndex = 1; filterSelectionButtons.background_color(new ColorF(0.0, 0.0, 0.0, 0.1)); }