diff options
author | Thomas Dinges <blender@dingto.org> | 2016-05-23 00:24:26 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2016-06-08 22:45:40 +0300 |
commit | 240bddb654b14367f07497f72615f980f4735b69 (patch) | |
tree | 8cc4bbbe86cee1c43a5dc8cbf4f58b6509eaf26c /intern/cycles/render/image.h | |
parent | d565b861e6f31f09d8a371b7ebf22ad0c78fdcbc (diff) |
Cleanup: Deduplicate image loading functions using templates.
Diffstat (limited to 'intern/cycles/render/image.h')
-rw-r--r-- | intern/cycles/render/image.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h index 53f739cd356..2ab16dd8967 100644 --- a/intern/cycles/render/image.h +++ b/intern/cycles/render/image.h @@ -107,10 +107,12 @@ private: bool pack_images; bool file_load_image_generic(Image *img, ImageInput **in, int &width, int &height, int &depth, int &components); - bool file_load_byte4_image(Image *img, device_vector<uchar4>& tex_img); - bool file_load_byte_image(Image *img, device_vector<uchar>& tex_img); - bool file_load_float4_image(Image *img, device_vector<float4>& tex_img); - bool file_load_float_image(Image *img, device_vector<float>& tex_img); + + template<typename T> + bool file_load_byte_image(Image *img, ImageDataType type, device_vector<T>& tex_img); + + template<typename T> + bool file_load_float_image(Image *img, ImageDataType type, device_vector<T>& tex_img); int type_index_to_flattened_slot(int slot, ImageDataType type); int flattened_slot_to_type_index(int flat_slot, ImageDataType *type); |