Loading...
Searching...
No Matches
ies.h
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_PXRIES_IES_H
6#define PXR_IMAGING_PLUGIN_HD_EMBREE_PXRIES_IES_H
7
8
9#include <string>
10#include <vector>
11
12#include "pxr/pxr.h"
13
14PXR_NAMESPACE_OPEN_SCOPE
15
16namespace pxr_ccl {
17
18using std::string;
19using std::vector;
20
21class IESFile {
22 public:
23 IESFile() {}
24 ~IESFile();
25
26 int packed_size();
27 void pack(float *data);
28
29 bool load(const string &ies);
30 void clear();
31
32 protected:
33 bool parse(const string &ies);
34 bool process();
35
36 void process_type_a();
37 void process_type_b();
38 void process_type_c();
39
40 /* The brightness distribution is stored in spherical coordinates.
41 * The horizontal angles correspond to theta in the regular notation
42 * and always span the full range from 0° to 360°.
43 * The vertical angles correspond to phi and always start at 0°. */
44 vector<float> v_angles, h_angles;
45 /* The actual values are stored here, with every entry storing the values
46 * of one horizontal segment. */
47 vector<vector<float>> intensity;
48
49 /* Types of angle representation in IES files. */
50 enum IESType { TYPE_A = 3, TYPE_B = 2, TYPE_C = 1 } type;
51};
52
53} /* namespace pxr_ccl */
54
55PXR_NAMESPACE_CLOSE_SCOPE
56
57#endif /* PXR_IMAGING_PLUGIN_HD_EMBREE_PXRIES_IES_H */