示例#1
0
    public static unsafe void Transform2Linear(IplImage p_img, ToneValue ImageToneValue) //階調値の線形変換 グレイスケールのみ
    {
        double magnification = 255.99 / (ImageToneValue.Max - ImageToneValue.Min);       //255.99ないと255が254になる
        byte * p             = (byte *)p_img.ImageData;

        for (int y = 0; y < p_img.ImageSize; ++y)
        {
            p[y] = Image.CheckRange2Byte(magnification * (p[y] - ImageToneValue.Min));
        }
    }
示例#2
0
        /// <summary>
        /// Converts a <paramref name="tone"/> to the corresponding <see cref="string"/>.
        /// </summary>
        /// <param name="tone"><see cref="ToneValue"/> to be converted.</param>
        /// <returns><see cref="string"/> value of the <paramref name="tone"/>.</returns>
        private string ToneValueToString(ToneValue tone)
        {
            switch (tone)
            {
            case ToneValue.Tone0:
                return("0");

            case ToneValue.Tone1:
                return("1");

            case ToneValue.Tone2:
                return("2");

            case ToneValue.Tone3:
                return("3");

            case ToneValue.Tone4:
                return("4");

            case ToneValue.Tone5:
                return("5");

            case ToneValue.Tone6:
                return("6");

            case ToneValue.Tone7:
                return("7");

            case ToneValue.Tone8:
                return("8");

            case ToneValue.Tone9:
                return("9");

            case ToneValue.ToneStar:
                return("*");

            case ToneValue.TonePound:
                return("#");
            }

            return(null);
        }
示例#3
0
 internal ToneReceivedEventArgs(ToneValue tone)
 {
     Tone = tone;
 }
示例#4
0
 internal ToneInfo(int sequenceId, ToneValue tone)
 {
     SequenceId = sequenceId;
     Tone       = tone;
 }
示例#5
0
 public static ToneInfo ToneInfo(int sequenceId = default, ToneValue tone = default)
 {
     return(new ToneInfo(sequenceId, tone));
 }