Classes | Macros | Typedefs | Enumerations | Functions
vil_pixel_format.h File Reference
#include <iosfwd>
#include <complex>
#include <vil/vil_rgb.h>
#include <vil/vil_rgba.h>
#include <vxl_config.h>

Go to the source code of this file.

Classes

struct  vil_pixel_format_type_of< pix_type >
 The C++ type corresponding to a pixel format enumeration. More...
 

Macros

#define vil_pixel_format_macro(T, C, V)
 Get the vil_pixel_format value for a given type. More...
 

Typedefs

typedef void * vil_pixel_format_invalid_type
 The C++ type corresponding to an invalid pixel format. More...
 

Enumerations

enum  vil_pixel_format {
  VIL_PIXEL_FORMAT_UNKNOWN = 0, VIL_PIXEL_FORMAT_UINT_32 = 3, VIL_PIXEL_FORMAT_INT_32 = 4, VIL_PIXEL_FORMAT_UINT_16 = 5,
  VIL_PIXEL_FORMAT_INT_16 = 6, VIL_PIXEL_FORMAT_BYTE = 7, VIL_PIXEL_FORMAT_SBYTE = 8, VIL_PIXEL_FORMAT_FLOAT = 9,
  VIL_PIXEL_FORMAT_DOUBLE = 10, VIL_PIXEL_FORMAT_BOOL = 12, VIL_PIXEL_FORMAT_RGB_UINT_32 = 15, VIL_PIXEL_FORMAT_RGB_INT_32 = 16,
  VIL_PIXEL_FORMAT_RGB_UINT_16 = 17, VIL_PIXEL_FORMAT_RGB_INT_16 = 18, VIL_PIXEL_FORMAT_RGB_BYTE = 19, VIL_PIXEL_FORMAT_RGB_SBYTE = 20,
  VIL_PIXEL_FORMAT_RGB_FLOAT = 21, VIL_PIXEL_FORMAT_RGB_DOUBLE = 22, VIL_PIXEL_FORMAT_RGBA_UINT_32 = 26, VIL_PIXEL_FORMAT_RGBA_INT_32 = 27,
  VIL_PIXEL_FORMAT_RGBA_UINT_16 = 28, VIL_PIXEL_FORMAT_RGBA_INT_16 = 29, VIL_PIXEL_FORMAT_RGBA_BYTE = 30, VIL_PIXEL_FORMAT_RGBA_SBYTE = 31,
  VIL_PIXEL_FORMAT_RGBA_FLOAT = 32, VIL_PIXEL_FORMAT_RGBA_DOUBLE = 33, VIL_PIXEL_FORMAT_COMPLEX_FLOAT = 35, VIL_PIXEL_FORMAT_COMPLEX_DOUBLE = 36,
  VIL_PIXEL_FORMAT_ENUM_END = 37
}
 Describes the type of the concrete data. More...
 

Functions

template<class T >
vil_pixel_format vil_pixel_format_of (T)
 The pixel format enumeration corresponding to the C++ type. More...
 
 vil_pixel_format_macro (vxl_uint_32, vxl_uint_32, VIL_PIXEL_FORMAT_UINT_32)
 
 vil_pixel_format_macro (vxl_int_32, vxl_int_32, VIL_PIXEL_FORMAT_INT_32)
 
 vil_pixel_format_macro (vxl_uint_16, vxl_uint_16, VIL_PIXEL_FORMAT_UINT_16)
 
 vil_pixel_format_macro (vxl_int_16, vxl_int_16, VIL_PIXEL_FORMAT_INT_16)
 
 vil_pixel_format_macro (vxl_byte, vxl_byte, VIL_PIXEL_FORMAT_BYTE)
 
 vil_pixel_format_macro (vxl_sbyte, vxl_sbyte, VIL_PIXEL_FORMAT_SBYTE)
 
 vil_pixel_format_macro (float, float, VIL_PIXEL_FORMAT_FLOAT)
 
 vil_pixel_format_macro (double, double, VIL_PIXEL_FORMAT_DOUBLE)
 
 vil_pixel_format_macro (bool, bool, VIL_PIXEL_FORMAT_BOOL)
 
 vil_pixel_format_macro (vil_rgb< vxl_uint_32 >, vxl_uint_32, VIL_PIXEL_FORMAT_RGB_UINT_32)
 
 vil_pixel_format_macro (vil_rgb< vxl_int_32 >, vxl_int_32, VIL_PIXEL_FORMAT_RGB_INT_32)
 
 vil_pixel_format_macro (vil_rgb< vxl_uint_16 >, vxl_uint_16, VIL_PIXEL_FORMAT_RGB_UINT_16)
 
 vil_pixel_format_macro (vil_rgb< vxl_int_16 >, vxl_int_16, VIL_PIXEL_FORMAT_RGB_INT_16)
 
 vil_pixel_format_macro (vil_rgb< vxl_byte >, vxl_byte, VIL_PIXEL_FORMAT_RGB_BYTE)
 
 vil_pixel_format_macro (vil_rgb< vxl_sbyte >, vxl_sbyte, VIL_PIXEL_FORMAT_RGB_SBYTE)
 
 vil_pixel_format_macro (vil_rgb< float >, float, VIL_PIXEL_FORMAT_RGB_FLOAT)
 
 vil_pixel_format_macro (vil_rgb< double >, double, VIL_PIXEL_FORMAT_RGB_DOUBLE)
 
 vil_pixel_format_macro (vil_rgba< vxl_uint_32 >, vxl_uint_32, VIL_PIXEL_FORMAT_RGBA_UINT_32)
 
 vil_pixel_format_macro (vil_rgba< vxl_int_32 >, vxl_int_32, VIL_PIXEL_FORMAT_RGBA_INT_32)
 
 vil_pixel_format_macro (vil_rgba< vxl_uint_16 >, vxl_uint_16, VIL_PIXEL_FORMAT_RGBA_UINT_16)
 
 vil_pixel_format_macro (vil_rgba< vxl_int_16 >, vxl_int_16, VIL_PIXEL_FORMAT_RGBA_INT_16)
 
 vil_pixel_format_macro (vil_rgba< vxl_byte >, vxl_byte, VIL_PIXEL_FORMAT_RGBA_BYTE)
 
 vil_pixel_format_macro (vil_rgba< vxl_sbyte >, vxl_sbyte, VIL_PIXEL_FORMAT_RGBA_SBYTE)
 
 vil_pixel_format_macro (vil_rgba< float >, float, VIL_PIXEL_FORMAT_RGBA_FLOAT)
 
 vil_pixel_format_macro (vil_rgba< double >, double, VIL_PIXEL_FORMAT_RGBA_DOUBLE)
 
 vil_pixel_format_macro (std::complex< float >, std::complex< float >, VIL_PIXEL_FORMAT_COMPLEX_FLOAT)
 
 vil_pixel_format_macro (std::complex< double >, std::complex< double >, VIL_PIXEL_FORMAT_COMPLEX_DOUBLE)
 
unsigned vil_pixel_format_sizeof_components (enum vil_pixel_format f)
 Return the number of bytes used by each component of pixel format f. More...
 
unsigned vil_pixel_format_num_components (enum vil_pixel_format f)
 Return the number of components in pixel format f. More...
 
vil_pixel_format vil_pixel_format_component_format (enum vil_pixel_format f)
 Return the format of each component of pixel format f. More...
 
std::ostream & operator<< (std::ostream &os, vil_pixel_format f)
 Output a pretty string representing the pixel format. More...
 
vil_pixel_format vil_pixel_format_from_string (const char *s)
 Convert a string into a pixel format. More...
 

Detailed Description

Author
Ian Scott. Note that a std::complex<float> is thought of as a scalar pixel type for vil's purposes.
  Modifications
   23 Oct.2003 - Peter Vanroose - Added support for 64-bit int pixels

Definition in file vil_pixel_format.h.

Macro Definition Documentation

◆ vil_pixel_format_macro

#define vil_pixel_format_macro (   T,
  C,
 
)
Value:
template <> inline vil_pixel_format vil_pixel_format_of(T /*dummy*/) { return V; }\
template <> struct vil_pixel_format_type_of<V> { typedef T type; typedef C component_type; }
vil_pixel_format
Describes the type of the concrete data.
vil_pixel_format_invalid_type type
The C++ type corresponding to a pixel format enumeration.
vil_pixel_format_invalid_type component_type
vil_pixel_format vil_pixel_format_of(T)
The pixel format enumeration corresponding to the C++ type.

Get the vil_pixel_format value for a given type.

Definition at line 116 of file vil_pixel_format.h.

Typedef Documentation

◆ vil_pixel_format_invalid_type

The C++ type corresponding to an invalid pixel format.

See vil_pixel_format_type_of.

Definition at line 94 of file vil_pixel_format.h.

Enumeration Type Documentation

◆ vil_pixel_format

Describes the type of the concrete data.

Enumerator
VIL_PIXEL_FORMAT_UNKNOWN 
VIL_PIXEL_FORMAT_UINT_32 
VIL_PIXEL_FORMAT_INT_32 
VIL_PIXEL_FORMAT_UINT_16 
VIL_PIXEL_FORMAT_INT_16 
VIL_PIXEL_FORMAT_BYTE 
VIL_PIXEL_FORMAT_SBYTE 
VIL_PIXEL_FORMAT_FLOAT 
VIL_PIXEL_FORMAT_DOUBLE 
VIL_PIXEL_FORMAT_BOOL 
VIL_PIXEL_FORMAT_RGB_UINT_32 
VIL_PIXEL_FORMAT_RGB_INT_32 
VIL_PIXEL_FORMAT_RGB_UINT_16 
VIL_PIXEL_FORMAT_RGB_INT_16 
VIL_PIXEL_FORMAT_RGB_BYTE 
VIL_PIXEL_FORMAT_RGB_SBYTE 
VIL_PIXEL_FORMAT_RGB_FLOAT 
VIL_PIXEL_FORMAT_RGB_DOUBLE 
VIL_PIXEL_FORMAT_RGBA_UINT_32 
VIL_PIXEL_FORMAT_RGBA_INT_32 
VIL_PIXEL_FORMAT_RGBA_UINT_16 
VIL_PIXEL_FORMAT_RGBA_INT_16 
VIL_PIXEL_FORMAT_RGBA_BYTE 
VIL_PIXEL_FORMAT_RGBA_SBYTE 
VIL_PIXEL_FORMAT_RGBA_FLOAT 
VIL_PIXEL_FORMAT_RGBA_DOUBLE 
VIL_PIXEL_FORMAT_COMPLEX_FLOAT 

std::complex<float> is a scalar for vil's purposes.

VIL_PIXEL_FORMAT_COMPLEX_DOUBLE 

std::complex<double> is a scalar for vil's purposes.

VIL_PIXEL_FORMAT_ENUM_END 

Definition at line 25 of file vil_pixel_format.h.

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
vil_pixel_format  f 
)

Output a pretty string representing the pixel format.

Output a pretty string representing the pixel format.

Definition at line 225 of file vil_pixel_format.cxx.

◆ vil_pixel_format_component_format()

vil_pixel_format vil_pixel_format_component_format ( enum vil_pixel_format  f)

Return the format of each component of pixel format f.

Return the format of each component of pixel format f.

Definition at line 217 of file vil_pixel_format.cxx.

◆ vil_pixel_format_from_string()

vil_pixel_format vil_pixel_format_from_string ( const char *  s)

Convert a string into a pixel format.

This uses the same encoding as operator<<.

Definition at line 282 of file vil_pixel_format.cxx.

◆ vil_pixel_format_macro() [1/27]

vil_pixel_format_macro ( vxl_uint_32  ,
vxl_uint_32  ,
VIL_PIXEL_FORMAT_UINT_32   
)

◆ vil_pixel_format_macro() [2/27]

vil_pixel_format_macro ( vxl_int_32  ,
vxl_int_32  ,
VIL_PIXEL_FORMAT_INT_32   
)

◆ vil_pixel_format_macro() [3/27]

vil_pixel_format_macro ( vxl_uint_16  ,
vxl_uint_16  ,
VIL_PIXEL_FORMAT_UINT_16   
)

◆ vil_pixel_format_macro() [4/27]

vil_pixel_format_macro ( vxl_int_16  ,
vxl_int_16  ,
VIL_PIXEL_FORMAT_INT_16   
)

◆ vil_pixel_format_macro() [5/27]

vil_pixel_format_macro ( vxl_byte  ,
vxl_byte  ,
VIL_PIXEL_FORMAT_BYTE   
)

◆ vil_pixel_format_macro() [6/27]

vil_pixel_format_macro ( vxl_sbyte  ,
vxl_sbyte  ,
VIL_PIXEL_FORMAT_SBYTE   
)

◆ vil_pixel_format_macro() [7/27]

vil_pixel_format_macro ( float  ,
float  ,
VIL_PIXEL_FORMAT_FLOAT   
)

◆ vil_pixel_format_macro() [8/27]

vil_pixel_format_macro ( double  ,
double  ,
VIL_PIXEL_FORMAT_DOUBLE   
)

◆ vil_pixel_format_macro() [9/27]

vil_pixel_format_macro ( bool  ,
bool  ,
VIL_PIXEL_FORMAT_BOOL   
)

◆ vil_pixel_format_macro() [10/27]

vil_pixel_format_macro ( vil_rgb< vxl_uint_32 >  ,
vxl_uint_32  ,
VIL_PIXEL_FORMAT_RGB_UINT_32   
)

◆ vil_pixel_format_macro() [11/27]

vil_pixel_format_macro ( vil_rgb< vxl_int_32 >  ,
vxl_int_32  ,
VIL_PIXEL_FORMAT_RGB_INT_32   
)

◆ vil_pixel_format_macro() [12/27]

vil_pixel_format_macro ( vil_rgb< vxl_uint_16 >  ,
vxl_uint_16  ,
VIL_PIXEL_FORMAT_RGB_UINT_16   
)

◆ vil_pixel_format_macro() [13/27]

vil_pixel_format_macro ( vil_rgb< vxl_int_16 >  ,
vxl_int_16  ,
VIL_PIXEL_FORMAT_RGB_INT_16   
)

◆ vil_pixel_format_macro() [14/27]

vil_pixel_format_macro ( vil_rgb< vxl_byte >  ,
vxl_byte  ,
VIL_PIXEL_FORMAT_RGB_BYTE   
)

◆ vil_pixel_format_macro() [15/27]

vil_pixel_format_macro ( vil_rgb< vxl_sbyte >  ,
vxl_sbyte  ,
VIL_PIXEL_FORMAT_RGB_SBYTE   
)

◆ vil_pixel_format_macro() [16/27]

vil_pixel_format_macro ( vil_rgb< float >  ,
float  ,
VIL_PIXEL_FORMAT_RGB_FLOAT   
)

◆ vil_pixel_format_macro() [17/27]

vil_pixel_format_macro ( vil_rgb< double >  ,
double  ,
VIL_PIXEL_FORMAT_RGB_DOUBLE   
)

◆ vil_pixel_format_macro() [18/27]

vil_pixel_format_macro ( vil_rgba< vxl_uint_32 >  ,
vxl_uint_32  ,
VIL_PIXEL_FORMAT_RGBA_UINT_32   
)

◆ vil_pixel_format_macro() [19/27]

vil_pixel_format_macro ( vil_rgba< vxl_int_32 >  ,
vxl_int_32  ,
VIL_PIXEL_FORMAT_RGBA_INT_32   
)

◆ vil_pixel_format_macro() [20/27]

vil_pixel_format_macro ( vil_rgba< vxl_uint_16 >  ,
vxl_uint_16  ,
VIL_PIXEL_FORMAT_RGBA_UINT_16   
)

◆ vil_pixel_format_macro() [21/27]

vil_pixel_format_macro ( vil_rgba< vxl_int_16 >  ,
vxl_int_16  ,
VIL_PIXEL_FORMAT_RGBA_INT_16   
)

◆ vil_pixel_format_macro() [22/27]

vil_pixel_format_macro ( vil_rgba< vxl_byte >  ,
vxl_byte  ,
VIL_PIXEL_FORMAT_RGBA_BYTE   
)

◆ vil_pixel_format_macro() [23/27]

vil_pixel_format_macro ( vil_rgba< vxl_sbyte >  ,
vxl_sbyte  ,
VIL_PIXEL_FORMAT_RGBA_SBYTE   
)

◆ vil_pixel_format_macro() [24/27]

vil_pixel_format_macro ( vil_rgba< float >  ,
float  ,
VIL_PIXEL_FORMAT_RGBA_FLOAT   
)

◆ vil_pixel_format_macro() [25/27]

vil_pixel_format_macro ( vil_rgba< double >  ,
double  ,
VIL_PIXEL_FORMAT_RGBA_DOUBLE   
)

◆ vil_pixel_format_macro() [26/27]

vil_pixel_format_macro ( std::complex< float >  ,
std::complex< float >  ,
VIL_PIXEL_FORMAT_COMPLEX_FLOAT   
)

◆ vil_pixel_format_macro() [27/27]

vil_pixel_format_macro ( std::complex< double >  ,
std::complex< double >  ,
VIL_PIXEL_FORMAT_COMPLEX_DOUBLE   
)

◆ vil_pixel_format_num_components()

unsigned vil_pixel_format_num_components ( enum vil_pixel_format  f)

Return the number of components in pixel format f.

Definition at line 209 of file vil_pixel_format.cxx.

◆ vil_pixel_format_of()

template<class T >
vil_pixel_format vil_pixel_format_of ( )
inline

The pixel format enumeration corresponding to the C++ type.

Definition at line 87 of file vil_pixel_format.h.

◆ vil_pixel_format_sizeof_components()

unsigned vil_pixel_format_sizeof_components ( enum vil_pixel_format  f)

Return the number of bytes used by each component of pixel format f.

Definition at line 202 of file vil_pixel_format.cxx.