Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/image.cpp
| Show All 12 Lines | |||||
| * See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | ||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #include "render/image.h" | #include "render/image.h" | ||||
| #include "device/device.h" | #include "device/device.h" | ||||
| #include "render/colorspace.h" | #include "render/colorspace.h" | ||||
| #include "render/image_oiio.h" | #include "render/image_oiio.h" | ||||
| #include "render/image_vdb.h" | |||||
| #include "render/scene.h" | #include "render/scene.h" | ||||
| #include "render/stats.h" | #include "render/stats.h" | ||||
| #include "util/util_foreach.h" | #include "util/util_foreach.h" | ||||
| #include "util/util_image.h" | #include "util/util_image.h" | ||||
| #include "util/util_image_impl.h" | #include "util/util_image_impl.h" | ||||
| #include "util/util_logging.h" | #include "util/util_logging.h" | ||||
| #include "util/util_path.h" | #include "util/util_path.h" | ||||
| ▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | device_texture *ImageHandle::image_memory(const int tile_index) const | ||||
| if (tile_index >= tile_slots.size()) { | if (tile_index >= tile_slots.size()) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ImageManager::Image *img = manager->images[tile_slots[tile_index]]; | ImageManager::Image *img = manager->images[tile_slots[tile_index]]; | ||||
| return img ? img->mem : NULL; | return img ? img->mem : NULL; | ||||
| } | } | ||||
| VDBImageLoader *ImageHandle::vdb_loader(const int tile_index) const | |||||
| { | |||||
| if (tile_index >= tile_slots.size()) { | |||||
| return NULL; | |||||
| } | |||||
| ImageManager::Image *img = manager->images[tile_slots[tile_index]]; | |||||
| if (img == NULL) { | |||||
| return NULL; | |||||
| } | |||||
| ImageLoader *loader = img->loader; | |||||
| if (loader == NULL) { | |||||
| return NULL; | |||||
| } | |||||
| if (loader->is_vdb_loader()) { | |||||
| return dynamic_cast<VDBImageLoader *>(loader); | |||||
| } | |||||
| return NULL; | |||||
| } | |||||
| bool ImageHandle::operator==(const ImageHandle &other) const | bool ImageHandle::operator==(const ImageHandle &other) const | ||||
| { | { | ||||
| return manager == other.manager && tile_slots == other.tile_slots; | return manager == other.manager && tile_slots == other.tile_slots; | ||||
| } | } | ||||
| /* Image MetaData */ | /* Image MetaData */ | ||||
| ImageMetaData::ImageMetaData() | ImageMetaData::ImageMetaData() | ||||
| ▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | bool ImageLoader::equals(const ImageLoader *a, const ImageLoader *b) | ||||
| if (a == NULL && b == NULL) { | if (a == NULL && b == NULL) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| else { | else { | ||||
| return (a && b && typeid(*a) == typeid(*b) && a->equals(*b)); | return (a && b && typeid(*a) == typeid(*b) && a->equals(*b)); | ||||
| } | } | ||||
| } | } | ||||
| bool ImageLoader::is_vdb_loader() const | |||||
| { | |||||
| return false; | |||||
| } | |||||
| /* Image Manager */ | /* Image Manager */ | ||||
| ImageManager::ImageManager(const DeviceInfo &info) | ImageManager::ImageManager(const DeviceInfo &info) | ||||
| { | { | ||||
| need_update = true; | need_update = true; | ||||
| osl_texture_system = NULL; | osl_texture_system = NULL; | ||||
| animation_frame = 0; | animation_frame = 0; | ||||
| ▲ Show 20 Lines • Show All 577 Lines • Show Last 20 Lines | |||||