Blender  V2.93
tables.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2013 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 __TABLES_H__
18 #define __TABLES_H__
19 
20 #include "util/util_list.h"
21 #include "util/util_vector.h"
22 
24 
25 class Device;
26 class DeviceScene;
27 class Scene;
28 
29 enum { TABLE_CHUNK_SIZE = 256 };
30 enum { TABLE_OFFSET_INVALID = -1 };
31 
32 class LookupTables {
33  bool need_update_;
34 
35  public:
36  struct Table {
37  size_t offset;
38  size_t size;
39  };
40 
41  list<Table> lookup_tables;
42 
43  LookupTables();
44  ~LookupTables();
45 
46  void device_update(Device *device, DeviceScene *dscene, Scene *scene);
47  void device_free(Device *device, DeviceScene *dscene);
48 
49  bool need_update() const;
50 
51  size_t add_table(DeviceScene *dscene, vector<float> &data);
52  void remove_table(size_t *offset);
53 };
54 
56 
57 #endif /* __TABLES_H__ */
Definition: device.h:293
void device_free(Device *device, DeviceScene *dscene)
Definition: tables.cpp:58
size_t add_table(DeviceScene *dscene, vector< float > &data)
Definition: tables.cpp:73
~LookupTables()
Definition: tables.cpp:34
void remove_table(size_t *offset)
Definition: tables.cpp:108
LookupTables()
Definition: tables.cpp:29
list< Table > lookup_tables
Definition: tables.h:41
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
Definition: tables.cpp:39
bool need_update() const
Definition: tables.cpp:63
Scene scene
#define CCL_NAMESPACE_END
@ TABLE_CHUNK_SIZE
Definition: tables.h:29
@ TABLE_OFFSET_INVALID
Definition: tables.h:30