Skip to content

Commit

Permalink
COMP: Adding C wrapping stuff to make it compile
Browse files Browse the repository at this point in the history
  • Loading branch information
jmichel-otb committed Jul 7, 2016
1 parent c32128a commit 03ca1aa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
22 changes: 13 additions & 9 deletions gdal/frmts/derived/derivedlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,22 @@
#include "derivedlist.h"
#include "gdal.h"

CPL_C_START

static const DerivedDatasetDescription asDDSDesc [] =
{
{ "AMPLITUDE", "Amplitude of input bands", "mod"},
{ "PHASE", "Phase of input bands", "phase"},
{ "REAL", "Real part of input bands", "real"},
{ "IMAG", "Imaginary part of input bands", "imag"},
{ "CONJ", "Conjugate of input bands", "conj"},
{ "INTENSITY", "Intensity (squared amplitude) of input bands", "intensity"},
{ "LOGAMPLITUDE", "log10 of amplitude of input bands", "log10"}
{ "AMPLITUDE", "Amplitude of input bands", "mod", "complex"},
{ "PHASE", "Phase of input bands", "phase", "complex"},
{ "REAL", "Real part of input bands", "real", "complex"},
{ "IMAG", "Imaginary part of input bands", "imag", "complex"},
{ "CONJ", "Conjugate of input bands", "conj", "complex"},
{ "INTENSITY", "Intensity (squared amplitude) of input bands", "intensity", "complex"},
{ "LOGAMPLITUDE", "log10 of amplitude of input bands", "log10", "all"}
};

#define NB_DERIVED_DATASETS (sizeof(asDDSDesc)/sizeof(asDDSDesc[0]))

const DerivedDatasetDescription* GDALGetDerivedDatasetDescription(const unsigned int * pnDescriptionCount)
const DerivedDatasetDescription* CPL_DLL CPL_STDCALL GDALGetDerivedDatasetDescription(const unsigned int * pnDescriptionCount)
{
if(*pnDescriptionCount < (int)NB_DERIVED_DATASETS)
{
Expand All @@ -50,7 +52,9 @@ const DerivedDatasetDescription* GDALGetDerivedDatasetDescription(const unsigned
return NULL;
}

unsigned int GDALGetNumberOfDerivedDatasetDecriptions(void)
unsigned int CPL_DLL CPL_STDCALL GDALGetNumberOfDerivedDatasetDecriptions(void)
{
return (unsigned int)NB_DERIVED_DATASETS;
}

CPL_C_END
11 changes: 9 additions & 2 deletions gdal/frmts/derived/derivedlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,22 @@
#ifndef DERIVEDLIST_H_INCLUDED
#define DERIVEDLIST_H_INCLUDED

#include "cpl_port.h"

CPL_C_START

typedef struct
{
const char * pszDatasetName;
const char * pszDatasetDescritpion;
const char * pszPixelFunction;
const char * pszTargetPixelType;
} DerivedDatasetDescription;

const DerivedDatasetDescription* GDALGetDerivedDatasetDescription(const unsigned int * pnDescriptionCount);
const DerivedDatasetDescription* CPL_DLL CPL_STDCALL GDALGetDerivedDatasetDescription(const unsigned int * pnDescriptionCount);

unsigned int CPL_DLL CPL_STDCALL GDALGetNumberOfDerivedDatasetDecriptions(void);

unsigned int GDALGetNumberOfDerivedDatasetDecriptions(void);
CPL_C_END

#endif

0 comments on commit 03ca1aa

Please sign in to comment.