MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / processSaturationShift

Function processSaturationShift

source/core/StarImageProcessing.cpp:361–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359#pragma GCC optimize("-fno-fast-math", "-fassociative-math", "-freciprocal-math")
360#endif
361static void processSaturationShift(Image& image, SaturationShiftImageOperation const* op) {
362 image.forEachPixel([&op](unsigned, unsigned, Vec4B& pixel) {
363 if (pixel[3] != 0) {
364 Color color = Color::rgba(pixel);
365 color.setSaturation(clamp(color.saturation() + op->saturationShiftAmount, 0.0f, 1.0f));
366 pixel = color.toRgba();
367 }
368 });
369}
370#ifdef STAR_COMPILER_CLANG
371#pragma GCC pop_options
372#endif

Callers 1

processImageOperationFunction · 0.85

Calls 5

clampFunction · 0.85
forEachPixelMethod · 0.80
setSaturationMethod · 0.80
saturationMethod · 0.80
toRgbaMethod · 0.80

Tested by

no test coverage detected