| 46 | } |
| 47 | |
| 48 | FadeToColorImageOperation::FadeToColorImageOperation(Vec3B color, float amount) { |
| 49 | this->color = color; |
| 50 | this->amount = amount; |
| 51 | |
| 52 | auto fcl = Color::rgb(color).toLinear(); |
| 53 | for (int i = 0; i <= 255; ++i) { |
| 54 | auto r = Color::rgb(Vec3B(i, i, i)).toLinear().mix(fcl, amount).toSRGB().toRgb(); |
| 55 | rTable[i] = r[0]; |
| 56 | gTable[i] = r[1]; |
| 57 | bTable[i] = r[2]; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | ImageOperation imageOperationFromString(StringView string) { |
| 62 | try { |