color balance algorithms More...
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <float.h>
#include "balance_lib.h"
#include "colorbalance_lib.h"
Go to the source code of this file.
Defines | |
#define | MAX(A, B) (((A) >= (B)) ? (A) : (B)) |
max of A and B | |
#define | MAX3(A, B, C) (((A) >= (B)) ? MAX(A,C) : MAX(B,C)) |
max of A, B, and C | |
Functions | |
unsigned char * | colorbalance_rgb_u8 (unsigned char *rgb, size_t size, size_t nb_min, size_t nb_max) |
simplest color balance on RGB channels | |
float * | colorbalance_irgb_f32 (float *rgb, size_t size, size_t nb_min, size_t nb_max) |
simplest color balance based on the I axis applied to the RGB channels, bounded |
color balance algorithms
Definition in file colorbalance_lib.c.
#define MAX | ( | A, | ||
B | ||||
) | (((A) >= (B)) ? (A) : (B)) |
max of A and B
Definition at line 56 of file colorbalance_lib.c.
#define MAX3 | ( | A, | ||
B, | ||||
C | ||||
) | (((A) >= (B)) ? MAX(A,C) : MAX(B,C)) |
max of A, B, and C
Definition at line 59 of file colorbalance_lib.c.
float* colorbalance_irgb_f32 | ( | float * | rgb, | |
size_t | size, | |||
size_t | nb_min, | |||
size_t | nb_max | |||
) |
simplest color balance based on the I axis applied to the RGB channels, bounded
The input image is normalized by affine transformation on the I axis, saturating a percentage of the pixels at the beginning and end of the axis. This transformation is linearly applied to the R, G and B channels. The RGB cube is not stable by this operation, so some projections towards (0,0,0) on the RGB cube will be performed if needed.
Definition at line 72 of file colorbalance_lib.c.
unsigned char* colorbalance_rgb_u8 | ( | unsigned char * | rgb, | |
size_t | size, | |||
size_t | nb_min, | |||
size_t | nb_max | |||
) |
simplest color balance on RGB channels
The input image is normalized by affine transformation on each RGB channel, saturating a percentage of the pixels at the beginning and end of the color space on each channel.
Definition at line 46 of file colorbalance_lib.c.