blob: 3fd07793e9bfb59398dbac6651c7267e18dd6b2d [file] [log] [blame]
jvanverth93679922014-11-26 13:15:59 -08001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkHalf_DEFINED
9#define SkHalf_DEFINED
10
11#include "SkTypes.h"
12
13// 16-bit floating point value
14// format is 1 bit sign, 5 bits exponent, 10 bits mantissa
15// only used for storage
16typedef uint16_t SkHalf;
17
18// convert between half and single precision floating point
19float SkHalfToFloat(SkHalf h);
20SkHalf SkFloatToHalf(float f);
21
22#endif