Public Sub AdjustColors1(Bmp As B4XBitmap, HueOffset As Int, SaturationFactor As Float, BrightnessFactor As Float) As B4XBitmap
Dim bc As BitmapCreator = CreateBC(Bmp)
Dim hsv As HSVColor
Dim argb As ARGBColor
For y = 0 To bc.mHeight - 1
For x = 0 To bc.mWidth - 1
bc.GetARGB(x, y, argb)
'*****Include
argb.r = Min(255, argb.r * BrightnessFactor)
argb.g = Min(255, argb.g * BrightnessFactor)
argb.b = Min(255, argb.b * BrightnessFactor)
'bc.SetARGB(x, y, argb)
'****
ARGBToHSV(argb, hsv)
hsv.S = hsv.S * SaturationFactor
hsv.H = (hsv.H + HueOffset) Mod 360
bc.SetHSV(x, y, hsv.A, hsv.H, hsv.S, hsv.V)
Next
Next
Return bc.Bitmap
'Return bc.Bitmap
End Sub