/// <summary> /// /// </summary> /// <param name="color"> /// A <see cref="RgbaFloats"/> /// </param> public RgbaFloats(RgbaFloats color) : this(color, 1) { }
/// <summary> /// /// </summary> /// <param name="color"> /// A <see cref="RgbaFloats"/> /// </param> /// <param name="a"> /// A <see cref="System.Double"/> /// </param> public RgbaFloats(RgbaFloats color, float a) : this(color._r, color._g, color._b, color._a) { }
/// <summary> /// /// </summary> /// <param name="wl"> /// A <see cref="System.Double"/> /// </param> /// <param name="gamma"> /// A <see cref="System.Double"/> /// </param> /// <returns> /// A <see cref="RgbaFloats"/> /// </returns> public static RgbaFloats FromWavelength(float wl, float gamma) { RgbaFloats t = new RgbaFloats (0.0f, 0.0f, 0.0f); if (wl >= 380.0f && wl <= 440.0f) { t._r = -1.0f * (wl - 440.0f) / (440.0f - 380.0f); t._b = 1.0f; } else if (wl >= 440.0f && wl <= 490.0f) { t._g = (wl - 440.0f) / (490.0f - 440.0f); t._b = 1.0f; } else if (wl >= 490.0f && wl <= 510.0f) { t._g = 1.0f; t._b = -1.0f * (wl - 510.0f) / (510.0f - 490.0f); } else if (wl >= 510.0 && wl <= 580.0) { t._r = (wl - 510.0f) / (580.0f - 510.0f); t._g = 1.0f; } else if (wl >= 580.0f && wl <= 645.0f) { t._r = 1.0f; t._g = -1.0f * (wl - 645.0f) / (645.0f - 580.0f); } else if (wl >= 645.0f && wl <= 780.0f) { t._r = 1.0f; } float s = 1.0f; if (wl > 700.0f) s = 0.3f + 0.7f * (780.0f - wl) / (780.0f - 700.0f); else if (wl < 420.0) s = 0.3f + 0.7f * (wl - 380.0f) / (420.0f - 380.0f); t._r = (float)Math.Pow (t._r * s, gamma); t._g = (float)Math.Pow (t._g * s, gamma); t._b = (float)Math.Pow (t._b * s, gamma); return t; }
/// <summary> /// /// </summary> /// <param name="imageSource"> /// A <see cref="IImageFloat"/> /// </param> /// <param name="x"> /// A <see cref="System.Double"/> /// </param> /// <param name="y"> /// A <see cref="System.Double"/> /// </param> /// <param name="angleDegrees"> /// A <see cref="System.Double"/> /// </param> /// <param name="scaleX"> /// A <see cref="System.Double"/> /// </param> /// <param name="ScaleY"> /// A <see cref="System.Double"/> /// </param> /// <param name="color"> /// A <see cref="RGBA_Floats"/> /// </param> /// <param name="renderingMode"> /// A <see cref="BlendMode"/> /// </param> public abstract void Render(IImageFloat imageSource, double x, double y, double angleDegrees, double scaleX, double ScaleY, RgbaFloats color, BlendMode renderingMode);