GDAL

cpl_float.h
1 /******************************************************************************
2 * $Id$
3 *
4 * Project: CPL
5 * Purpose: Floating point conversion functions. Convert 16- and 24-bit
6 * floating point numbers into the 32-bit IEEE 754 compliant ones.
7 * Author: Andrey Kiselev, dron@remotesensing.org
8 *
9 ******************************************************************************
10 * Copyright (c) 2005, Andrey Kiselev <dron@remotesensing.org>
11 * Copyright (c) 2010, Even Rouault <even dot rouault at spatialys.com>
12 *
13 * This code is based on the code from OpenEXR project with the following
14 * copyright:
15 *
16 * Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
17 * Digital Ltd. LLC
18 *
19 * All rights reserved.
20 *
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions are
23 * met:
24 * * Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * * Redistributions in binary form must reproduce the above
27 * copyright notice, this list of conditions and the following disclaimer
28 * in the documentation and/or other materials provided with the
29 * distribution.
30 * * Neither the name of Industrial Light & Magic nor the names of
31 * its contributors may be used to endorse or promote products derived
32 * from this software without specific prior written permission.
33 *
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 *
46 ****************************************************************************/
47
48 #ifndef CPL_FLOAT_H_INCLUDED
49 #define CPL_FLOAT_H_INCLUDED
50
51 #include "cpl_port.h"
52
53 CPL_C_START
54 GUInt32 CPL_DLL CPLHalfToFloat( GUInt16 iHalf );
55 GUInt32 CPL_DLL CPLTripleToFloat( GUInt32 iTriple );
56 CPL_C_END
57
58 #ifdef __cplusplus
59 GUInt16 CPL_DLL CPLFloatToHalf( GUInt32 iFloat32, bool& bHasWarned );
60 #endif
61
62 #endif // CPL_FLOAT_H_INCLUDED
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:304
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:306
cpl_port.h
GUInt16
unsigned short GUInt16
Unsigned int16 type.
Definition: cpl_port.h:201
GUInt32
unsigned int GUInt32
Unsigned int32 type.
Definition: cpl_port.h:195