Blender  V2.93
util_ies.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2018 Blender Foundation
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 __UTIL_IES_H__
18 #define __UTIL_IES_H__
19 
20 #include "util/util_string.h"
21 #include "util/util_vector.h"
22 
24 
25 class IESFile {
26  public:
28  {
29  }
30  ~IESFile();
31 
32  int packed_size();
33  void pack(float *data);
34 
35  bool load(const string &ies);
36  void clear();
37 
38  protected:
39  bool parse(const string &ies);
40  bool process();
41  bool process_type_b();
42  bool process_type_c();
43 
44  /* The brightness distribution is stored in spherical coordinates.
45  * The horizontal angles correspond to theta in the regular notation
46  * and always span the full range from 0° to 360°.
47  * The vertical angles correspond to phi and always start at 0°. */
49  /* The actual values are stored here, with every entry storing the values
50  * of one horizontal segment. */
52 
53  /* Types of angle representation in IES files. Currently, only B and C are supported. */
54  enum IESType { TYPE_A = 3, TYPE_B = 2, TYPE_C = 1 } type;
55 };
56 
58 
59 #endif /* __UTIL_IES_H__ */
void pack(float *data)
Definition: util_ies.cpp:58
bool process_type_c()
Definition: util_ies.cpp:298
bool process()
Definition: util_ies.cpp:373
enum IESFile::IESType type
vector< vector< float > > intensity
Definition: util_ies.h:51
vector< float > v_angles
Definition: util_ies.h:48
vector< float > h_angles
Definition: util_ies.h:48
bool load(const string &ies)
Definition: util_ies.cpp:33
IESFile()
Definition: util_ies.h:27
~IESFile()
Definition: util_ies.cpp:406
bool parse(const string &ies)
Definition: util_ies.cpp:121
int packed_size()
Definition: util_ies.cpp:50
@ TYPE_A
Definition: util_ies.h:54
@ TYPE_C
Definition: util_ies.h:54
@ TYPE_B
Definition: util_ies.h:54
bool process_type_b()
Definition: util_ies.cpp:210
void clear()
Definition: util_ies.cpp:43
#define CCL_NAMESPACE_END