Skip to content

Instantly share code, notes, and snippets.

@scott-wilson
Last active November 12, 2020 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scott-wilson/a16e6a13f2823d51a67ed4582913fba6 to your computer and use it in GitHub Desktop.
Save scott-wilson/a16e6a13f2823d51a67ed4582913fba6 to your computer and use it in GitHub Desktop.
#include <Imath/half.h>
namespace cppmm_bind
{
namespace IMATH_NAMESPACE
{
class __attribute__((annotate("cppmm:opaquebytes"))) half {
half() __attribute__((annotate("cppmm:rename:create_default")));
half(float f) __attribute__((annotate("cppmm:rename:create_from_float")));
~half() __attribute__((annotate("cppmm:rename:delete")));
half(const ::IMATH_NAMESPACE::half& other) __attribute__((annotate("cppmm:rename:copy")));
half(const ::IMATH_NAMESPACE::half&& other) __attribute__((annotate("cppmm:ignore")));
operator float() const __attribute__((annotate("cppmm:rename:to_float")));
::IMATH_NAMESPACE::half operator-() __attribute__((annotate("cppmm:rename:unary_minus")));
::IMATH_NAMESPACE::half& operator= (const ::IMATH_NAMESPACE::half& h) __attribute__((annotate("cppmm:rename:assign")));
::IMATH_NAMESPACE::half& operator= (::IMATH_NAMESPACE::half&& h) noexcept __attribute__((annotate("cppmm:ignore")));
::IMATH_NAMESPACE::half& operator= (float f) __attribute__((annotate("cppmm:ignore")));
::IMATH_NAMESPACE::half& operator+= (::IMATH_NAMESPACE::half h) __attribute__((annotate("cppmm:rename:add_in_place_from_half")));
::IMATH_NAMESPACE::half& operator+= (float f) __attribute__((annotate("cppmm:rename:add_in_place_from_float")));
::IMATH_NAMESPACE::half& operator-= (::IMATH_NAMESPACE::half h) __attribute__((annotate("cppmm:rename:subtract_in_place_from_half")));
::IMATH_NAMESPACE::half& operator-= (float f) __attribute__((annotate("cppmm:rename:subtract_in_place_from_float")));
::IMATH_NAMESPACE::half& operator*= (::IMATH_NAMESPACE::half h) __attribute__((annotate("cppmm:rename:multiply_in_place_from_half")));
::IMATH_NAMESPACE::half& operator*= (float f) __attribute__((annotate("cppmm:rename:multiply_in_place_from_float")));
::IMATH_NAMESPACE::half& operator/= (::IMATH_NAMESPACE::half h) __attribute__((annotate("cppmm:rename:divide_in_place_from_half")));
::IMATH_NAMESPACE::half& operator/= (float f) __attribute__((annotate("cppmm:rename:divide_in_place_from_float")));
::IMATH_NAMESPACE::half round (unsigned int n) const __attribute__((annotate("cppmm:rename:round")));
bool isFinite() const __attribute__((annotate("cppmm:rename:isFinite")));
bool isNormalized() const __attribute__((annotate("cppmm:rename:isNormalized")));
bool isDenormalized() const __attribute__((annotate("cppmm:rename:isDenormalized")));
bool isZero() const __attribute__((annotate("cppmm:rename:isZero")));
bool isNan() const __attribute__((annotate("cppmm:rename:isNan")));
bool isInfinity() const __attribute__((annotate("cppmm:rename:isInfinity")));
bool isNegative() const __attribute__((annotate("cppmm:rename:isNegative")));
static ::IMATH_NAMESPACE::half posInf() __attribute__((annotate("cppmm:rename:create_posInf")));
static ::IMATH_NAMESPACE::half negInf() __attribute__((annotate("cppmm:rename:create_negInf")));
static ::IMATH_NAMESPACE::half qNan() __attribute__((annotate("cppmm:rename:create_qNan")));
static ::IMATH_NAMESPACE::half sNan() __attribute__((annotate("cppmm:rename:create_sNan")));
HALF_EXPORT unsigned short bits() const __attribute__((annotate("cppmm:rename:bits")));
HALF_EXPORT void setBits (unsigned short bits) __attribute__((annotate("cppmm:rename:setBits")));
};
} // namespace IMATH_NAMESPACE
} // namespace cppmm_bind
cd /home/scott/Projects
git clone https://github.com/AcademySoftwareFoundation/Imath.git
mkdir /home/scott/Projects/Imath/build && cd /home/scott/Projects/Imath/build
# This step may not be 100% accurate...
# Needed to generate the ImathConfig.h in .../Imath/build/config
cmake ../ && make
cd /home/scott/Projects/cimathbuild
/home/scott/Projects/cppmm/build/cppmm ../Imath/src/CImath/chalfbindings.cpp -u -- -I/home/scott/Projects/Imath/src -I/home/scott/Projects/Imath/build/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment