RgbConversion.C File Reference

#include "Video/RgbConversion.H"
#include "Image/JPEGUtil.H"
#include "Image/Dims.H"
#include "Image/Image.H"
#include "Image/Pixels.H"
#include "Image/color_conversions.H"
#include "Util/log.H"
#include "rutz/error_context.h"
#include "rutz/trace.h"
#include "inst/Video/RgbConversion.I"
Include dependency graph for RgbConversion.C:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T >
Image< PixRGB< T > > fromRGB (const T *data, const size_t length, const Dims &dims, const bool byteswap)
 Build an RGB image from an RGB C array, with optional byte-swapping.
template<class T >
Image< PixRGB< T > > fromARGB (const T *data, const size_t length, const Dims &dims, const bool byteswap)
 Build an RGB image from a alpha+RGB C array, with optional byte-swapping.
Image< PixRGB< byte > > fromRGB555 (const byte *data, const size_t length, const Dims &dims, const bool byteswap)
 Build an RGB image from an RGB555 C array, with optional byte-swapping.
Image< PixRGB< byte > > fromRGB565 (const byte *data, const size_t length, const Dims &dims, const bool byteswap)
 Build an RGB image from an RGB565 C array, with optional byte-swapping.
template<class T >
Image< PixRGB< T > > fromVideoYUV24 (const T *data, const size_t length, const Dims &dims, const bool byteswap)
 Build an RGB image from a YUV24 C array, with optional byte-swapping.
template<class T >
Image< PixRGB< T > > fromVideoYUV444 (const T *data, const size_t length, const Dims &dims, const bool byteswap)
 Build an RGB image from a YUV444 C array, with optional byte-swapping.
template<>
Image< PixRGB< byte > > fromVideoYUV422 (const byte *data, const size_t length, const Dims &dims, const bool byteswap)
template<class T >
Image< PixRGB< T > > fromVideoYUV422 (const T *data, const size_t length, const Dims &dims, const bool byteswap)
 Build an RGB image from a YUV422 C array, with optional byte-swapping.
template<class T >
Image< PixRGB< T > > fromVideoYUV411 (const T *data, const size_t length, const Dims &dims, const bool byteswap)
 Build an RGB image from a YUV411 C array, with optional byte-swapping.
template<class T >
Image< PixRGB< T > > fromVideoYUV444P (const T *data, const size_t length, const Dims &dims)
 Build an RGB image from a YUV422-planar C array.
template<>
Image< PixRGB< byte > > fromVideoYUV422P (const byte *data, const size_t length, const Dims &dims)
template<class T >
Image< PixRGB< T > > fromVideoYUV422P (const T *data, const size_t length, const Dims &dims)
 Build an RGB image from a YUV422-planar C array.
template<class T >
Image< PixRGB< T > > fromVideoYUV411P (const T *data, const size_t length, const Dims &dims)
 Build an RGB image from a YUV411-planar C array.
template<>
Image< PixRGB< byte > > fromVideoYUV420P (const byte *data, const size_t length, const Dims &dims)
template<class T >
Image< PixRGB< T > > fromVideoYUV420P (const T *data, const size_t length, const Dims &dims)
 Build an RGB image from a YUV420-planar C array.
template<>
Image< PixRGB< byte > > fromVideoHM12 (const byte *data, const size_t length, const Dims &dims)
template<class T >
Image< PixRGB< T > > fromVideoHM12 (const T *data, const size_t length, const Dims &dims)
 Build an RGB image from a HM12-planar C array.
template<class T >
Image< PixRGB< T > > fromVideoMJPEG (const T *data, const size_t length, const Dims &dims)
 Build an RGB image from a motion compressed jpeg.
template<class T >
Image< PixRGB< T > > fromVideoYUV410P (const T *data, const size_t length, const Dims &dims)
 Build an RGB image from a YUV410-planar C array.
template<class T >
Image< PixRGB< T > > fromMono (const T *data, const size_t length, const Dims &dims)
 Build an RGB image from a grayscale C array of size dims.w()*dims.h().
Image< PixRGB< byte > > fromBayer (const byte *data, const size_t length, const Dims &dims, BayerFormat ft)
 Build an RGB image from a bayer C array.
Image< PixRGB< uint16 > > fromBayerU16 (const uint16 *data, const size_t length, const Dims &dims, BayerFormat ft)
void toVideoYUV422 (const Image< PixRGB< byte > > img, byte *y, byte *u, byte *v, const int ystride, const int ustride, const int vstride)
 Fill pre-allocated YUV422 C arrays with values from an image.

Detailed Description

Raw conversion between video formats and RGB images

Definition in file RgbConversion.C.


Function Documentation

template<class T >
Image<PixRGB<T> > fromARGB ( const T *  data,
const size_t  length,
const Dims dims,
const bool  byteswap 
) [inline]

Build an RGB image from a alpha+RGB C array, with optional byte-swapping.

Definition at line 106 of file RgbConversion.C.

References GVX_ERR_CONTEXT, NO_INIT, and Dims::sz().

Referenced by VideoFrame::toRgb().

Image<PixRGB<byte> > fromBayer ( const byte data,
const size_t  length,
const Dims dims,
BayerFormat  ft 
)

Build an RGB image from a bayer C array.

Definition at line 848 of file RgbConversion.C.

References GVX_ERR_CONTEXT, NO_INIT, and Dims::sz().

Referenced by VideoFrame::toRgb().

template<class T >
Image<PixRGB<T> > fromMono ( const T *  data,
const size_t  length,
const Dims dims 
) [inline]

Build an RGB image from a grayscale C array of size dims.w()*dims.h().

Definition at line 825 of file RgbConversion.C.

References Image< T >::beginw(), GVX_ERR_CONTEXT, NO_INIT, and Dims::sz().

Referenced by VideoFrame::toRgb().

template<class T >
Image<PixRGB<T> > fromRGB ( const T *  data,
const size_t  length,
const Dims dims,
const bool  byteswap 
) [inline]

Build an RGB image from an RGB C array, with optional byte-swapping.

If byte-swapping is off, this will just perform a deep copy of the data; this function is somewhat redundant with the Image constructor and is provided for completeness with respect to the fromXXX methods only. Note that data should have 3*dims.w()*dims.h() elements, and it is the responsibility of the caller to free that data later.

Definition at line 70 of file RgbConversion.C.

References GVX_ERR_CONTEXT, NO_INIT, and Dims::sz().

Referenced by VideoFrame::toRgb().

Image<PixRGB<byte> > fromRGB555 ( const byte data,
const size_t  length,
const Dims dims,
const bool  byteswap 
)

Build an RGB image from an RGB555 C array, with optional byte-swapping.

Definition at line 142 of file RgbConversion.C.

References GVX_ERR_CONTEXT, NO_INIT, and Dims::sz().

Referenced by VideoFrame::toRgb().

Image<PixRGB<byte> > fromRGB565 ( const byte data,
const size_t  length,
const Dims dims,
const bool  byteswap 
)

Build an RGB image from an RGB565 C array, with optional byte-swapping.

Definition at line 186 of file RgbConversion.C.

References GVX_ERR_CONTEXT, NO_INIT, and Dims::sz().

Referenced by VideoFrame::toRgb().

template<class T >
Image<PixRGB<T> > fromVideoHM12 ( const T *  data,
const size_t  length,
const Dims dims 
) [inline]

Build an RGB image from a HM12-planar C array.

Definition at line 707 of file RgbConversion.C.

References Image< T >::beginw(), GVX_ERR_CONTEXT, Dims::h(), NO_INIT, Dims::sz(), and Dims::w().

template<class T >
Image<PixRGB<T> > fromVideoMJPEG ( const T *  data,
const size_t  length,
const Dims dims 
) [inline]

Build an RGB image from a motion compressed jpeg.

Definition at line 749 of file RgbConversion.C.

References NO_INIT.

Referenced by VideoFrame::toRgb().

template<class T >
Image<PixRGB<T> > fromVideoYUV24 ( const T *  data,
const size_t  length,
const Dims dims,
const bool  byteswap 
) [inline]

Build an RGB image from a YUV24 C array, with optional byte-swapping.

Definition at line 231 of file RgbConversion.C.

References GVX_ERR_CONTEXT, NO_INIT, and Dims::sz().

Referenced by VideoFrame::toRgb().

template<class T >
Image<PixRGB<T> > fromVideoYUV410P ( const T *  data,
const size_t  length,
const Dims dims 
) [inline]

Build an RGB image from a YUV410-planar C array.

Definition at line 772 of file RgbConversion.C.

References Image< T >::beginw(), GVX_ERR_CONTEXT, Dims::h(), NO_INIT, Dims::sz(), and Dims::w().

Referenced by VideoFrame::toRgb().

template<class T >
Image<PixRGB<T> > fromVideoYUV411 ( const T *  data,
const size_t  length,
const Dims dims,
const bool  byteswap 
) [inline]

Build an RGB image from a YUV411 C array, with optional byte-swapping.

Definition at line 367 of file RgbConversion.C.

References GVX_ERR_CONTEXT, NO_INIT, and Dims::sz().

Referenced by VideoFrame::toRgb().

template<class T >
Image<PixRGB<T> > fromVideoYUV411P ( const T *  data,
const size_t  length,
const Dims dims 
) [inline]

Build an RGB image from a YUV411-planar C array.

Definition at line 517 of file RgbConversion.C.

References Image< T >::beginw(), GVX_ERR_CONTEXT, Dims::h(), NO_INIT, Dims::sz(), and Dims::w().

Referenced by VideoFrame::toRgb().

template<class T >
Image<PixRGB<T> > fromVideoYUV420P ( const T *  data,
const size_t  length,
const Dims dims 
) [inline]

Build an RGB image from a YUV420-planar C array.

Definition at line 592 of file RgbConversion.C.

References GVX_ERR_CONTEXT, Dims::h(), NO_INIT, Dims::sz(), and Dims::w().

template<class T >
Image<PixRGB<T> > fromVideoYUV422 ( const T *  data,
const size_t  length,
const Dims dims,
const bool  byteswap 
) [inline]

Build an RGB image from a YUV422 C array, with optional byte-swapping.

Definition at line 328 of file RgbConversion.C.

References GVX_ERR_CONTEXT, NO_INIT, and Dims::sz().

template<class T >
Image<PixRGB<T> > fromVideoYUV422P ( const T *  data,
const size_t  length,
const Dims dims 
) [inline]

Build an RGB image from a YUV422-planar C array.

Definition at line 464 of file RgbConversion.C.

References Image< T >::beginw(), clampValue(), GVX_ERR_CONTEXT, Dims::h(), NO_INIT, Dims::sz(), and Dims::w().

template<class T >
Image<PixRGB<T> > fromVideoYUV444 ( const T *  data,
const size_t  length,
const Dims dims,
const bool  byteswap 
) [inline]

Build an RGB image from a YUV444 C array, with optional byte-swapping.

Definition at line 270 of file RgbConversion.C.

References GVX_ERR_CONTEXT, NO_INIT, and Dims::sz().

Referenced by VideoFrame::toRgb().

template<class T >
Image<PixRGB<T> > fromVideoYUV444P ( const T *  data,
const size_t  length,
const Dims dims 
) [inline]

Build an RGB image from a YUV422-planar C array.

Definition at line 410 of file RgbConversion.C.

References GVX_ERR_CONTEXT, Dims::h(), NO_INIT, Dims::sz(), and Dims::w().

Referenced by VideoFrame::toRgb().

void toVideoYUV422 ( const Image< PixRGB< byte > >  img,
byte y,
byte u,
byte v,
const int  ystride,
const int  ustride,
const int  vstride 
)

Fill pre-allocated YUV422 C arrays with values from an image.

Definition at line 882 of file RgbConversion.C.

Referenced by SDLdisplay::displayVideoOverlay_patch().

Generated on Sun May 8 08:42:53 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3