4 #include <zerobuf/ConstAllocator.h> 5 #include <zerobuf/Vector.h> 6 #include <zerobuf/Zerobuf.h> 16 typedef std::unique_ptr< const Color > ConstColorPtr;
18 class Color :
public ::zerobuf::Zerobuf
28 void setRed(
float value );
30 float getGreen()
const;
39 float getBlue()
const;
49 Color(
const float& redValue,
const float& greenValue,
const float& blueValue );
52 Color( const ::zerobuf::Zerobuf& rhs );
53 explicit Color( ::zerobuf::AllocatorPtr allocator );
55 Color& operator = (
const Color& rhs ) { ::zerobuf::Zerobuf::operator = ( rhs );
return *
this; }
59 std::string getSchema()
const final;
60 static std::string ZEROBUF_SCHEMA();
61 std::string getTypeName()
const final {
return "lexis::render::Color"; }
62 static std::string ZEROBUF_TYPE_NAME() {
return "lexis::render::Color"; }
63 ::zerobuf::uint128_t getTypeIdentifier()
const final { return ::zerobuf::uint128_t( 0xeac1b06fdceab90bull, 0xacd551bde0515671ull ); }
64 static ::zerobuf::uint128_t ZEROBUF_TYPE_IDENTIFIER() { return ::zerobuf::uint128_t( 0xeac1b06fdceab90bull, 0xacd551bde0515671ull ); }
65 size_t getZerobufStaticSize()
const final {
return 16; }
66 static size_t ZEROBUF_STATIC_SIZE() {
return 16; }
67 size_t getZerobufNumDynamics()
const final {
return 0; }
68 static size_t ZEROBUF_NUM_DYNAMICS() {
return 0; }
69 static ConstColorPtr create(
const void* data,
const size_t size ) {
return ConstColorPtr(
new Color( ::zerobuf::AllocatorPtr( new ::zerobuf::ConstAllocator( reinterpret_cast< const uint8_t* >( data ), size )))); }
71 void _parseJSON(
const Json::Value& json )
final;
72 void _createJSON( Json::Value& json )
const final;
76 typedef std::unique_ptr< const MaterialLUT > ConstMaterialLUTPtr;
81 typedef ::zerobuf::Vector< Color > Diffuse;
88 MaterialLUT::Diffuse& getDiffuse();
89 const MaterialLUT::Diffuse& getDiffuse()
const;
90 std::vector< Color > getDiffuseVector()
const;
97 void setDiffuse(
const std::vector< Color >& value );
99 typedef ::zerobuf::Vector< Color > Emission;
106 MaterialLUT::Emission& getEmission();
107 const MaterialLUT::Emission& getEmission()
const;
108 std::vector< Color > getEmissionVector()
const;
115 void setEmission(
const std::vector< Color >& value );
117 typedef ::zerobuf::Vector< float > Alpha;
124 MaterialLUT::Alpha& getAlpha();
125 const MaterialLUT::Alpha& getAlpha()
const;
133 void setAlpha(
float const * value,
size_t size );
134 std::vector< float > getAlphaVector()
const;
141 void setAlpha(
const std::vector< float >& value );
143 typedef ::zerobuf::Vector< float > Contribution;
150 MaterialLUT::Contribution& getContribution();
151 const MaterialLUT::Contribution& getContribution()
const;
159 void setContribution(
float const * value,
size_t size );
160 std::vector< float > getContributionVector()
const;
167 void setContribution(
const std::vector< float >& value );
176 const double* getRange()
const;
177 std::vector< double > getRangeVector()
const;
184 void setRange(
double value[ 2 ] );
191 void setRange(
const std::vector< double >& value );
192 size_t getRangeSize()
const;
194 void compact(
float threshold = 0.1f )
final;
196 MaterialLUT(
const std::vector< double >& rangeValue,
const std::vector< Color >& diffuseValue,
const std::vector< Color >& emissionValue,
const std::vector< float >& alphaValue,
const std::vector< float >& contributionValue );
200 explicit MaterialLUT( ::zerobuf::AllocatorPtr allocator );
202 MaterialLUT& operator = (
const MaterialLUT& rhs ) { ::zerobuf::Zerobuf::operator = ( rhs );
return *
this; }
206 std::string getSchema()
const final;
207 static std::string ZEROBUF_SCHEMA();
208 std::string getTypeName()
const final {
return "lexis::render::MaterialLUT"; }
209 static std::string ZEROBUF_TYPE_NAME() {
return "lexis::render::MaterialLUT"; }
210 ::zerobuf::uint128_t getTypeIdentifier()
const final { return ::zerobuf::uint128_t( 0xc94392f3d81dd79bull, 0x62b65853c6d7f52bull ); }
211 static ::zerobuf::uint128_t ZEROBUF_TYPE_IDENTIFIER() { return ::zerobuf::uint128_t( 0xc94392f3d81dd79bull, 0x62b65853c6d7f52bull ); }
212 size_t getZerobufStaticSize()
const final {
return 84; }
213 static size_t ZEROBUF_STATIC_SIZE() {
return 84; }
214 size_t getZerobufNumDynamics()
const final {
return 4; }
215 static size_t ZEROBUF_NUM_DYNAMICS() {
return 4; }
216 static ConstMaterialLUTPtr create(
const void* data,
const size_t size ) {
return ConstMaterialLUTPtr(
new MaterialLUT( ::zerobuf::AllocatorPtr( new ::zerobuf::ConstAllocator( reinterpret_cast< const uint8_t* >( data ), size )))); }
218 void _parseJSON(
const Json::Value& json )
final;
219 void _createJSON( Json::Value& json )
const final;
225 Contribution _contribution;
void setRed(float value)
Set the Red value.
void setGreen(float value)
Set the Green value.
void setBlue(float value)
Set the Blue value.