Defines | Functions

colorbalance_lib.c File Reference

color balance algorithms More...

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <float.h>
#include "balance_lib.h"
#include "colorbalance_lib.h"
Include dependency graph for colorbalance_lib.c:

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

Detailed Description

color balance algorithms

Author:
Nicolas Limare <nicolas.limare@cmla.ens-cachan.fr>
Jose-Luis Lisani <joseluis.lisani@uib.es>
Catalina Sbert <catalina.sbert@uib.es>
Todo:
check precision loss, maybe use double precision values

Definition in file colorbalance_lib.c.


Define Documentation

#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.


Function Documentation

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.

Todo:
compute I=R+G+B instead of (R+G+B)/3 to save a division

Definition at line 72 of file colorbalance_lib.c.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Files Functions Variables Defines