libimage  0.25.4
 All Classes Namespaces Files Functions Variables Enumerations Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TiffNodataManager< T > Class Template Reference

#include <TiffNodataManager.h>

Collaboration diagram for TiffNodataManager< T >:
Collaboration graph

Public Member Functions

 TiffNodataManager (uint16 channels, int *targetValue, bool touchEdges, int *dataValue, int *nodataValue, int tolerance=0)
 Create a TiffNodataManager object from three characteristic colors.
virtual ~TiffNodataManager ()
 Default destructor.
bool treatNodata (char *inputImage, char *outputImage, char *outputMask=0)
 Manager treatment function, doing image's modifications.

Private Member Functions

bool identifyNodataPixels (T *IM, uint8_t *MSK)
 Identify nodata pixels.
bool isTargetValue (T *pix)
 Determine target value pixel.
void changeNodataValue (T *IM, uint8_t *MSK)
 Switch color of nodata pixels.
void changeDataValue (T *IM, uint8_t *MSK)
 Switch color of data pixels.

Private Attributes

uint32_t width
 Width of the treated image.
uint32_t height
 Height of the treated image.
uint16_t samplesperpixel
 Number of samples of the treated image.
uint16_t maxChannels
 Number of samples in manager colors.
T * targetValue
 Color impacted by modifications.
int tolerance
 Target value comparison tolerance.
bool touchEdges
 Nodata pixels detection method.
T * dataValue
 New color for data.
T * nodataValue
 New color for nodata.
bool removeTargetValue
 Have we to modify data pixel wich contain the target value targetValue.
bool newNodataValue
 Have we to switch the nodata pixels' color ?

Detailed Description

template<typename T>
class TiffNodataManager< T >

Author
Institut national de l'information géographique et forestière
manageNodata.png

Constructor & Destructor Documentation

template<typename T >
TiffNodataManager< T >::TiffNodataManager ( uint16  channels,
int *  targetValue,
bool  touchEdges,
int *  dataValue,
int *  nodataValue,
int  tolerance = 0 
)

Create a TiffNodataManager object from three characteristic colors.

Booleans removeTargetValue and newNodataValue are deduced from colors.

Parameters
[in]channelscolors' number of samples
[in]targetValuecolor to treat
[in]touchEdgesNodata pixels detection method
[in]dataValuenew color for data
[in]nodataValuenew color for nodata

Member Function Documentation

template<typename T >
void TiffNodataManager< T >::changeDataValue ( T *  IM,
uint8_t *  MSK 
)
private

Switch color of data pixels.

Parameters
[in,out]IMimage to modify
[in]MSKmask to use
template<typename T >
void TiffNodataManager< T >::changeNodataValue ( T *  IM,
uint8_t *  MSK 
)
private

Switch color of nodata pixels.

Parameters
[in,out]IMimage to modify
[in]MSKmask to use
template<typename T >
bool TiffNodataManager< T >::identifyNodataPixels ( T *  IM,
uint8_t *  MSK 
)
private

Identify nodata pixels.

Parameters
[in]IMimage to analyze
[out]MSKmask to fill
Returns
TRUE if the image sontains 1 nodata pixel or more, FALSE otherwise
template<typename T >
bool TiffNodataManager< T >::isTargetValue ( T *  pix)
inlineprivate

Determine target value pixel.

Parameters
[in]pixpixel to test
template<typename T >
bool TiffNodataManager< T >::treatNodata ( char *  inputImage,
char *  outputImage,
char *  outputMask = 0 
)

Manager treatment function, doing image's modifications.

Use booleans removeTargetValue and newNodataValue to define what to do.

Parameters
[in]inputImage's path to modify
[in]outputOutput image path
[in]outputOutput mask path
Returns
True if success, false otherwise

Here is the call graph for this function:

Member Data Documentation

template<typename T >
T* TiffNodataManager< T >::dataValue
private

New color for data.

Could be the same as targetValue.

template<typename T >
bool TiffNodataManager< T >::newNodataValue
private

Have we to switch the nodata pixels' color ?

nodataValue will be put.

template<typename T >
T* TiffNodataManager< T >::nodataValue
private

New color for nodata.

Could be the same as targetValue.

template<typename T >
bool TiffNodataManager< T >::touchEdges
private

Nodata pixels detection method.

Do we spread from image's edges to identify nodata pixels ?


The documentation for this class was generated from the following file: