Defines | Functions
core/vil/algo/vil_colour_space.cxx File Reference
#include "vil_colour_space.h"
#include <vcl_cstdlib.h>
#include <vcl_algorithm.h>
#include <vcl_cmath.h>

Go to the source code of this file.

Defines

#define inst(T)

Functions

template<class T >
void vil_colour_space_RGB_to_YIQ (T const in[3], T out[3])
 Linear transformation from RGB to YIQ colour spaces.
template<class T >
void vil_colour_space_YIQ_to_RGB (T const in[3], T out[3])
 Linear transformation from YIQ to RGB colour spaces.
template<class T >
void vil_colour_space_RGB_to_HSV (T r, T g, T b, T *h, T *s, T *v)
 Transform from RGB to HSV colour spaces.
template<class T >
void vil_colour_space_HSV_to_RGB (T h, T s, T v, T *r, T *g, T *b)
 Transform from HSV to RGB colour space.
template<class T >
void vil_colour_space_RGB_to_YUV (T const in[3], T out[3])
 Linear transformation from RGB to YUV colour spaces.
template<class T >
void vil_colour_space_YUV_to_RGB (T const in[3], T out[3])
 Linear transformation from YUV to RGB colour spaces.
template<class T >
void vil_colour_space_RGB_to_YPbPr_601 (T const RGB[3], T YPbPr[3])
 Transformation from analog RGB to analog YPbPr colour spaces.
template<class T >
void vil_colour_space_YPbPr_601_to_RGB (T const YPbPr[3], T RGB[3])
 Transformation from analog YPbPr to RGB colour spaces.
void vil_colour_space_RGB_to_YCbCr_601 (const unsigned char RGB[3], unsigned char YCbCr[3])
 Transformation from 8 bit RGB to 8 bit YCbCr colour spaces.
void vil_colour_space_YCbCr_601_to_RGB (const unsigned char YCbCr[3], unsigned char RGB[3])
 Transformation from 8 bit YCbCr to 8 bit RGB colour spaces.
 inst (double)
 inst (float)

Detailed Description

Author:
fsm

Definition in file vil_colour_space.cxx.


Define Documentation

#define inst (   T)
Value:
template void vil_colour_space_RGB_to_YIQ(T const [3], T [3]); \
template void vil_colour_space_YIQ_to_RGB(T const [3], T [3]); \
template void vil_colour_space_RGB_to_HSV(T, T, T, T *, T *, T *); \
template void vil_colour_space_HSV_to_RGB(T, T, T, T *, T *, T *); \
template void vil_colour_space_RGB_to_YUV(T const [3], T [3]); \
template void vil_colour_space_YUV_to_RGB(T const [3], T [3]); \
template void vil_colour_space_RGB_to_YPbPr_601(T const RGB[3], T YPbPr[3]); \
template void vil_colour_space_YPbPr_601_to_RGB(T const YPbPr[3], T RGB[3])

Definition at line 240 of file vil_colour_space.cxx.


Function Documentation

inst ( double  )
inst ( float  )
template<class T >
void vil_colour_space_HSV_to_RGB ( h,
s,
v,
T *  r,
T *  g,
T *  b 
)

Transform from HSV to RGB colour space.

The input HSV values will lie in the ranges: H : [0, 360) (an angle, in bloody degrees) S : [0, 1] V : [0, 255]

The output RGB values will lie in [0, 255]

[HSV is also known as HSB]

Definition at line 76 of file vil_colour_space.cxx.

template<class T >
void vil_colour_space_RGB_to_HSV ( r,
g,
b,
T *  h,
T *  s,
T *  v 
)

Transform from RGB to HSV colour spaces.

       green --- yellow     //
      /    \     /     \    //
   cyan --- white ---- red  //
      \    /     \     /    //
       blue  --- magenta    //
                            //
   

Definition at line 41 of file vil_colour_space.cxx.

void vil_colour_space_RGB_to_YCbCr_601 ( const unsigned char  RGB[3],
unsigned char  YCbCr[3] 
)

Transformation from 8 bit RGB to 8 bit YCbCr colour spaces.

The input and out value lie in the ranges:

  • R'd, G'd, B'd in {0, 1, 2, ..., 255}
  • Y' in {16, 17, ..., 235} with * footroom in {1, 2, ..., 15} * headroom in {236, 237, ..., 254} * sync. in {0, 255}
  • Cb, Cr in {16, 17, ..., 240}

Definition at line 211 of file vil_colour_space.cxx.

template<class T >
void vil_colour_space_RGB_to_YIQ ( T const  in[3],
out[3] 
)

Linear transformation from RGB to YIQ colour spaces.

Definition at line 15 of file vil_colour_space.cxx.

template<class T >
void vil_colour_space_RGB_to_YPbPr_601 ( T const  RGB[3],
YPbPr[3] 
)

Transformation from analog RGB to analog YPbPr colour spaces.

The input and out value lie in the ranges:

  • R', G', B' in [0; 1]
  • Y' in [0; 1]
  • Pb in [-0.5; 0.5]
  • Pr in [-0.5; 0.5]

Definition at line 174 of file vil_colour_space.cxx.

template<class T >
void vil_colour_space_RGB_to_YUV ( T const  in[3],
out[3] 
)

Linear transformation from RGB to YUV colour spaces.

Definition at line 144 of file vil_colour_space.cxx.

void vil_colour_space_YCbCr_601_to_RGB ( const unsigned char  YCbCr[3],
unsigned char  RGB[3] 
)

Transformation from 8 bit YCbCr to 8 bit RGB colour spaces.

The input and out value lie in the ranges:

  • Y' in {16, 17, ..., 235} with * footroom in {1, 2, ..., 15} * headroom in {236, 237, ..., 254} * sync. in {0, 255}
  • Cb, Cr in {16, 17, ..., 240}
  • R'd, G'd, B'd in {0, 1, 2, ..., 255}

Definition at line 227 of file vil_colour_space.cxx.

template<class T >
void vil_colour_space_YIQ_to_RGB ( T const  in[3],
out[3] 
)

Linear transformation from YIQ to RGB colour spaces.

Definition at line 23 of file vil_colour_space.cxx.

template<class T >
void vil_colour_space_YPbPr_601_to_RGB ( T const  YPbPr[3],
RGB[3] 
)

Transformation from analog YPbPr to RGB colour spaces.

The input and out value lie in the ranges:

  • Y' in [0; 1]
  • Pb in [-0.5; 0.5]
  • Pr in [-0.5; 0.5]
  • R', G', B' in [0; 1]

Definition at line 192 of file vil_colour_space.cxx.

template<class T >
void vil_colour_space_YUV_to_RGB ( T const  in[3],
out[3] 
)

Linear transformation from YUV to RGB colour spaces.

Definition at line 153 of file vil_colour_space.cxx.