///<summary> ///</summary> ///<param name="pixf"></param> ///<param name="mask"></param> public AlphaMaskAdaptor(IPixelFormat pixf, IAlphaMask mask) : base(pixf) { PixelFormat = pixf; _alphaMask = mask; _span = new ArrayPOD<byte>(255); }
public AlphaMaskAdaptor(IImageReaderWriter image, IAlphaMask mask) : base(image) { linkedImage = image; m_mask = mask; m_spans = new byte[256]; }
public AlphaMaskAdaptor(IImageByte image, IAlphaMask mask) : base(image) { linkedImage = image; m_mask = mask; m_span = new ArrayPOD <byte>(255); }
public AlphaMaskAdaptor(IPixelFormat pixf, IAlphaMask mask) : base(pixf) { m_pixf = pixf; m_mask = mask; m_span = new ArrayPOD <byte>(255); }
public AlphaMaskAdaptor(IImageByte image, IAlphaMask mask) : base(image) { linkedImage = image; m_mask = mask; m_span = new ArrayPOD<byte>(255); }
void generate_alpha_mask(ScanlineRasToDestBitmapRenderer sclineRasToBmp, ScanlinePacked8 sclnPack, ScanlineRasterizer rasterizer, int width, int height) { alphaBitmap = new ActualImage(width, height, PixelFormat.GrayScale8); var bmpReaderWrtier = new MyImageReaderWriter(alphaBitmap); alphaMaskImageBuffer = new ChildImage(bmpReaderWrtier, new PixelBlenderGray(1)); alphaMask = new AlphaMaskByteClipped(alphaMaskImageBuffer, 1, 0); #if USE_CLIPPING_ALPHA_MASK //alphaMaskImageBuffer.AttachBuffer(alphaBitmap.GetBuffer(), 20 * width + 20, width - 40, height - 40, width, 8, 1); #else alphaMaskImageBuffer.attach(alphaByteArray, (int)cx, (int)cy, cx, 1); #endif var image = new ChildImage(alphaMaskImageBuffer, new PixelBlenderGray(1), 1, 0, 8); ClipProxyImage clippingProxy = new ClipProxyImage(image); clippingProxy.Clear(ColorRGBA.Black); VertexSource.Ellipse ellipseForMask = new PixelFarm.Agg.VertexSource.Ellipse(); System.Random randGenerator = new Random(1432); int i; int num = (int)maskAlphaSliderValue; for (i = 0; i < num; i++) { if (i == num - 1) { ellipseForMask.Reset(Width / 2, Height / 2, 110, 110, 100); rasterizer.AddPath(ellipseForMask.MakeVertexSnap()); sclineRasToBmp.RenderWithColor(clippingProxy, rasterizer, sclnPack, new ColorRGBA(0, 0, 0, 255)); ellipseForMask.Reset(ellipseForMask.originX, ellipseForMask.originY, ellipseForMask.radiusX - 10, ellipseForMask.radiusY - 10, 100); rasterizer.AddPath(ellipseForMask.MakeVertexSnap()); sclineRasToBmp.RenderWithColor(clippingProxy, rasterizer, sclnPack, new ColorRGBA(255, 0, 0, 255)); } else { ellipseForMask.Reset(randGenerator.Next() % width, randGenerator.Next() % height, randGenerator.Next() % 100 + 20, randGenerator.Next() % 100 + 20, 100); // set the color to draw into the alpha channel. // there is not very much reason to set the alpha as you will get the amount of // transparency based on the color you draw. (you might want some type of different edeg effect but it will be minor). rasterizer.AddPath(ellipseForMask.MakeVxs()); sclineRasToBmp.RenderWithColor(clippingProxy, rasterizer, sclnPack, ColorRGBA.Make((int)((float)i / (float)num * 255), 0, 0, 255)); } } }
public alpha_mask2_application() { AnchorAll(); alphaMaskImageBuffer = new ImageBuffer(); #if USE_CLIPPING_ALPHA_MASK alphaMask = new AlphaMaskByteClipped(alphaMaskImageBuffer, 1, 0); #else alphaMask = new AlphaMaskByteUnclipped(alphaMaskImageBuffer, 1, 0); #endif numMasksSlider = new UI.Slider(5, 5, 150, 12); sliderValue = 0.0; AddChild(numMasksSlider); numMasksSlider.SetRange(5, 100); numMasksSlider.Value = 10; numMasksSlider.Text = "N={0:F3}"; numMasksSlider.OriginRelativeParent = Vector2.Zero; }
public alpha_mask2_application(PixelFormats format, ERenderOrigin RenderOrigin) : base(format, RenderOrigin) { m_alpha_mask_rbuf = new RasterBuffer(); #if USE_CLIPPING_ALPHA_MASK m_alpha_mask = new AlphaMaskByteClipped(m_alpha_mask_rbuf, 1, 0); #else m_alpha_mask = new AlphaMaskByteUnclipped(m_alpha_mask_rbuf, 1, 0); #endif m_num_cb = new UI.SliderWidget <T>(5, 5, 150, 12); m_slider_value = M.Zero <T>(); parse_lion(); AddChild(m_num_cb); m_num_cb.range(5, 100); m_num_cb.value(10); m_num_cb.label("N={0:F3}"); m_num_cb.SetTransform(MatrixFactory <T> .NewIdentity(VectorDimension.Two)); }
///<summary> ///</summary> ///<param name="mask"></param> public void AttachAlphaMask(IAlphaMask mask) { _alphaMask = mask; }
public void attach_alpha_mask(IAlphaMask mask) { m_mask = mask; }
public void AttachAlphaMask(IAlphaMask mask) { m_mask = mask; }
public void BeginGraphicsContext(AGG.Transform.ITransform transform, IAlphaMask mask) { throw new NotImplementedException(); }