Code Monkey home page Code Monkey logo

Comments (2)

steven-varga avatar steven-varga commented on August 27, 2024

May I ask the reason? In any event h5::dt_t<> is specialized for half float, the pretty name is for decoration only.

// Open XDR doesn-t define namespace or 
#ifdef WITH_OPENEXR_HALF 
   namespace h5::impl::detail {
//!!!! specialize h5::dt<MYTYPE> { ... } !!!!
	template <> struct hid_t<OPENEXR_NAMESPACE::half, H5Tclose,true,true, hdf5::type> : public dt_p<OPENEXR_NAMESPACE::half> {
		using parent = dt_p<OPENEXR_NAMESPACE::half>;
		using parent::hid_t;
		using hidtype = OPENEXR_NAMESPACE::half;
		hid_t() : parent( H5Tcopy( H5T_NATIVE_FLOAT ) ) {
                       // !!! half float specifics !!!!
			H5Tset_fields( handle, 15, 10, 5, 0, 10);
			H5Tset_precision(handle, 16);
			H5Tset_ebias( handle, 15);
			H5Tset_size(handle,2);
			hid_t id = static_cast<hid_t>( *this );
		}
	};
}
// REGISTER NAME for HALF FLOAT
namespace h5 {
	template <> struct name<OPENEXR_NAMESPACE::half> {
		static constexpr char const * value = "openexr half-float";
	};
}

from h5cpp.

ChrisDrozdowski avatar ChrisDrozdowski commented on August 27, 2024

I got what I needed- just a push to take a second look at the copy and not create. I have to explain half precision float and HDF to some developers. Sorry for the waste of time.

from h5cpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.