template<typename InputPixelType, typename OutputPixelType, typename OutputConvertTraits>
class itk::ConvertPixelBuffer< InputPixelType, OutputPixelType, OutputConvertTraits >
Class to convert blocks of data from one type to another.
ConvertPixelBuffer has a static method Convert(). It is used by itkImageFileReader to convert from an unknown type at run-time to the compile-time template pixel type in itkImageFileReader. To work with complex pixel types like RGB and RGBA a traits class is used. OutputConvertTraits() is the traits class. The default one used is DefaultConvertPixelTraits.
- ITK Sphinx Examples:
-
Derived from ConvertPixelBuffer has a static method Convert(). It is used to work with pixel type as Array type.
Derived from ConvertPixelBuffer has a static method Convert(). It is used to work with pixel type as VariableLengthVector type.
- Examples
- SphinxExamples/src/IO/ImageBase/ConvertImageToAnotherType/Code.cxx.
Definition at line 46 of file itkConvertPixelBuffer.h.
|
static void | ConvertComplexToComplex (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertGrayToComplex (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertGrayToGray (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertGrayToRGB (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertGrayToRGBA (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertMultiComponentToComplex (const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertMultiComponentToGray (const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertMultiComponentToRGB (const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertMultiComponentToRGBA (const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertRGBAToGray (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertRGBAToRGB (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertRGBAToRGBA (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertRGBToGray (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertRGBToRGB (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertRGBToRGBA (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertTensor6ToTensor6 (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertTensor9ToTensor6 (const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size) |
|
static void | ConvertVectorToVector (const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size) |
|
template<typename UComponentType > |
static std::enable_if_t<!std::is_integral_v< UComponentType >, UComponentType > | DefaultAlphaValue () |
|
template<typename UComponentType > |
static std::enable_if_t< std::is_integral_v< UComponentType >, UComponentType > | DefaultAlphaValue () |
|
template<typename InputPixelType , typename OutputPixelType , typename OutputConvertTraits >
static void itk::ConvertPixelBuffer< InputPixelType, OutputPixelType, OutputConvertTraits >::ConvertMultiComponentToRGB |
( |
const InputPixelType * |
inputData, |
|
|
int |
inputNumberOfComponents, |
|
|
OutputPixelType * |
outputData, |
|
|
vcl_size_t |
size |
|
) |
| |
|
staticprotected |
Conversion depends upon the number of components in the input. If the number of input components is 2, the output components are each set to the first input component attenuated by the second input component. This assumes that a two input pixel represents intensity and alpha. If the number of input components is not 2, the first three output components a are set to the first three input components. The remaining input components are ignored.
template<typename InputPixelType , typename OutputPixelType , typename OutputConvertTraits >
template<typename UComponentType >
static std::enable_if_t<!std::is_integral_v<UComponentType>, UComponentType> itk::ConvertPixelBuffer< InputPixelType, OutputPixelType, OutputConvertTraits >::DefaultAlphaValue |
( |
| ) |
|
|
staticprotected |
the most common case, where InputComponentType == unsigned char, the alpha is in the range 0..255. I presume in the mythical world of rgba<X> for all integral scalar types X, alpha will be in the range 0..X::max(). In the even more fantastical world of rgb<float> or rgb<double> alpha would have to be 1.0