コード例 #1
0
        /// <summary>
        /// Bitmap Smooth
        /// </summary>
        /// <param name="b">Set the bitmap</param>
        /// <param name="nWeight">Set the weight of the bitmap.Default is 1</param>
        /// <returns></returns>
        public static bool Smooth(System.Drawing.Bitmap b, int nWeight /* default to 1 */)
        {
            ConvMatrix m = new ConvMatrix();

            m.SetAll(1);
            m.Pixel  = nWeight;
            m.Factor = nWeight + 8;

            return(BitmapFilter.Conv3x3(b, m));
        }
コード例 #2
0
        /// <summary>
        /// Bitmap Mean Removal
        /// </summary>
        /// <param name="b">Set the bitmap</param>
        /// <param name="nWeight">Set the weight of the bitmap.Default is 9</param>
        /// <returns></returns>
        public static bool MeanRemoval(System.Drawing.Bitmap b, int nWeight /* default to 9*/)
        {
            ConvMatrix m = new ConvMatrix();

            m.SetAll(-1);
            m.Pixel  = nWeight;
            m.Factor = nWeight - 8;

            return(BitmapFilter.Conv3x3(b, m));
        }
コード例 #3
0
        /// <summary>
        /// Bitmap EmbossLaplacian
        /// </summary>
        /// <param name="b">Set the bitmap</param>
        /// <returns></returns>
        public static bool EmbossLaplacian(System.Drawing.Bitmap b)
        {
            ConvMatrix m = new ConvMatrix();

            m.SetAll(-1);
            m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = 0;
            m.Pixel  = 4;
            m.Offset = 127;

            return(BitmapFilter.Conv3x3(b, m));
        }
コード例 #4
0
        /// <summary>
        /// Bitmap Sharpen
        /// </summary>
        /// <param name="b">Set the bitmap</param>
        /// <param name="nWeight">Set the weight of the bitmap.Default is 11</param>
        /// <returns></returns>
        public static bool Sharpen(System.Drawing.Bitmap b, int nWeight /* default to 11*/)
        {
            ConvMatrix m = new ConvMatrix();

            m.SetAll(0);
            m.Pixel  = nWeight;
            m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = -2;
            m.Factor = nWeight - 8;

            return(BitmapFilter.Conv3x3(b, m));
        }
コード例 #5
0
        /// <summary>
        /// Gausian Blur function
        /// </summary>
        /// <param name="b">Set bitmap</param>
        /// <param name="nWeight">Set the weight of the bitmap which has a default value of 4 </param>
        /// <returns></returns>
        public static bool GaussianBlur(System.Drawing.Bitmap b, int nWeight /* default to 4*/)
        {
            ConvMatrix m = new ConvMatrix();

            m.SetAll(1);
            m.Pixel  = nWeight;
            m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = 2;
            m.Factor = nWeight + 12;

            return(BitmapFilter.Conv3x3(b, m));
        }