OBJParser
OBJ File Parser Powered by Boost Spirit
 All Classes Functions Variables Enumerations Enumerator Pages
OBJTextureDescriptor.hpp
1 /*
2  * Copyright 2016 Steven T Sell (ssell@vertexfragment.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __H__OBJ_PARSER_TEXTURE_DESCRIPTOR__H__
18 #define __H__OBJ_PARSER_TEXTURE_DESCRIPTOR__H__
19 
20 #include "OBJStructs.hpp"
21 
22 #include <string>
23 #include <cstdint>
24 
25 //------------------------------------------------------------------------------------------
26 
27 enum class OBJTextureChannel
28 {
29  None = 0,
30  Red,
31  Green,
32  Blue,
33  Matte,
34  Luminance,
35  Depth
36 };
37 
47 {
48 public:
49 
52 
53  OBJTextureDescriptor& operator=(OBJTextureDescriptor const& rhs);
54 
55  void setBlendU(bool on);
56  bool getBlendU() const;
57 
58  void setBlendV(bool on);
59  bool getBlendV() const;
60 
61  void setClamp(bool on);
62  bool getClamp() const;
63 
64  void setColorCorrection(bool on);
65  bool getColorCorrection() const;
66 
67  void setResolution(uint32_t resolution);
68  uint32_t getResolution() const;
69 
70  void setBumpMultiplier(float multiplier);
71  float getBumpMultiplier() const;
72 
73  void setBoost(float boost);
74  float getBoost() const;
75 
76  void setRangeMod(OBJVector2 const& basegain);
77 
78  float getRangeModBase() const;
79  float getRangeModGain() const;
80 
81  void setOffset(OBJVector3 const& offset);
82  OBJVector3 const& getOffset() const;
83 
84  void setScale(OBJVector3 const& scale);
85  OBJVector3 const& getScale() const;
86 
87  void setTurbulence(OBJVector3 const& turbulence);
88  OBJVector3 const& getTurbulence() const;
89 
90  void setimfchan(char channel);
91  OBJTextureChannel getimfchan() const;
92 
93  void setPath(std::string const& path);
94  std::string const& getPath() const;
95 
96 protected:
97 
98  bool m_BlendU;
99  bool m_BlendV;
100  bool m_Clamp;
102 
103  uint32_t m_Resolution;
104 
106  float m_Boost;
107 
110 
114 
115  OBJTextureChannel m_imfchan;
116 
117  std::string m_Path;
118 
119 private:
120 };
121 
122 //------------------------------------------------------------------------------------------
123 
124 #endif
OBJVector3 m_Scale
Scales the values of the texture. Default (1.0, 1.0, 1.0). (horiz, vert, depth).
Definition: OBJTextureDescriptor.hpp:112
float m_Boost
Increases sharpness of mip-mapped textures. Positive only. Typical range (1.0 - 5.0)
Definition: OBJTextureDescriptor.hpp:106
bool m_ColorCorrection
If true, enable color correction. Only used on ambient, diffuse, and specular textures.
Definition: OBJTextureDescriptor.hpp:101
Simple two-component vector struct.
Definition: OBJStructs.hpp:32
Definition: OBJTextureDescriptor.hpp:46
float m_BumpMultiplier
Multiplier of values in bump textures only. Positive or negative. Typical range (0.0 - 1.0)
Definition: OBJTextureDescriptor.hpp:105
OBJVector3 m_Offset
Offsets the position of the texture on the surface via shifting. Default (0.0, 0.0, 0.0). (horiz, vert, depth).
Definition: OBJTextureDescriptor.hpp:111
bool m_BlendV
If true, enable texture blending along the vertical axis. Default is true.
Definition: OBJTextureDescriptor.hpp:99
bool m_BlendU
If true, enable texture blending along the horizontal axis. Default is true.
Definition: OBJTextureDescriptor.hpp:98
uint32_t m_Resolution
Texture resolution. Default of 0 if no resolution specified.
Definition: OBJTextureDescriptor.hpp:103
OBJVector3 m_Turbulence
Applies turbulence to the texture. Default (0.0, 0.0, 0.0) for no turbulence. (horiz, vert, depth).
Definition: OBJTextureDescriptor.hpp:113
bool m_Clamp
If true, enable texture clamping. Default is false.
Definition: OBJTextureDescriptor.hpp:100
OBJTextureChannel m_imfchan
Specifies the channel used to create a scalar or bump texture.
Definition: OBJTextureDescriptor.hpp:115
std::string m_Path
Relative path (from material file) to texture source file. Includes file extension.
Definition: OBJTextureDescriptor.hpp:117
Simple three-component vector struct.
Definition: OBJStructs.hpp:41
float m_RangeModGain
Modifies texture values by increasing the contrast. Default is 1.0.
Definition: OBJTextureDescriptor.hpp:109
float m_RangeModBase
Modifies texture values by adding a base value. Default is 0.0.
Definition: OBJTextureDescriptor.hpp:108