private unsafe void ApplySepiaToPixel(byte *blue, double factor) { int tone = RgbComponentOperations.ComputeSepiaTone(*blue, *(blue + (byte)Argb.green), *(blue + (byte)Argb.red)); *blue = RgbComponentOperations.ComputeSepiaBlue(tone); *(blue + (byte)Argb.green) = RgbComponentOperations.ComputeSepiaGreen(tone); *(blue + (byte)Argb.red) = RgbComponentOperations.ComputeSepiaRed(tone); }
private unsafe void ApplyInversionToPixel(byte *blue, double factor) { for (Argb i = Argb.blue; i <= Argb.red; ++i) { byte componentValue = *(blue + (byte)i); *(blue + (byte)i) = RgbComponentOperations.Invert(componentValue, (int)factor); } }
private unsafe void ApplyGammaCorrectionToPixel(byte *blue, double factor) { for (Argb i = Argb.blue; i <= Argb.red; ++i) { byte componentValue = *(blue + (byte)i); *(blue + (byte)i) = RgbComponentOperations.Gamma(componentValue, factor); } }
private unsafe void ApplyExposureCompensationToPixel(byte *blue, double factor) { for (Argb i = Argb.blue; i <= Argb.red; ++i) { byte componentValue = *(blue + (byte)i); *(blue + (byte)i) = RgbComponentOperations.Exposure(componentValue, factor); } }
private unsafe void ApplyBrightnessToPixel(byte *blue, double factor) { for (Argb i = Argb.blue; i <= Argb.red; ++i) { byte componentValue = *(blue + (byte)i); *(blue + (byte)i) = RgbComponentOperations.ChangeBrightness(componentValue, factor); } }
private byte ApplyBlur(byte[] neighborhood) { int sum = 0; for (int i = 0; i < neighborhoodSize; ++i) { sum += neighborhood[i]; } return(RgbComponentOperations.ControlOverflow(sum / neighborhoodSize)); }
protected override byte ComputeNewRgbComponentValue(byte[] neighborhood) { double sum = 0; for (int i = 0; i < neighborhood.Length; ++i) { sum += neighborhood[i] * kernel[i]; } sum *= factor; return(RgbComponentOperations.ControlOverflow(sum)); }
private unsafe void ApplyBrightnessToPixelBlue(byte *blue, double factor) { byte componentValue = *blue; *blue = RgbComponentOperations.ChangeBrightness(componentValue, factor); }
private unsafe void ApplyBrightnessToPixelGreen(byte *blue, double factor) { byte componentValue = *(blue + (byte)Argb.green); *(blue + (byte)Argb.green) = RgbComponentOperations.ChangeBrightness(componentValue, factor); }
private unsafe void ApplyBlackAndWhiteToPixel(byte *blue, double factor) { *blue = *(blue + (byte)Argb.green) = *(blue + (byte)Argb.red) = RgbComponentOperations.BlackAndWhite(*blue, *(blue + (byte)Argb.green), *(blue + (byte)Argb.red)); }
private unsafe void ApplyThresholdToPixel(byte *blue, double factor) { *blue = *(blue + (byte)Argb.green) = *(blue + (byte)Argb.red) = RgbComponentOperations.Threshold(*blue, *(blue + (byte)Argb.green), *(blue + (byte)Argb.red), (byte)factor); }