public ColorMatrixFilter(ColorMatrix matrix = null) { if (matrix != null) { ColorEffect.Matrix = matrix; ColorEffect.UpdateShaderMatrix(); } }
/// <summary> /// Concatenates the current matrix with another one. /// </summary> public void ConcatColorMatrix(ColorMatrix colorMatrix) { ColorEffect.Matrix.ConcatColorMatrix(colorMatrix); ColorEffect.UpdateShaderMatrix(); SetRequiresRedraw(); }
/// <summary> /// Changes the hue of the image. Typical values are in the range(-1, 1). /// </summary> public void AdjustHue(float hue) { ColorEffect.Matrix.AdjustHue(hue); ColorEffect.UpdateShaderMatrix(); SetRequiresRedraw(); }
/// <summary> /// Changes the brightness. Typical values are in the range(-1, 1). Values above zero will make the /// image brighter, values below zero will make it darker. /// </summary> public void AdjustBrightness(float brightness) { ColorEffect.Matrix.AdjustBrightness(brightness); ColorEffect.UpdateShaderMatrix(); SetRequiresRedraw(); }
/// <summary> /// Changes the contrast. Typical values are in the range(-1, 1). Values above zero will raise, /// values below zero will reduce the contrast. /// </summary> public void AdjustContrast(float contrast) { ColorEffect.Matrix.AdjustContrast(contrast); ColorEffect.UpdateShaderMatrix(); SetRequiresRedraw(); }
/// <summary> /// Changes the saturation. Typical values are in the range(-1, 1). Values above zero will raise, /// values below zero will reduce the saturation. '-1' will produce a grayscale image. /// </summary> public void AdjustSaturation(float saturation) { ColorEffect.Matrix.AdjustSaturation(saturation); ColorEffect.UpdateShaderMatrix(); SetRequiresRedraw(); }
/// <summary> /// Inverts the colors of the filtered objects. /// </summary> public void Invert() { ColorEffect.Matrix.Invert(); ColorEffect.UpdateShaderMatrix(); SetRequiresRedraw(); }