コード例 #1
0
ファイル: AlphaMask.cs プロジェクト: tmstar/fork-typography
        //--------------------------------------------------------------------
        //public byte combine_pixel(int x, int y, byte val)
        //{
        //    unchecked
        //    {
        //        int bufferIndex = m_rbuf.GetBufferOffsetXY(x, y);
        //        byte[] buffer = m_rbuf.GetBuffer();
        //        return (byte)((255 + val * buffer[bufferIndex]) >> 8);
        //    }
        //}

        public void fill_hspan(int x, int y, byte[] dst, int dstIndex, int num_pix)
        {
            throw new NotImplementedException();
#if false
            byte[] mask = m_rbuf.GetPixelPointerY(y) + x * m_Step + m_Offset;
            do
            {
                *dst++ = *mask;
                mask += m_Step;
            }while (--num_pix != 0);
#endif
        }
コード例 #2
0
ファイル: AlphaMask.cs プロジェクト: tmstar/fork-typography
        //public byte combine_pixel(int x, int y, byte val)
        //{
        //    unchecked
        //    {
        //        if ((uint)x < (uint)m_rbuf.Width
        //            && (uint)y < (uint)m_rbuf.Height)
        //        {
        //            int bufferIndex = m_rbuf.GetBufferOffsetXY(x, y);
        //            byte[] buffer = m_rbuf.GetBuffer();
        //            return (byte)((val * buffer[bufferIndex] + 255) >> 8);
        //        }
        //    }
        //    return 0;
        //}

        public void fill_hspan(int x, int y, byte[] dst, int dstIndex, int num_pix)
        {
            throw new NotImplementedException();
#if false
            int xmax = (int)m_rbuf.Width() - 1;
            int ymax = (int)m_rbuf.Height() - 1;

            int    count  = num_pix;
            byte[] covers = dst;

            if (y < 0 || y > ymax)
            {
                agg_basics.MemClear(dst, num_pix);
                return;
            }

            if (x < 0)
            {
                count += x;
                if (count <= 0)
                {
                    agg_basics.MemClear(dst, num_pix);
                    return;
                }
                agg_basics.MemClear(covers, -x);
                covers -= x;
                x       = 0;
            }

            if (x + count > xmax)
            {
                int rest = x + count - xmax - 1;
                count -= rest;
                if (count <= 0)
                {
                    agg_basics.MemClear(dst, num_pix);
                    return;
                }
                agg_basics.MemClear(covers + count, rest);
            }

            byte[] mask = m_rbuf.GetPixelPointerY(y) + x * m_Step + m_Offset;
            do
            {
                *covers++ = *(mask);
                mask += m_Step;
            }while (--count != 0);
#endif
        }