📅  最后修改于: 2022-03-11 14:55:53.358000             🧑  作者: Mango
factor = (259 * (contrast + 255)) / (255 * (259 - contrast))
colour = GetPixelColour(x, y)
newRed = Truncate(factor * (Red(colour) - 128) + 128)
newGreen = Truncate(factor * (Green(colour) - 128) + 128)
newBlue = Truncate(factor * (Blue(colour) - 128) + 128)
PutPixelColour(x, y) = RGB(newRed, newGreen, newBlue)