diff options
author | Jason Kuo <j20001970@gmail.com> | 2024-09-27 18:10:59 +0800 |
---|---|---|
committer | Jason Kuo <j20001970@gmail.com> | 2024-09-27 20:07:36 +0800 |
commit | 38d7ec1640ece8cdf6774ff5ae1f9f37d0a5cc66 (patch) | |
tree | 0159498409257fd03a4390793f10946382152d31 /servers/camera | |
parent | 506d6e427a4eecfc1e5e5ee1180019a876119701 (diff) | |
download | redot-engine-38d7ec1640ece8cdf6774ff5ae1f9f37d0a5cc66.tar.gz |
Expose CameraFeed setters
Diffstat (limited to 'servers/camera')
-rw-r--r-- | servers/camera/camera_feed.cpp | 17 | ||||
-rw-r--r-- | servers/camera/camera_feed.h | 6 |
2 files changed, 10 insertions, 13 deletions
diff --git a/servers/camera/camera_feed.cpp b/servers/camera/camera_feed.cpp index 8f6a40481d..4021d9564b 100644 --- a/servers/camera/camera_feed.cpp +++ b/servers/camera/camera_feed.cpp @@ -33,26 +33,23 @@ #include "servers/rendering_server.h" void CameraFeed::_bind_methods() { - // The setters prefixed with _ are only exposed so we can have feeds through GDExtension! - // They should not be called by the end user. - ClassDB::bind_method(D_METHOD("get_id"), &CameraFeed::get_id); ClassDB::bind_method(D_METHOD("is_active"), &CameraFeed::is_active); ClassDB::bind_method(D_METHOD("set_active", "active"), &CameraFeed::set_active); ClassDB::bind_method(D_METHOD("get_name"), &CameraFeed::get_name); - ClassDB::bind_method(D_METHOD("_set_name", "name"), &CameraFeed::set_name); + ClassDB::bind_method(D_METHOD("set_name", "name"), &CameraFeed::set_name); ClassDB::bind_method(D_METHOD("get_position"), &CameraFeed::get_position); - ClassDB::bind_method(D_METHOD("_set_position", "position"), &CameraFeed::set_position); + ClassDB::bind_method(D_METHOD("set_position", "position"), &CameraFeed::set_position); // Note, for transform some feeds may override what the user sets (such as ARKit) ClassDB::bind_method(D_METHOD("get_transform"), &CameraFeed::get_transform); ClassDB::bind_method(D_METHOD("set_transform", "transform"), &CameraFeed::set_transform); - ClassDB::bind_method(D_METHOD("_set_RGB_img", "rgb_img"), &CameraFeed::set_RGB_img); - ClassDB::bind_method(D_METHOD("_set_YCbCr_img", "ycbcr_img"), &CameraFeed::set_YCbCr_img); + ClassDB::bind_method(D_METHOD("set_rgb_image", "rgb_image"), &CameraFeed::set_rgb_image); + ClassDB::bind_method(D_METHOD("set_ycbcr_image", "ycbcr_image"), &CameraFeed::set_ycbcr_image); ClassDB::bind_method(D_METHOD("get_datatype"), &CameraFeed::get_datatype); @@ -175,7 +172,7 @@ CameraFeed::~CameraFeed() { RenderingServer::get_singleton()->free(texture[CameraServer::FEED_CBCR_IMAGE]); } -void CameraFeed::set_RGB_img(const Ref<Image> &p_rgb_img) { +void CameraFeed::set_rgb_image(const Ref<Image> &p_rgb_img) { ERR_FAIL_COND(p_rgb_img.is_null()); if (active) { int new_width = p_rgb_img->get_width(); @@ -198,7 +195,7 @@ void CameraFeed::set_RGB_img(const Ref<Image> &p_rgb_img) { } } -void CameraFeed::set_YCbCr_img(const Ref<Image> &p_ycbcr_img) { +void CameraFeed::set_ycbcr_image(const Ref<Image> &p_ycbcr_img) { ERR_FAIL_COND(p_ycbcr_img.is_null()); if (active) { int new_width = p_ycbcr_img->get_width(); @@ -221,7 +218,7 @@ void CameraFeed::set_YCbCr_img(const Ref<Image> &p_ycbcr_img) { } } -void CameraFeed::set_YCbCr_imgs(const Ref<Image> &p_y_img, const Ref<Image> &p_cbcr_img) { +void CameraFeed::set_ycbcr_images(const Ref<Image> &p_y_img, const Ref<Image> &p_cbcr_img) { ERR_FAIL_COND(p_y_img.is_null()); ERR_FAIL_COND(p_cbcr_img.is_null()); if (active) { diff --git a/servers/camera/camera_feed.h b/servers/camera/camera_feed.h index 5d1f54be07..492a909239 100644 --- a/servers/camera/camera_feed.h +++ b/servers/camera/camera_feed.h @@ -110,9 +110,9 @@ public: virtual ~CameraFeed(); FeedDataType get_datatype() const; - void set_RGB_img(const Ref<Image> &p_rgb_img); - void set_YCbCr_img(const Ref<Image> &p_ycbcr_img); - void set_YCbCr_imgs(const Ref<Image> &p_y_img, const Ref<Image> &p_cbcr_img); + void set_rgb_image(const Ref<Image> &p_rgb_img); + void set_ycbcr_image(const Ref<Image> &p_ycbcr_img); + void set_ycbcr_images(const Ref<Image> &p_y_img, const Ref<Image> &p_cbcr_img); virtual bool set_format(int p_index, const Dictionary &p_parameters); virtual Array get_formats() const; |