Server : Apache System : Linux dedi-14684855.grupobig.com 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : grupo692 ( 1004) PHP Version : 8.2.31 Disable Function : NONE Directory : /usr/include/OpenEXR/ |
// // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMF_CONVERT_H #define INCLUDED_IMF_CONVERT_H //----------------------------------------------------------------------------- // // Routines for converting between pixel data types, // with well-defined behavior for exceptional cases, // without depending on how hardware and operating // system handle integer overflows and floating-point // exceptions. // //----------------------------------------------------------------------------- #include "ImfExport.h" #include "ImfNamespace.h" #include <half.h> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //--------------------------------------------------------- // Conversion from half or float to unsigned int: // // input result // --------------------------------------------------- // // finite, >= 0 input, cast to unsigned int // (rounds towards zero) // // finite, < 0 0 // // NaN 0 // // +infinity UINT_MAX // // -infinity 0 // //--------------------------------------------------------- IMF_EXPORT unsigned int halfToUint (half h); IMF_EXPORT unsigned int floatToUint (float f); //--------------------------------------------------------- // Conversion from unsigned int or float to half: // // input result // --------------------------------------------------- // // finite, closest possible half // magnitude <= HALF_MAX // // finite, > HALF_MAX +infinity // // finite, < -HALF_MAX -infinity // // NaN NaN // // +infinity +infinity // // -infinity -infinity // //--------------------------------------------------------- IMF_EXPORT half uintToHalf (unsigned int ui); IMF_EXPORT half floatToHalf (float f); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif