|
Blender V5.3
|
#include <camera.h>
Inherits Node.
Public Types | |
| enum | RollingShutterType { ROLLING_SHUTTER_NONE = 0 , ROLLING_SHUTTER_TOP = 1 , ROLLING_SHUTTER_NUM_TYPES } |
| enum | StereoEye { STEREO_NONE , STEREO_LEFT , STEREO_RIGHT } |
Public Member Functions | |
| Camera () | |
| ~Camera () override | |
| void | compute_auto_viewplane () |
| void | update (Scene *scene) |
| void | update_interactive_motion () |
| void | device_update (Device *device, DeviceScene *dscene, Scene *scene) |
| void | device_update_volume (Device *device, DeviceScene *dscene, Scene *scene) |
| void | device_free (Device *device, DeviceScene *dscene, Scene *scene) |
| BoundBox | viewplane_bounds_get () |
| float | world_to_raster_size (const float3 P) |
| float | motion_time (const int step) const |
| int | motion_step (const float time) const |
| bool | use_motion () const |
| uint64_t | get_kernel_features () const |
| bool | set_screen_size (int width, int height) |
| void | set_osl_camera (Scene *scene, OSLCameraParamQuery ¶ms, const std::string &filepath, const std::string &bytecode_hash="", const std::string &bytecode="") |
| void | clear_osl_camera (Scene *scene) |
| Public Member Functions inherited from Node | |
| Node (const NodeType *type, ustring name=ustring()) | |
| virtual | ~Node ()=0 |
| void | set (const SocketType &input, bool value) |
| void | set (const SocketType &input, const int value) |
| void | set (const SocketType &input, const uint value) |
| void | set (const SocketType &input, const uint64_t value) |
| void | set (const SocketType &input, const float value) |
| void | set (const SocketType &input, const float2 value) |
| void | set (const SocketType &input, const float3 value) |
| void | set (const SocketType &input, const char *value) |
| void | set (const SocketType &input, ustring value) |
| void | set (const SocketType &input, const Transform &value) |
| void | set (const SocketType &input, Node *value) |
| template<class ValueType, std::enable_if_t< std::is_enum_v< ValueType >, bool > = true> | |
| void | set (const SocketType &input, const ValueType &value) |
| void | set (const SocketType &input, array< bool > &value) |
| void | set (const SocketType &input, array< int > &value) |
| void | set (const SocketType &input, array< float > &value) |
| void | set (const SocketType &input, array< float2 > &value) |
| void | set (const SocketType &input, array< packed_float3 > &value) |
| void | set (const SocketType &input, array< ustring > &value) |
| void | set (const SocketType &input, array< Transform > &value) |
| void | set (const SocketType &input, array< Node * > &value) |
| bool | get_bool (const SocketType &input) const |
| int | get_int (const SocketType &input) const |
| uint | get_uint (const SocketType &input) const |
| uint64_t | get_uint64 (const SocketType &input) const |
| float | get_float (const SocketType &input) const |
| float2 | get_float2 (const SocketType &input) const |
| float3 | get_float3 (const SocketType &input) const |
| ustring | get_string (const SocketType &input) const |
| Transform | get_transform (const SocketType &input) const |
| Node * | get_node (const SocketType &input) const |
| const array< bool > & | get_bool_array (const SocketType &input) const |
| const array< int > & | get_int_array (const SocketType &input) const |
| const array< float > & | get_float_array (const SocketType &input) const |
| const array< float2 > & | get_float2_array (const SocketType &input) const |
| const array< packed_float3 > & | get_float3_array (const SocketType &input) const |
| const array< ustring > & | get_string_array (const SocketType &input) const |
| const array< Transform > & | get_transform_array (const SocketType &input) const |
| const array< Node * > & | get_node_array (const SocketType &input) const |
| bool | has_default_value (const SocketType &input) const |
| void | set_default_value (const SocketType &input) |
| bool | equals_value (const Node &other, const SocketType &socket) const |
| void | copy_value (const SocketType &socket, const Node &other, const SocketType &other_socket) |
| void | set_value (const SocketType &socket, const Node &other, const SocketType &other_socket) |
| bool | equals (const Node &other) const |
| void | hash (MD5Hash &md5) |
| size_t | get_total_size_in_bytes () const |
| bool | is_a (const NodeType *type) |
| bool | socket_is_modified (const SocketType &input) const |
| bool | is_modified () const |
| void | tag_modified () |
| void | clear_modified () |
| void | print_modified_sockets () const |
| const NodeOwner * | get_owner () const |
| void | set_owner (const NodeOwner *owner_) |
| int | reference_count () const |
| void | reference () |
| void | dereference () |
| void | clear_reference_count () |
Public Attributes | |
| size_t | shutter_table_offset |
| BoundBox2D | viewplane |
| BoundBox2D | border |
| BoundBox2D | viewport_camera_border |
| BoundBox2D | viewplane_pre |
| BoundBox2D | viewplane_post |
| ProjectionTransform | screentoworld |
| ProjectionTransform | rastertoworld |
| ProjectionTransform | ndctoworld |
| Transform | cameratoworld |
| ProjectionTransform | worldtoraster |
| ProjectionTransform | worldtoscreen |
| ProjectionTransform | worldtondc |
| Transform | worldtocamera |
| ProjectionTransform | rastertocamera |
| ProjectionTransform | full_rastertocamera |
| float3 | dx |
| float3 | dy |
| float3 | full_dx |
| float3 | full_dy |
| float3 | frustum_right_normal |
| float3 | frustum_top_normal |
| float3 | frustum_left_normal |
| float3 | frustum_bottom_normal |
| bool | need_device_update |
| bool | need_flags_update |
| int | previous_need_motion |
| KernelCamera | kernel_camera |
| array< DecomposedTransform > | kernel_camera_motion |
| std::string | script_name |
| map< ustring, pair< vector< uint8_t >, TypeDesc > > | script_params |
| Public Attributes inherited from Node | |
| ustring | name |
| const NodeType * | type |
| InternalNode | internal |
| LeafNode | leaf |
Additional Inherited Members | |
| Protected Member Functions inherited from Node | |
| template<typename T> | |
| void | set_if_different (const SocketType &input, T value) |
| void | set_if_different (const SocketType &input, Node *value) |
| template<typename T> | |
| void | set_if_different (const SocketType &input, array< T > &value) |
| void | set_if_different (const SocketType &input, array< Node * > &value) |
| void | dereference_all_used_nodes () |
| Static Protected Member Functions inherited from Node | |
| template<typename T> | |
| static T & | get_socket_value (const Node *node, const SocketType &socket) |
| Protected Attributes inherited from Node | |
| const NodeOwner * | owner |
| int | ref_count {0} |
| SocketModifiedFlags | socket_modified |
Definition at line 39 of file scene/camera.h.
| Enumerator | |
|---|---|
| ROLLING_SHUTTER_NONE | |
| ROLLING_SHUTTER_TOP | |
| ROLLING_SHUTTER_NUM_TYPES | |
Definition at line 44 of file scene/camera.h.
| enum Camera::StereoEye |
| Enumerator | |
|---|---|
| STEREO_NONE | |
| STEREO_LEFT | |
| STEREO_RIGHT | |
Definition at line 54 of file scene/camera.h.
| Camera::Camera | ( | ) |
Definition at line 177 of file scene/camera.cpp.
References cameratoworld, compute_auto_viewplane(), dx, dy, full_rastertocamera, kernel_camera, ndctoworld, need_device_update, need_flags_update, Node::Node(), previous_need_motion, projection_identity(), RAMP_TABLE_SIZE, rastertocamera, rastertoworld, screentoworld, shutter_table_offset, TABLE_OFFSET_INVALID, transform_identity(), worldtoraster, and zero_float3().
Referenced by ~Camera().
|
overridedefault |
References Camera(), CCL_NAMESPACE_END, clear_osl_camera(), compute_auto_viewplane(), device_free(), device_update(), device_update_volume(), get_kernel_features(), motion_step(), motion_time(), P, set_osl_camera(), set_screen_size(), step, update(), update_interactive_motion(), use_motion(), viewplane_bounds_get(), and world_to_raster_size().
| void Camera::clear_osl_camera | ( | Scene * | scene | ) |
Definition at line 1073 of file scene/camera.cpp.
References Scene::osl_manager, script_name, and script_params.
Referenced by blender_camera_sync(), and ~Camera().
| void Camera::compute_auto_viewplane | ( | ) |
Definition at line 211 of file scene/camera.cpp.
References BoundBox2D::BoundBox2D(), CAMERA_CUSTOM, CAMERA_PANORAMA, float, BoundBox2D::full, make_float2, and viewplane.
Referenced by Camera(), scene_init(), and ~Camera().
| void Camera::device_free | ( | Device * | device, |
| DeviceScene * | dscene, | ||
| Scene * | scene ) |
Definition at line 648 of file scene/camera.cpp.
References DeviceScene::camera_motion, device_vector< T >::free(), Scene::lookup_tables, and shutter_table_offset.
Referenced by Scene::free_memory(), and ~Camera().
| void Camera::device_update | ( | Device * | device, |
| DeviceScene * | dscene, | ||
| Scene * | scene ) |
Definition at line 559 of file scene/camera.cpp.
References device_vector< T >::alloc(), DeviceScene::camera_motion, device_vector< T >::copy_to_device(), array< T, alignment >::data(), DeviceScene::data, device_vector< T >::free(), kernel_camera, kernel_camera_motion, Scene::lookup_tables, need_device_update, shutter_curve_eval(), shutter_table_offset, KernelCamera::shutter_table_offset, SHUTTER_TABLE_SIZE, KernelCamera::shuttertime, array< T, alignment >::size(), update(), Scene::update_stats, util_cdf_inverted(), and x.
Referenced by Scene::device_update(), Scene::update_camera_resolution(), and ~Camera().
| void Camera::device_update_volume | ( | Device * | device, |
| DeviceScene * | dscene, | ||
| Scene * | scene ) |
Definition at line 600 of file scene/camera.cpp.
References CAMERA_CUSTOM, DeviceScene::data, KernelCamera::is_inside_volume, kernel_camera, LOG_INFO, need_device_update, need_flags_update, Scene::objects, unique_ptr_vector< T >::size(), and viewplane_bounds_get().
Referenced by Scene::device_update(), and ~Camera().
| uint64_t Camera::get_kernel_features | ( | ) | const |
Definition at line 1089 of file scene/camera.cpp.
References KERNEL_FEATURE_OSL_CAMERA, and script_name.
Referenced by Scene::update_kernel_features(), and ~Camera().
| int Camera::motion_step | ( | const float | time | ) | const |
Definition at line 943 of file scene/camera.cpp.
References motion_time(), step, and use_motion().
Referenced by ~Camera().
| float Camera::motion_time | ( | const int | step | ) | const |
Definition at line 938 of file scene/camera.cpp.
References step, and use_motion().
Referenced by motion_step(), and ~Camera().
| void Camera::set_osl_camera | ( | Scene * | scene, |
| OSLCameraParamQuery & | params, | ||
| const std::string & | filepath, | ||
| const std::string & | bytecode_hash = "", | ||
| const std::string & | bytecode = "" ) |
Definition at line 956 of file scene/camera.cpp.
References OSLCameraParamQuery::get_float(), OSLCameraParamQuery::get_int(), OSLCameraParamQuery::get_string(), Node::hash(), Scene::osl_manager, script_name, script_params, Scene::shader_manager, and Node::tag_modified().
Referenced by blender_camera_sync(), and ~Camera().
| bool Camera::set_screen_size | ( | int | width, |
| int | height ) |
Definition at line 926 of file scene/camera.cpp.
References Node::tag_modified().
Referenced by Scene::update_camera_resolution(), and ~Camera().
| void Camera::update | ( | Scene * | scene | ) |
Definition at line 227 of file scene/camera.cpp.
References KernelCamera::aperturesize, KernelCamera::blades, KernelCamera::bladesrotation, border, BoundBox2D::bottom, CAMERA_CUSTOM, CAMERA_ORTHOGRAPHIC, CAMERA_PANORAMA, CAMERA_PERSPECTIVE, cameratoworld, KernelCamera::cameratoworld, KernelCamera::central_cylindrical_range, array< T, alignment >::clear(), Node::clear_modified(), KernelCamera::cliplength, KernelCamera::convergence_distance, array< T, alignment >::data(), KernelCamera::differential_scale, dx, KernelCamera::dx, dy, KernelCamera::dy, KernelCamera::equirectangular_range, KernelCamera::fisheye_fov, KernelCamera::fisheye_lens, KernelCamera::fisheye_lens_polynomial_bias, KernelCamera::fisheye_lens_polynomial_coefficients, float, FLT_MAX, KernelCamera::focaldistance, frustum_bottom_normal, frustum_left_normal, frustum_right_normal, frustum_top_normal, full_dx, full_dy, full_rastertocamera, KernelCamera::have_perspective_motion, BoundBox2D::height(), KernelCamera::height, KernelCamera::interocular_offset, KernelCamera::inv_aperture_ratio, BoundBox2D::is_empty(), Node::is_modified(), kernel_camera, kernel_camera_motion, BoundBox2D::left, M_PI_2_F, make_float2, make_float3(), make_float4, max, Scene::MOTION_BLUR, Scene::MOTION_PASS, Scene::MOTION_PASS_INTERACTIVE, KernelCamera::motion_pass_post, KernelCamera::motion_pass_pre, KernelCamera::motion_position, ndctoworld, KernelCamera::ndctoworld, KernelCamera::nearclip, need_device_update, need_flags_update, Scene::need_motion(), normalize, KernelCamera::num_motion_steps, BoundBox2D::offset(), KernelCamera::panorama_type, KernelCamera::perspective_post, KernelCamera::perspective_pre, KernelCamera::pole_merge_angle_from, KernelCamera::pole_merge_angle_to, previous_need_motion, projection_identity(), projection_inverse(), projection_orthographic(), projection_perspective(), rastertocamera, KernelCamera::rastertocamera, rastertoworld, KernelCamera::rastertoworld, array< T, alignment >::resize(), KernelCamera::rolling_shutter_duration, KernelCamera::rolling_shutter_type, screentoworld, KernelCamera::screentoworld, KernelCamera::sensorheight, KernelCamera::sensorwidth, KernelCamera::shuttertime, STEREO_LEFT, STEREO_NONE, STEREO_RIGHT, transform_direction(), transform_from_viewplane(), transform_inverse(), transform_motion_decompose(), transform_perspective(), transform_perspective_direction(), transform_scale(), KernelCamera::type, Scene::update_stats, viewplane, viewplane_post, viewplane_pre, viewport_camera_border, BoundBox2D::width(), KernelCamera::width, worldtocamera, KernelCamera::worldtocamera, worldtondc, KernelCamera::worldtondc, worldtoraster, KernelCamera::worldtoraster, worldtoscreen, KernelCamera::worldtoscreen, and zero_float3().
Referenced by device_update(), BlenderObjectCulling::init_object(), xml_read_camera(), and ~Camera().
| void Camera::update_interactive_motion | ( | ) |
Definition at line 539 of file scene/camera.cpp.
References border, BoundBox2D::bottom, array< T, alignment >::empty(), BoundBox2D::left, BoundBox2D::right, BoundBox2D::top, and viewplane.
Referenced by Scene::device_update(), and ~Camera().
| bool Camera::use_motion | ( | ) | const |
Definition at line 921 of file scene/camera.cpp.
References BoundBox::size().
Referenced by motion_step(), motion_time(), and ~Camera().
| BoundBox Camera::viewplane_bounds_get | ( | ) |
Definition at line 684 of file scene/camera.cpp.
References CAMERA_CUSTOM, CAMERA_PANORAMA, CAMERA_PERSPECTIVE, cameratoworld, BoundBox::empty, BoundBox::grow(), make_float3(), max, float4::w, Transform::x, Transform::y, and Transform::z.
Referenced by device_update_volume(), and ~Camera().
Definition at line 759 of file scene/camera.cpp.
References b, CAMERA_CUSTOM, CAMERA_ORTHOGRAPHIC, CAMERA_PANORAMA, CAMERA_PERSPECTIVE, camera_sample_custom(), camera_sample_panorama(), cameratoworld, D, Ray::D, array< T, alignment >::data(), differential_transfer_compact(), direction_to_panorama(), dot(), dx, frustum_bottom_normal, frustum_left_normal, frustum_right_normal, frustum_top_normal, full_dx, full_dy, full_rastertocamera, kernel_camera, kernel_camera_motion, len(), len_squared(), make_float2, make_float3(), max, min, normalize, P, sqrtf, transform_direction(), transform_perspective(), transform_point(), worldtocamera, float2::x, float3::x, float2::y, float3::y, float3::z, zero_float2(), and zero_float3().
Referenced by ~Camera().
| BoundBox2D Camera::border |
Definition at line 138 of file scene/camera.h.
Referenced by BlenderSync::get_buffer_params(), update(), and update_interactive_motion().
| Transform Camera::cameratoworld |
Definition at line 176 of file scene/camera.h.
Referenced by Camera(), update(), viewplane_bounds_get(), and world_to_raster_size().
| float3 Camera::dx |
Definition at line 187 of file scene/camera.h.
Referenced by Camera(), update(), and world_to_raster_size().
| float3 Camera::dy |
Definition at line 188 of file scene/camera.h.
| float3 Camera::frustum_bottom_normal |
Definition at line 196 of file scene/camera.h.
Referenced by update(), and world_to_raster_size().
| float3 Camera::frustum_left_normal |
Definition at line 195 of file scene/camera.h.
Referenced by update(), and world_to_raster_size().
| float3 Camera::frustum_right_normal |
Definition at line 193 of file scene/camera.h.
Referenced by update(), and world_to_raster_size().
| float3 Camera::frustum_top_normal |
Definition at line 194 of file scene/camera.h.
Referenced by update(), and world_to_raster_size().
| float3 Camera::full_dx |
Definition at line 190 of file scene/camera.h.
Referenced by update(), and world_to_raster_size().
| float3 Camera::full_dy |
Definition at line 191 of file scene/camera.h.
Referenced by update(), and world_to_raster_size().
| ProjectionTransform Camera::full_rastertocamera |
Definition at line 185 of file scene/camera.h.
Referenced by Camera(), update(), and world_to_raster_size().
| KernelCamera Camera::kernel_camera |
Definition at line 204 of file scene/camera.h.
Referenced by Camera(), device_update(), device_update_volume(), update(), and world_to_raster_size().
| array<DecomposedTransform> Camera::kernel_camera_motion |
Definition at line 205 of file scene/camera.h.
Referenced by device_update(), update(), and world_to_raster_size().
| ProjectionTransform Camera::ndctoworld |
Definition at line 175 of file scene/camera.h.
| bool Camera::need_device_update |
Definition at line 199 of file scene/camera.h.
Referenced by Camera(), device_update(), device_update_volume(), and update().
| bool Camera::need_flags_update |
Definition at line 200 of file scene/camera.h.
Referenced by Camera(), device_update_volume(), Object::tag_update(), update(), and xml_read_camera().
| int Camera::previous_need_motion |
Definition at line 201 of file scene/camera.h.
| ProjectionTransform Camera::rastertocamera |
Definition at line 183 of file scene/camera.h.
| ProjectionTransform Camera::rastertoworld |
Definition at line 174 of file scene/camera.h.
| ProjectionTransform Camera::screentoworld |
Definition at line 173 of file scene/camera.h.
| std::string Camera::script_name |
Definition at line 208 of file scene/camera.h.
Referenced by clear_osl_camera(), get_kernel_features(), and set_osl_camera().
| map<ustring, pair<vector<uint8_t>, TypeDesc> > Camera::script_params |
Definition at line 209 of file scene/camera.h.
Referenced by clear_osl_camera(), and set_osl_camera().
| size_t Camera::shutter_table_offset |
Definition at line 64 of file scene/camera.h.
Referenced by Camera(), device_free(), and device_update().
| BoundBox2D Camera::viewplane |
Definition at line 125 of file scene/camera.h.
Referenced by compute_auto_viewplane(), update(), and update_interactive_motion().
| BoundBox2D Camera::viewplane_post |
Definition at line 162 of file scene/camera.h.
Referenced by update().
| BoundBox2D Camera::viewplane_pre |
Definition at line 161 of file scene/camera.h.
Referenced by update().
| BoundBox2D Camera::viewport_camera_border |
Definition at line 146 of file scene/camera.h.
Referenced by update().
| Transform Camera::worldtocamera |
Definition at line 181 of file scene/camera.h.
Referenced by update(), and world_to_raster_size().
| ProjectionTransform Camera::worldtondc |
Definition at line 180 of file scene/camera.h.
Referenced by update().
| ProjectionTransform Camera::worldtoraster |
Definition at line 178 of file scene/camera.h.
Referenced by Camera(), EdgeDice::eval_projected(), and update().
| ProjectionTransform Camera::worldtoscreen |
Definition at line 179 of file scene/camera.h.
Referenced by update().