Opened 6 years ago

Last modified 5 years ago

## #3367 new enhancement

# Default set of pixel functions

Reported by: | antonio | Owned by: | warmerdam |
---|---|---|---|

Priority: | normal | Milestone: | |

Component: | default | Version: | svn-trunk |

Severity: | normal | Keywords: | |

Cc: |

### Description

I think that it would be nice to have a base set of PixelFunctions (mod, phase, real, imag, sum, diff, etc.) bundled with the GDAL library in order to allow the user to cook its own virtual datasets and then use standard GDAL tools for further processing.

The attached path provides bot pixelfunctins and a registration function that is called inside `GDALAllRegister`.
The patch also provides a base test set.

The list of implemented functions:

* - "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) * - "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 comjugate 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)

### Attachments (2)

### Change History (5)

### Changed 6 years ago by antonio

### Changed 5 years ago by antonio

### comment:1 Changed 5 years ago by antonio

Attached code to register pixel functions using fake plugin.

See http://lists.osgeo.org/pipermail/gdal-dev/2011-May/028737.html

### comment:2 follow-up: ↓ 3 Changed 5 years ago by rouault

Note : it is possible to define a Python pixel function and register it through the use of the ctypes module. See http://trac.osgeo.org/gdal/changeset/22896

### comment:3 in reply to: ↑ 2 Changed 5 years ago by antonio

Replying to rouault:

Note : it is possible to define a Python pixel function and register it through the use of the ctypes module. See http://trac.osgeo.org/gdal/changeset/22896

Hi Even, thank you very much for the pointer. It is very interesting indeed!

**Note:**See TracTickets for help on using tickets.

Pixel function plugin