tables.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #ifndef __TABLES_H__
  17. #define __TABLES_H__
  18. #include "util/util_list.h"
  19. CCL_NAMESPACE_BEGIN
  20. class Device;
  21. class DeviceScene;
  22. class Scene;
  23. enum { TABLE_CHUNK_SIZE = 256 };
  24. enum { TABLE_OFFSET_INVALID = -1 };
  25. class LookupTables {
  26. public:
  27. struct Table {
  28. size_t offset;
  29. size_t size;
  30. };
  31. bool need_update;
  32. list<Table> lookup_tables;
  33. LookupTables();
  34. ~LookupTables();
  35. void device_update(Device *device, DeviceScene *dscene);
  36. void device_free(Device *device, DeviceScene *dscene);
  37. size_t add_table(DeviceScene *dscene, vector<float> &data);
  38. void remove_table(size_t *offset);
  39. };
  40. CCL_NAMESPACE_END
  41. #endif /* __TABLES_H__ */