Example #1
0
        public unsafe void BlendVerticalColorSpan(int x, int y, uint len, RGBA_Bytes *colors, byte *covers, byte cover)
        {
            byte *p         = _rasterBuffer.GetPixelPointer(y) + x + x + x;
            int   scanWidth = _rasterBuffer.StrideInBytes();

            if (covers != null)
            {
                do
                {
                    CopyOrBlendBGRWrapper.CopyOrBlendPixel(_blender, p, colors->m_R, colors->m_G, colors->m_B, colors->m_A, *covers++);
                    p = &p[scanWidth];
                    ++colors;
                }while (--len != 0);
            }
            else
            {
                if (cover == 255)
                {
                    do
                    {
                        CopyOrBlendBGRWrapper.CopyOrBlendPixel(_blender, p, colors->R_Byte, colors->G_Byte, colors->B_Byte, colors->A_Byte); p = &p[scanWidth];
                        ++colors;
                    }while (--len != 0);
                }
                else
                {
                    do
                    {
                        CopyOrBlendBGRWrapper.CopyOrBlendPixel(_blender, p, colors->R_Byte, colors->G_Byte, colors->B_Byte, colors->A_Byte, cover);
                        p = &p[scanWidth];
                        ++colors;
                    }while (--len != 0);
                }
            }
        }
Example #2
0
        //--------------------------------------------------------------------
        unsafe public void BlendHorizontalColorSpan(int x, int y, uint len, RGBA_Bytes *colors, byte *covers, byte cover)
        {
            byte *p = _rasterBuffer.GetPixelPointer(y) + x + x + x;

            if (covers != null)
            {
                do
                {
                    CopyOrBlendBGRWrapper.CopyOrBlendPixel(_blender, p,
                                                           colors->m_R,
                                                           colors->m_G,
                                                           colors->m_B,
                                                           colors->m_A,
                                                           *covers++);
                    p += 3;
                    ++colors;
                }while (--len != 0);
            }
            else
            {
                if (cover == 255)
                {
                    do
                    {
                        CopyOrBlendBGRWrapper.CopyOrBlendPixel(_blender, p,
                                                               colors->R_Byte,
                                                               colors->G_Byte,
                                                               colors->B_Byte,
                                                               colors->A_Byte);
                        p += 3;
                        ++colors;
                    }while (--len != 0);
                }
                else
                {
                    do
                    {
                        CopyOrBlendBGRWrapper.CopyOrBlendPixel(_blender, p,
                                                               colors->R_Byte,
                                                               colors->G_Byte,
                                                               colors->B_Byte,
                                                               colors->A_Byte,
                                                               cover);
                        p += 3;
                        ++colors;
                    }while (--len != 0);
                }
            }
        }