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)); } }
/// <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); }
internal ToneReceivedEventArgs(ToneValue tone) { Tone = tone; }
internal ToneInfo(int sequenceId, ToneValue tone) { SequenceId = sequenceId; Tone = tone; }
public static ToneInfo ToneInfo(int sequenceId = default, ToneValue tone = default) { return(new ToneInfo(sequenceId, tone)); }