/** * This adds a pixel function to the global list of available pixel * functions for derived bands. * * This is the same as the c function GDALAddDerivedBandPixelFunc() * * @param pszFuncName Name used to access pixel function * @param pfnNewFunction Pixel function associated with name. An * existing pixel function registered with the same name will be * replaced with the new one. * * @return CE_None, invalid (NULL) parameters are currently ignored. */ CPLErr VRTDerivedRasterBand::AddPixelFunction (const char *pszFuncName, GDALDerivedPixelFunc pfnNewFunction) { return GDALAddDerivedBandPixelFunc(pszFuncName, pfnNewFunction); }
/** * This adds a default set of pixel functions to the global list of * available pixel functions for derived bands: * * - "real": extract real part from a single raster band (just a copy if the * input is non-complex) * - "imag": extract imaginary part from a single raster band (0 for * non-complex) * - "complex": make a complex band merging two bands used as real and * imag values * - "mod": extract module from a single raster band (real or complex) * - "phase": extract phase from a single raster band (0 for non-complex) * - "conj": computes the complex conjugate of a single raster band (just a * copy if the input is non-complex) * - "sum": sum 2 or more raster bands * - "diff": computes the difference between 2 raster bands (b1 - b2) * - "mul": multilpy 2 or more raster bands * - "cmul": multiply the first band for the complex conjugate of the second * - "inv": inverse (1./x). Note: no check is performed on zero division * - "intensity": computes the intensity Re(x*conj(x)) of a single raster band * (real or complex) * - "sqrt": perform the square root of a single raster band (real only) * - "log10": compute the logarithm (base 10) of the abs of a single raster * band (real or complex): log10( abs( x ) ) * - "dB2amp": perform scale conversion from logarithmic to linear * (amplitude) (i.e. 10 ^ ( x / 20 ) ) of a single raster * band (real only) * - "dB2pow": perform scale conversion from logarithmic to linear * (power) (i.e. 10 ^ ( x / 10 ) ) of a single raster * band (real only) * * @see GDALAddDerivedBandPixelFunc * * @return CE_None, invalid (NULL) parameters are currently ignored. */ CPLErr CPL_STDCALL GDALRegisterDefaultPixelFunc() { GDALAddDerivedBandPixelFunc("real", RealPixelFunc); GDALAddDerivedBandPixelFunc("imag", ImagPixelFunc); GDALAddDerivedBandPixelFunc("complex", ComplexPixelFunc); GDALAddDerivedBandPixelFunc("mod", ModulePixelFunc); GDALAddDerivedBandPixelFunc("phase", PhasePixelFunc); GDALAddDerivedBandPixelFunc("conj", ConjPixelFunc); GDALAddDerivedBandPixelFunc("sum", SumPixelFunc); GDALAddDerivedBandPixelFunc("diff", DiffPixelFunc); GDALAddDerivedBandPixelFunc("mul", MulPixelFunc); GDALAddDerivedBandPixelFunc("cmul", CMulPixelFunc); GDALAddDerivedBandPixelFunc("inv", InvPixelFunc); GDALAddDerivedBandPixelFunc("intensity", IntensityPixelFunc); GDALAddDerivedBandPixelFunc("sqrt", SqrtPixelFunc); GDALAddDerivedBandPixelFunc("log10", Log10PixelFunc); GDALAddDerivedBandPixelFunc("dB2amp", dB2AmpPixelFunc); GDALAddDerivedBandPixelFunc("dB2pow", dB2PowPixelFunc); return CE_None; }