llquantize.h File Reference

useful routines for quantizing floats to various length ints and back out again More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

U16 F32_to_U16_ROUND (F32 val, F32 lower, F32 upper)
U16 F32_to_U16 (F32 val, F32 lower, F32 upper)
F32 U16_to_F32 (U16 ival, F32 lower, F32 upper)
U8 F32_to_U8_ROUND (F32 val, F32 lower, F32 upper)
U8 F32_to_U8 (F32 val, F32 lower, F32 upper)
F32 U8_to_F32 (U8 ival, F32 lower, F32 upper)
U8 F32_TO_STRING (F32 val, F32 lower, F32 upper)
F32 STRING_TO_F32 (U8 ival, F32 lower, F32 upper)

Variables

const U16 U16MAX = 65535
const F32 OOU16MAX = 1.f/(F32)(U16MAX)
const U8 U8MAX = 255
const F32 OOU8MAX = 1.f/(F32)(U8MAX)
const U8 FIRSTVALIDCHAR = 54
const U8 MAXSTRINGVAL = U8MAX - FIRSTVALIDCHAR


Detailed Description

useful routines for quantizing floats to various length ints and back out again

LicenseInfo
firstyear=2001&license=viewergpl

Copyright (c) 2001-2007, Linden Research, Inc.

Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlife.com/developers/opensource/gplv2

There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlife.com/developers/opensource/flossexception

By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.

ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$

Definition in file llquantize.h.


Function Documentation

U8 F32_TO_STRING ( F32  val,
F32  lower,
F32  upper 
) [inline]

Definition at line 125 of file llquantize.h.

References f, and llclamp().

U16 F32_to_U16 ( F32  val,
F32  lower,
F32  upper 
) [inline]

Definition at line 58 of file llquantize.h.

References llclamp(), llfloor(), and U16MAX.

Referenced by LLVector3::quantize16(), LLKeyframeMotion::serialize(), and LLBVHLoader::serialize().

U16 F32_to_U16_ROUND ( F32  val,
F32  lower,
F32  upper 
) [inline]

Definition at line 46 of file llquantize.h.

References llclamp(), llround(), and U16MAX.

Referenced by LLQuaternion::quantize16().

U8 F32_to_U8 ( F32  val,
F32  lower,
F32  upper 
) [inline]

Definition at line 98 of file llquantize.h.

References llclamp(), and llfloor().

Referenced by LLWearable::isDirty(), LLVector3::quantize8(), LLViewerWindow::rawSnapshot(), LLAgent::sendAgentSetAppearance(), LLTexParamColor::setWeight(), and LLTexLayerParamAlpha::setWeight().

U8 F32_to_U8_ROUND ( F32  val,
F32  lower,
F32  upper 
) [inline]

Definition at line 86 of file llquantize.h.

References llclamp(), and llround().

Referenced by LLQuaternion::quantize8().

F32 STRING_TO_F32 ( U8  ival,
F32  lower,
F32  upper 
) [inline]

Definition at line 138 of file llquantize.h.

References f.

F32 U16_to_F32 ( U16  ival,
F32  lower,
F32  upper 
) [inline]

Definition at line 69 of file llquantize.h.

References OOU16MAX.

Referenced by LLKeyframeMotion::deserialize(), LLViewerObject::processUpdateMessage(), LLVector3::quantize16(), and LLQuaternion::quantize16().

F32 U8_to_F32 ( U8  ival,
F32  lower,
F32  upper 
) [inline]

Definition at line 109 of file llquantize.h.

Referenced by LLVOAvatar::processAvatarAppearance(), LLViewerObject::processUpdateMessage(), LLVector3::quantize8(), and LLQuaternion::quantize8().


Variable Documentation

const U8 FIRSTVALIDCHAR = 54

Definition at line 42 of file llquantize.h.

const U8 MAXSTRINGVAL = U8MAX - FIRSTVALIDCHAR

Definition at line 43 of file llquantize.h.

const F32 OOU16MAX = 1.f/(F32)(U16MAX)

Definition at line 37 of file llquantize.h.

Referenced by U16_to_F32().

const F32 OOU8MAX = 1.f/(F32)(U8MAX)

Definition at line 40 of file llquantize.h.

const U16 U16MAX = 65535

Definition at line 36 of file llquantize.h.

Referenced by F32_to_U16(), and F32_to_U16_ROUND().

const U8 U8MAX = 255

Definition at line 39 of file llquantize.h.


Generated on Thu Jul 1 06:10:38 2010 for Second Life Viewer by  doxygen 1.4.7