Loading...
Searching...
No Matches
Converters.h File Reference
`#include <SoapySDR/Config.h>`
`#include <SoapySDR/Errors.h>`
`#include <SoapySDR/Types.h>`
`#include <SoapySDR/Constants.h>`

Go to the source code of this file.

## Typedefs

typedef void(* | SoapySDRConverterFunction) (const void *, void *, const size_t, const double)

## Enumerations

enum | SoapySDRConverterFunctionPriority { SOAPY_SDR_CONVERTER_GENERIC = 0 , SOAPY_SDR_CONVERTER_VECTORIZED = 3 , SOAPY_SDR_CONVERTER_CUSTOM = 5 }

## Functions

SOAPY_SDR_API char ** | SoapySDRConverter_listTargetFormats (const char *sourceFormat, size_t *length)
SOAPY_SDR_API char ** | SoapySDRConverter_listSourceFormats (const char *targetFormat, size_t *length)
SOAPY_SDR_API SoapySDRConverterFunctionPriority * | SoapySDRConverter_listPriorities (const char *sourceFormat, const char *targetFormat, size_t *length)
SOAPY_SDR_API SoapySDRConverterFunction | SoapySDRConverter_getFunction (const char *sourceFormat, const char *targetFormat)
SOAPY_SDR_API SoapySDRConverterFunction | SoapySDRConverter_getFunctionWithPriority (const char *sourceFormat, const char *targetFormat, const SoapySDRConverterFunctionPriority priority)
SOAPY_SDR_API char ** | SoapySDRConverter_listAvailableSourceFormats (size_t *length)

## Detailed Description

Convert buffers between stream formats.

Copyright
  Copyright (c) 2020 Nicholas Corgan SPDX-License-Identifier: BSL-1.0

## Typedef Documentation

## SoapySDRConverterFunction

typedef void(* SoapySDRConverterFunction) (const void *, void *, const size_t, const double)

A typedef for declaring a ConverterFunction to be maintained in the ConverterRegistry. A converter function copies and optionally converts an input buffer of one format into an output buffer of another format. The parameters are (input pointer, output pointer, number of elements, optional scalar)

## Enumeration Type Documentation

## SoapySDRConverterFunctionPriority

enum SoapySDRConverterFunctionPriority

Allow selection of a converter function with a given source and target format.

Enumerator
SOAPY_SDR_CONVERTER_GENERIC | Usual C for-loops, shifts, multiplies, etc. Min priority.
SOAPY_SDR_CONVERTER_VECTORIZED | Vectorized configurations such as SIMD.
SOAPY_SDR_CONVERTER_CUSTOM | Custom user re-implementation. Max priority.

## Function Documentation

## SoapySDRConverter_getFunction()

SOAPY_SDR_API SoapySDRConverterFunction SoapySDRConverter_getFunction | ( | const char * | sourceFormat,
|  | const char * | targetFormat )

Get a converter between a source and target format with the highest available priority.

Parameters

  sourceFormat | the source format markup string
  targetFormat | the target format markup string

Returns
  a conversion function pointer or nullptr if none are found

## SoapySDRConverter_getFunctionWithPriority()

SOAPY_SDR_API SoapySDRConverterFunction SoapySDRConverter_getFunctionWithPriority | ( | const char * | sourceFormat,
|  | const char * | targetFormat,
|  | const SoapySDRConverterFunctionPriority | priority )

Get a converter between a source and target format with a given priority.

Parameters

  sourceFormat | the source format markup string
  targetFormat | the target format markup string

Returns
  a conversion function pointer or nullptr if none are found

## SoapySDRConverter_listAvailableSourceFormats()

SOAPY_SDR_API char ** SoapySDRConverter_listAvailableSourceFormats | ( | size_t * | length | ) |

Get a list of known source formats in the registry.

Parameters

  [out] | length | the number of known source formats

Returns
  a list of known source formats

## SoapySDRConverter_listPriorities()

SOAPY_SDR_API SoapySDRConverterFunctionPriority * SoapySDRConverter_listPriorities | ( | const char * | sourceFormat,
|  | const char * | targetFormat,
|  | size_t * | length )

Get a list of available converter priorities for a given source and target format.

Parameters

  | sourceFormat | the source format markup string
  | targetFormat | the target format markup string
  [out] | length | the number of priorities

Returns
  a list of priorities or nullptr if none are found

## SoapySDRConverter_listSourceFormats()

SOAPY_SDR_API char ** SoapySDRConverter_listSourceFormats | ( | const char * | targetFormat,
|  | size_t * | length )

Get a list of existing source formats to which we can convert the specified target from.

Parameters

  | targetFormat | the target format markup string
  [out] | length | the number of valid source formats

Returns
  a list of valid source formats

## SoapySDRConverter_listTargetFormats()

SOAPY_SDR_API char ** SoapySDRConverter_listTargetFormats | ( | const char * | sourceFormat,
|  | size_t * | length )

Get a list of existing target formats to which we can convert the specified source from.

Parameters

  | sourceFormat | the source format markup string
  [out] | length | the number of valid target formats

Returns
  a list of valid target formats