Exemplo n.º 1
0
 //------------------------------------------------------------------------
 void LineToInt(int x, int y)
 {
     m_VectorClipper.LineTo(m_outline,
                            m_VectorClipper.Downscale(x),
                            m_VectorClipper.Downscale(y));
     m_status = ScanlineStatus.LineTo;
 }
Exemplo n.º 2
0
 public void ClosePolygon()
 {
     if (m_status == ScanlineStatus.LineTo)
     {
         m_VectorClipper.LineTo(m_outline, m_start_x, m_start_y);
         m_status = ScanlineStatus.Closed;
     }
 }
Exemplo n.º 3
0
 //------------------------------------------------------------------------
 public void LineToDbl(T x, T y)
 {
     m_VectorClipper.LineTo(m_outline,
                            m_VectorClipper.Upscale(x),
                            m_VectorClipper.Upscale(y));
     m_status = ScanlineStatus.LineTo;
     //DebugFile.Print("x=" + x.ToString() + " y=" + y.ToString() + "\n");
 }
Exemplo n.º 4
0
 //------------------------------------------------------------------------
 void EdgeDbl(T x1, T y1, T x2, T y2)
 {
     if (m_outline.Sorted())
     {
         Reset();
     }
     m_VectorClipper.MoveTo(m_VectorClipper.Upscale(x1), m_VectorClipper.Upscale(y1));
     m_VectorClipper.LineTo(m_outline,
                            m_VectorClipper.Upscale(x2),
                            m_VectorClipper.Upscale(y2));
     m_status = ScanlineStatus.MoveTo;
 }
Exemplo n.º 5
0
 //------------------------------------------------------------------------
 void EdgeInt(int x1, int y1, int x2, int y2)
 {
     if (m_outline.Sorted())
     {
         Reset();
     }
     m_VectorClipper.MoveTo(m_VectorClipper.Downscale(x1), m_VectorClipper.Downscale(y1));
     m_VectorClipper.LineTo(m_outline,
                            m_VectorClipper.Downscale(x2),
                            m_VectorClipper.Downscale(y2));
     m_status = ScanlineStatus.MoveTo;
 }
Exemplo n.º 6
0
 //------------------------------------------------------------------------
 public void MoveToDbl(T x, T y)
 {
     if (m_outline.Sorted())
     {
         Reset();
     }
     if (m_auto_close)
     {
         ClosePolygon();
     }
     m_VectorClipper.MoveTo(m_start_x = m_VectorClipper.Upscale(x),
                            m_start_y = m_VectorClipper.Upscale(y));
     m_status = ScanlineStatus.MoveTo;
 }
Exemplo n.º 7
0
        /*
         * //--------------------------------------------------------------------
         * public uint apply_gamma(uint cover)
         * {
         *      return (uint)m_gamma[cover];
         * }
         */

        //--------------------------------------------------------------------
        void MoveToInt(int x, int y)
        {
            if (m_outline.Sorted())
            {
                Reset();
            }
            if (m_auto_close)
            {
                ClosePolygon();
            }
            m_VectorClipper.MoveTo(m_start_x = m_VectorClipper.Downscale(x),
                                   m_start_y = m_VectorClipper.Downscale(y));
            m_status = ScanlineStatus.MoveTo;
        }
Exemplo n.º 8
0
        //--------------------------------------------------------------------
        public RasterizerScanlineAA(IVectorClipper <T> rasterizer_sl_clip)
        {
            m_outline       = new RasterizerCellsAA();
            m_VectorClipper = rasterizer_sl_clip;
            m_filling_rule  = filling_rule_e.NonZero;
            m_auto_close    = true;
            m_start_x       = 0;
            m_start_y       = 0;
            m_status        = ScanlineStatus.Initial;

            int i;

            for (i = 0; i < (int)AAScale.Scale; i++)
            {
                m_gamma[i] = i;
            }
        }
Exemplo n.º 9
0
        /*
         * //--------------------------------------------------------------------
         * public rasterizer_scanline_aa(IClipper rasterizer_sl_clip, IGammaFunction gamma_function)
         * {
         *  m_outline = new rasterizer_cells_aa();
         *  m_clipper = rasterizer_sl_clip;
         *  m_filling_rule = filling_rule_e.fill_non_zero;
         *  m_auto_close = true;
         *  m_start_x = 0;
         *  m_start_y = 0;
         *  m_status = status.status_initial;
         *
         *  gamma(gamma_function);
         * }*/

        //--------------------------------------------------------------------
        public void Reset()
        {
            m_outline.Reset();
            m_status = ScanlineStatus.Initial;
        }