bn::color_effect namespace

Color effects related functions.

Functions

void brightness(fixed brightness, span<color> colors_ref)
Increases the brightness of all referenced colors.
void brightness(const span<const color>& source_colors_ref, fixed brightness, span<color> destination_colors_ref)
Increases the brightness of all colors referenced by source_colors_ref, storing the result in destination_colors_ref.
void contrast(fixed contrast, span<color> colors_ref)
Increases the contrast of all referenced colors.
void contrast(const span<const color>& source_colors_ref, fixed contrast, span<color> destination_colors_ref)
Increases the contrast of all colors referenced by source_colors_ref, storing the result in destination_colors_ref.
void intensity(fixed intensity, span<color> colors_ref)
Increases the intensity of all referenced colors.
void intensity(const span<const color>& source_colors_ref, fixed intensity, span<color> destination_colors_ref)
Increases the intensity of all colors referenced by source_colors_ref, storing the result in destination_colors_ref.
void invert(span<color> colors_ref)
Inverts all referenced colors.
void invert(const span<const color>& source_colors_ref, span<color> destination_colors_ref)
Inverts all colors referenced by source_colors_ref, storing the result in destination_colors_ref.
void grayscale(fixed intensity, span<color> colors_ref)
Applies a grayscale effect to all referenced colors.
void grayscale(const span<const color>& source_colors_ref, fixed intensity, span<color> destination_colors_ref)
Applies a grayscale effect to all colors referenced by source_colors_ref, storing the result in destination_colors_ref.
void hue_shift(fixed intensity, span<color> colors_ref)
Applies a hue shift effect to all referenced colors.
void hue_shift(const span<const color>& source_colors_ref, fixed intensity, span<color> destination_colors_ref)
Applies a hue shift effect to all colors referenced by source_colors_ref, storing the result in destination_colors_ref.
void blend(const span<const color>& first_source_colors_ref, const span<const color>& second_source_colors_ref, fixed weight, span<color> destination_colors_ref)
Blends two color arrays referenced by first_source_colors_ref and second_source_colors_ref, storing the result in destination_colors_ref.
void fade(color fade_color, fixed intensity, span<color> colors_ref)
Applies a fade effect to all referenced colors.
void fade(const span<const color>& source_colors_ref, color fade_color, fixed intensity, span<color> destination_colors_ref)
Applies a fade effect to all colors referenced by source_colors_ref, storing the result in destination_colors_ref.
void rotate(int rotate_count, span<color> colors_ref)
Rotates all referenced colors to the right.
void rotate(const span<const color>& source_colors_ref, int rotate_count, span<color> destination_colors_ref)
Rotates all colors referenced by source_colors_ref to the right, storing the result in destination_colors_ref.

Function documentation

void bn::color_effect::brightness(fixed brightness, span<color> colors_ref)

Increases the brightness of all referenced colors.

Parameters
brightness Brightness amount in the range [0..1].
colors_ref Colors reference.

void bn::color_effect::brightness(const span<const color>& source_colors_ref, fixed brightness, span<color> destination_colors_ref)

Increases the brightness of all colors referenced by source_colors_ref, storing the result in destination_colors_ref.

Parameters
source_colors_ref Source colors reference.
brightness Brightness amount in the range [0..1].
destination_colors_ref Destination colors reference.

void bn::color_effect::contrast(fixed contrast, span<color> colors_ref)

Increases the contrast of all referenced colors.

Parameters
contrast Contrast amount in the range [0..1].
colors_ref Colors reference.

void bn::color_effect::contrast(const span<const color>& source_colors_ref, fixed contrast, span<color> destination_colors_ref)

Increases the contrast of all colors referenced by source_colors_ref, storing the result in destination_colors_ref.

Parameters
source_colors_ref Source colors reference.
contrast Contrast amount in the range [0..1].
destination_colors_ref Destination colors reference.

void bn::color_effect::intensity(fixed intensity, span<color> colors_ref)

Increases the intensity of all referenced colors.

Parameters
intensity Intensity amount in the range [0..1].
colors_ref Colors reference.

void bn::color_effect::intensity(const span<const color>& source_colors_ref, fixed intensity, span<color> destination_colors_ref)

Increases the intensity of all colors referenced by source_colors_ref, storing the result in destination_colors_ref.

Parameters
source_colors_ref Source colors reference.
intensity Intensity amount in the range [0..1].
destination_colors_ref Destination colors reference.

void bn::color_effect::invert(span<color> colors_ref)

Inverts all referenced colors.

Parameters
colors_ref Colors reference.

void bn::color_effect::invert(const span<const color>& source_colors_ref, span<color> destination_colors_ref)

Inverts all colors referenced by source_colors_ref, storing the result in destination_colors_ref.

Parameters
source_colors_ref Source colors reference.
destination_colors_ref Destination colors reference.

void bn::color_effect::grayscale(fixed intensity, span<color> colors_ref)

Applies a grayscale effect to all referenced colors.

Parameters
intensity Grayscale effect intensity in the range [0..1].
colors_ref Colors reference. It must be 4-byte aligned and have an even number of colors.

void bn::color_effect::grayscale(const span<const color>& source_colors_ref, fixed intensity, span<color> destination_colors_ref)

Applies a grayscale effect to all colors referenced by source_colors_ref, storing the result in destination_colors_ref.

Parameters
source_colors_ref Source colors reference. It must be 4-byte aligned and have an even number of colors.
intensity Grayscale effect intensity in the range [0..1].
destination_colors_ref Destination colors reference. It must be 4-byte aligned and have an even number of colors.

void bn::color_effect::hue_shift(fixed intensity, span<color> colors_ref)

Applies a hue shift effect to all referenced colors.

Parameters
intensity Hue shift effect intensity in the range [0..1].
colors_ref Colors reference.

void bn::color_effect::hue_shift(const span<const color>& source_colors_ref, fixed intensity, span<color> destination_colors_ref)

Applies a hue shift effect to all colors referenced by source_colors_ref, storing the result in destination_colors_ref.

Parameters
source_colors_ref Source colors reference.
intensity Hue shift effect intensity in the range [0..1].
destination_colors_ref Destination colors reference.

void bn::color_effect::blend(const span<const color>& first_source_colors_ref, const span<const color>& second_source_colors_ref, fixed weight, span<color> destination_colors_ref)

Blends two color arrays referenced by first_source_colors_ref and second_source_colors_ref, storing the result in destination_colors_ref.

Parameters
first_source_colors_ref First source colors reference. It must be 4-byte aligned and have an even number of colors.
second_source_colors_ref Second source colors reference. It must be 4-byte aligned and have an even number of colors.
weight Blend weight in the range [0..1].
destination_colors_ref Destination colors reference. It must be 4-byte aligned and have an even number of colors.

void bn::color_effect::fade(color fade_color, fixed intensity, span<color> colors_ref)

Applies a fade effect to all referenced colors.

Parameters
fade_color Fade effect color.
intensity Fade effect intensity in the range [0..1].
colors_ref Colors reference. It must be 4-byte aligned and have an even number of colors.

void bn::color_effect::fade(const span<const color>& source_colors_ref, color fade_color, fixed intensity, span<color> destination_colors_ref)

Applies a fade effect to all colors referenced by source_colors_ref, storing the result in destination_colors_ref.

Parameters
source_colors_ref Source colors reference. It must be 4-byte aligned and have an even number of colors.
fade_color Fade effect color.
intensity Fade effect intensity in the range [0..1].
destination_colors_ref Destination colors reference. It must be 4-byte aligned and have an even number of colors.

void bn::color_effect::rotate(int rotate_count, span<color> colors_ref)

Rotates all referenced colors to the right.

Parameters
rotate_count Number of colors to rotate to the right in the range [1 - colors_count .. colors_count - 1].
colors_ref Colors reference.

void bn::color_effect::rotate(const span<const color>& source_colors_ref, int rotate_count, span<color> destination_colors_ref)

Rotates all colors referenced by source_colors_ref to the right, storing the result in destination_colors_ref.

Parameters
source_colors_ref Source colors reference.
rotate_count Number of colors to rotate to the right in the range [1 - colors_count .. colors_count - 1].
destination_colors_ref Destination colors reference.

If the source and destination tiles, colors or map cells overlap, the behavior is undefined.