internal static extern Error FT_Library_SetLcdFilter(IntPtr library, LcdFilter filter);
/// <summary> /// This function is used to apply color filtering to LCD decimated bitmaps, like the ones used when calling /// <see cref="GlyphSlot.RenderGlyph"/> with <see cref="RenderMode.Lcd"/> or /// <see cref="RenderMode.VerticalLcd"/>. /// </summary> /// <remarks><para> /// This feature is always disabled by default. Clients must make an explicit call to this function with a /// ‘filter’ value other than <see cref="LcdFilter.None"/> in order to enable it. /// </para><para> /// Due to <b>PATENTS</b> covering subpixel rendering, this function doesn't do anything except returning /// <see cref="Error.UnimplementedFeature"/> if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is /// not defined in your build of the library, which should correspond to all default builds of FreeType. /// </para><para> /// The filter affects glyph bitmaps rendered through <see cref="GlyphSlot.RenderGlyph"/>, /// <see cref="Outline.GetBitmap(FTBitmap)"/>, <see cref="Face.LoadGlyph"/>, and <see cref="Face.LoadChar"/>. /// </para><para> /// It does not affect the output of <see cref="Outline.Render(RasterParams)"/> and /// <see cref="Outline.GetBitmap(FTBitmap)"/>. /// </para><para> /// If this feature is activated, the dimensions of LCD glyph bitmaps are either larger or taller than the /// dimensions of the corresponding outline with regards to the pixel grid. For example, for /// <see cref="RenderMode.Lcd"/>, the filter adds up to 3 pixels to the left, and up to 3 pixels to the right. /// </para><para> /// The bitmap offset values are adjusted correctly, so clients shouldn't need to modify their layout and glyph /// positioning code when enabling the filter. /// </para></remarks> /// <param name="filter"><para> /// The filter type. /// </para><para> /// You can use <see cref="LcdFilter.None"/> here to disable this feature, or <see cref="LcdFilter.Default"/> /// to use a default filter that should work well on most LCD screens. /// </para></param> public void SetLcdFilter(LcdFilter filter) { if (disposed) throw new ObjectDisposedException("Library", "Cannot access a disposed object."); Error err = FT.FT_Library_SetLcdFilter(Reference, filter); if (err != Error.Ok) throw new FreeTypeException(err); }