FT_Library_SetLcdFilterWeights() private method

private FT_Library_SetLcdFilterWeights ( IntPtr library, byte weights ) : System.Error
library System.IntPtr
weights byte
return System.Error
示例#1
0
        /// <summary>
        /// Use this function to override the filter weights selected by <see cref="SetLcdFilter"/>. By default,
        /// FreeType uses the quintuple (0x00, 0x55, 0x56, 0x55, 0x00) for <see cref="LcdFilter.Light"/>, and (0x10,
        /// 0x40, 0x70, 0x40, 0x10) for <see cref="LcdFilter.Default"/> and <see cref="LcdFilter.Legacy"/>.
        /// </summary>
        /// <remarks><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>
        /// This function must be called after <see cref="SetLcdFilter"/> to have any effect.
        /// </para></remarks>
        /// <param name="weights">
        /// A pointer to an array; the function copies the first five bytes and uses them to specify the filter
        /// weights.
        /// </param>
        public void SetLcdFilterWeights(byte[] weights)
        {
            if (weights == null)
            {
                throw new ArgumentNullException("weights");
            }

            Error err = FT.FT_Library_SetLcdFilterWeights(Reference, weights);

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }
        }
示例#2
0
        /// <summary>
        /// Use this function to override the filter weights selected by <see cref="SetLcdFilter"/>. By default,
        /// FreeType uses the quintuple (0x00, 0x55, 0x56, 0x55, 0x00) for <see cref="LcdFilter.Light"/>, and (0x10,
        /// 0x40, 0x70, 0x40, 0x10) for <see cref="LcdFilter.Default"/> and <see cref="LcdFilter.Legacy"/>.
        /// </summary>
        /// <remarks><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>
        /// This function must be called after <see cref="SetLcdFilter"/> to have any effect.
        /// </para></remarks>
        /// <param name="weights">
        /// A pointer to an array; the function copies the first five bytes and uses them to specify the filter
        /// weights.
        /// </param>
        public void SetLcdFilterWeights(byte[] weights)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("Library", "Cannot access a disposed object.");
            }

            if (weights == null)
            {
                throw new ArgumentNullException("weights");
            }

            Error err = FT.FT_Library_SetLcdFilterWeights(Reference, weights);

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }
        }