Gin
Loading...
Searching...
No Matches
ImageFilter Class Reference

A chain of image filters (as CSS filter), applied in order with Gin's applyX functions, parsed from a spec string of names, each followed by its value where it takes one. More...

#include <gin_animated.h>

Public Member Functions

 ImageFilter ()=default
void apply (juce::Image &img) const
 Applies the chain to the image in place.
bool isEmpty () const
bool operator== (const ImageFilter &other) const

Static Public Member Functions

static std::optional< ImageFilter > fromSpec (const juce::String &spec)

Detailed Description

A chain of image filters (as CSS filter), applied in order with Gin's applyX functions, parsed from a spec string of names, each followed by its value where it takes one.

It applies only to images drawn through the image helpers (AnimatedImageFilter, drawBlend), not to arbitrary components:

Name Value Function
brightness -100..100, 0 = none applyBrightnessContrast (img, v, 0)
contrast -100..100, 0 = none applyBrightnessContrast (img, 0, v)
hue -180..180 degrees applyHueSaturationLightness (img, v, 100, 0)
saturation 0..200, 100 = none applyHueSaturationLightness (img, 0, v, 0)
lightness -100..100, 0 = none applyHueSaturationLightness (img, 0, 100, v)
gamma above 0, 1 = none applyGamma
sharpen (none) applySharpen
soften (none) applySoften
greyscale (none) applyGreyScale
sepia (none) applySepia
invert (none) applyInvert

e.g. "contrast 30 saturation 130" or "greyscale brightness -20".

See also
AnimatedImageFilter

Constructor & Destructor Documentation

◆ ImageFilter()

ImageFilter::ImageFilter ( )
default

Referenced by operator==().

Member Function Documentation

◆ fromSpec()

std::optional< ImageFilter > ImageFilter::fromSpec ( const juce::String & spec)
static
Returns
std::nullopt for an unknown name or a missing or malformed value

◆ apply()

void ImageFilter::apply ( juce::Image & img) const

Applies the chain to the image in place.

◆ isEmpty()

bool ImageFilter::isEmpty ( ) const

◆ operator==()

bool ImageFilter::operator== ( const ImageFilter & other) const

References ImageFilter().


The documentation for this class was generated from the following file: