public void LoadTexture1(GLBitmap bmp) { textureSubPixRendering.LoadGLBitmap(bmp); textureSubPixRendering.IsBigEndian = bmp.IsBigEndianPixel; textureSubPixRendering.SetColor(this.FontFillColor); textureSubPixRendering.SetIntensity(1f); }
public void DrawGlyphImageWithSubPixelRenderingTechnique( GLBitmap bmp, ref PixelFarm.Drawing.Rectangle r, float targetLeft, float targetTop, float scale) { if (bmp.IsBigEndianPixel) { throw new NotSupportedException(); } else { textureSubPixRendering.LoadGLBitmap(bmp); textureSubPixRendering.IsBigEndian = bmp.IsBigEndianPixel; textureSubPixRendering.SetColor(this.FontFillColor); textureSubPixRendering.SetIntensity(1f); //------------------------- //draw a serie of image*** //------------------------- //TODO: review performance here *** //1. B , cyan result GL.ColorMask(false, false, true, false); textureSubPixRendering.SetCompo(0); textureSubPixRendering.DrawSubImage(r.Left, r.Top, r.Width, r.Height, targetLeft, targetTop); //float subpixel_shift = 1 / 9f; //textureSubPixRendering.DrawSubImage(r.Left, r.Top, r.Width, r.Height, targetLeft - subpixel_shift, targetTop); //TODO: review this option //--------------------------------------------------- //2. G , magenta result GL.ColorMask(false, true, false, false); textureSubPixRendering.SetCompo(1); textureSubPixRendering.DrawSubImage(r.Left, r.Top, r.Width, r.Height, targetLeft, targetTop); //textureSubPixRendering.DrawSubImage(r.Left, r.Top, r.Width, r.Height, targetLeft, targetTop); //TODO: review this option //1. R , yellow result textureSubPixRendering.SetCompo(2); GL.ColorMask(true, false, false, false);// textureSubPixRendering.DrawSubImage(r.Left, r.Top, r.Width, r.Height, targetLeft, targetTop); //textureSubPixRendering.DrawSubImage(r.Left, r.Top, r.Width, r.Height, targetLeft + subpixel_shift, targetTop); //TODO: review this option //enable all color component GL.ColorMask(true, true, true, true); } }