PortAudio  2.0
pa_converters.h
Go to the documentation of this file.
1 #ifndef PA_CONVERTERS_H
2 #define PA_CONVERTERS_H
3 /*
4  * $Id: pa_converters.h 1097 2006-08-26 08:27:53Z rossb $
5  * Portable Audio I/O Library sample conversion mechanism
6  *
7  * Based on the Open Source API proposed by Ross Bencina
8  * Copyright (c) 1999-2002 Phil Burk, Ross Bencina
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining
11  * a copy of this software and associated documentation files
12  * (the "Software"), to deal in the Software without restriction,
13  * including without limitation the rights to use, copy, modify, merge,
14  * publish, distribute, sublicense, and/or sell copies of the Software,
15  * and to permit persons to whom the Software is furnished to do so,
16  * subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be
19  * included in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
25  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
26  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28  */
29 
30 /*
31  * The text above constitutes the entire PortAudio license; however,
32  * the PortAudio community also makes the following non-binding requests:
33  *
34  * Any person wishing to distribute modifications to the Software is
35  * requested to send the modifications to the original developer so that
36  * they can be incorporated into the canonical version. It is also
37  * requested that these non-binding requests be included along with the
38  * license above.
39  */
40 
49 #include "portaudio.h" /* for PaSampleFormat */
50 
51 #ifdef __cplusplus
52 extern "C"
53 {
54 #endif /* __cplusplus */
55 
56 
58 
59 
70  PaSampleFormat availableFormats, PaSampleFormat format );
71 
72 
73 /* high level conversions functions for use by implementations */
74 
75 
90 typedef void PaUtilConverter(
91  void *destinationBuffer, signed int destinationStride,
92  void *sourceBuffer, signed int sourceStride,
93  unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator );
94 
95 
108  PaSampleFormat destinationFormat, PaStreamFlags flags );
109 
110 
119 typedef void PaUtilZeroer(
120  void *destinationBuffer, signed int destinationStride, unsigned int count );
121 
122 
128 PaUtilZeroer* PaUtil_SelectZeroer( PaSampleFormat destinationFormat );
129 
130 /*----------------------------------------------------------------------------*/
131 /* low level functions and data structures which may be used for
132  substituting conversion functions */
133 
134 
138 typedef struct{
143 
148 
153 
158 
163 
173 
182 
190 
196 
202 
203  PaUtilConverter *Copy_8_To_8; /* copy without any conversion */
204  PaUtilConverter *Copy_16_To_16; /* copy without any conversion */
205  PaUtilConverter *Copy_24_To_24; /* copy without any conversion */
206  PaUtilConverter *Copy_32_To_32; /* copy without any conversion */
208 
209 
228 
229 
233 typedef struct{
234  PaUtilZeroer *ZeroU8; /* unsigned 8 bit, zero == 128 */
240 
241 
259 
260 #ifdef __cplusplus
261 }
262 #endif /* __cplusplus */
263 #endif /* PA_CONVERTERS_H */