diff options
author | Bastiaan Olij <mux213@gmail.com> | 2019-06-19 22:21:13 +1000 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2019-06-19 22:24:54 +1000 |
commit | 4ebedb5f11b389c79a28b63f377a922e24734ba6 (patch) | |
tree | 857ec9af9e6c7d6a97c0b313de78c68640a52cf7 | |
parent | 7fa941bfd8a1d81fc5c27c21635e60846efc52f4 (diff) |
Made constants fully upper case in camera server
-rw-r--r-- | doc/classes/CameraFeed.xml | 4 | ||||
-rw-r--r-- | doc/classes/CameraServer.xml | 4 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_scene_gles2.cpp | 8 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 8 | ||||
-rw-r--r-- | servers/camera/camera_feed.cpp | 18 | ||||
-rw-r--r-- | servers/camera/camera_feed.h | 4 | ||||
-rw-r--r-- | servers/camera_server.cpp | 4 | ||||
-rw-r--r-- | servers/camera_server.h | 4 |
8 files changed, 27 insertions, 27 deletions
diff --git a/doc/classes/CameraFeed.xml b/doc/classes/CameraFeed.xml index 7f353f7a05..4611b9c507 100644 --- a/doc/classes/CameraFeed.xml +++ b/doc/classes/CameraFeed.xml @@ -45,10 +45,10 @@ <constant name="FEED_RGB" value="1" enum="FeedDataType"> Feed supplies RGB images. </constant> - <constant name="FEED_YCbCr" value="2" enum="FeedDataType"> + <constant name="FEED_YCBCR" value="2" enum="FeedDataType"> Feed supplies YCbCr images that need to be converted to RGB. </constant> - <constant name="FEED_YCbCr_Sep" value="3" enum="FeedDataType"> + <constant name="FEED_YCBCR_SEP" value="3" enum="FeedDataType"> Feed supplies separate Y and CbCr images that need to be combined and converted to RGB. </constant> <constant name="FEED_UNSPECIFIED" value="0" enum="FeedPosition"> diff --git a/doc/classes/CameraServer.xml b/doc/classes/CameraServer.xml index f492bda74f..ee41f08ec6 100644 --- a/doc/classes/CameraServer.xml +++ b/doc/classes/CameraServer.xml @@ -70,13 +70,13 @@ <constant name="FEED_RGBA_IMAGE" value="0" enum="FeedImage"> The RGBA camera image. </constant> - <constant name="FEED_YCbCr_IMAGE" value="0" enum="FeedImage"> + <constant name="FEED_YCBCR_IMAGE" value="0" enum="FeedImage"> The YCbCr camera image. </constant> <constant name="FEED_Y_IMAGE" value="0" enum="FeedImage"> The Y component camera image. </constant> - <constant name="FEED_CbCr_IMAGE" value="1" enum="FeedImage"> + <constant name="FEED_CBCR_IMAGE" value="1" enum="FeedImage"> The CbCr component camera image. </constant> </constants> diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index a07c6832dc..ea29af7d9e 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -2920,16 +2920,16 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const VS::get_singleton()->texture_bind(camera_RGBA, 0); - } else if (feed->get_datatype() == CameraFeed::FEED_YCbCr) { - RID camera_YCbCr = feed->get_texture(CameraServer::FEED_YCbCr_IMAGE); + } else if (feed->get_datatype() == CameraFeed::FEED_YCBCR) { + RID camera_YCbCr = feed->get_texture(CameraServer::FEED_YCBCR_IMAGE); VS::get_singleton()->texture_bind(camera_YCbCr, 0); storage->shaders.copy.set_conditional(CopyShaderGLES2::YCBCR_TO_RGB, true); - } else if (feed->get_datatype() == CameraFeed::FEED_YCbCr_Sep) { + } else if (feed->get_datatype() == CameraFeed::FEED_YCBCR_SEP) { RID camera_Y = feed->get_texture(CameraServer::FEED_Y_IMAGE); - RID camera_CbCr = feed->get_texture(CameraServer::FEED_CbCr_IMAGE); + RID camera_CbCr = feed->get_texture(CameraServer::FEED_CBCR_IMAGE); VS::get_singleton()->texture_bind(camera_Y, 0); VS::get_singleton()->texture_bind(camera_CbCr, 1); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 7acb8a22bc..c7ef5cded4 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -4454,16 +4454,16 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const RID camera_RGBA = feed->get_texture(CameraServer::FEED_RGBA_IMAGE); VS::get_singleton()->texture_bind(camera_RGBA, 0); - } else if (feed->get_datatype() == CameraFeed::FEED_YCbCr) { - RID camera_YCbCr = feed->get_texture(CameraServer::FEED_YCbCr_IMAGE); + } else if (feed->get_datatype() == CameraFeed::FEED_YCBCR) { + RID camera_YCbCr = feed->get_texture(CameraServer::FEED_YCBCR_IMAGE); VS::get_singleton()->texture_bind(camera_YCbCr, 0); storage->shaders.copy.set_conditional(CopyShaderGLES3::YCBCR_TO_SRGB, true); - } else if (feed->get_datatype() == CameraFeed::FEED_YCbCr_Sep) { + } else if (feed->get_datatype() == CameraFeed::FEED_YCBCR_SEP) { RID camera_Y = feed->get_texture(CameraServer::FEED_Y_IMAGE); - RID camera_CbCr = feed->get_texture(CameraServer::FEED_CbCr_IMAGE); + RID camera_CbCr = feed->get_texture(CameraServer::FEED_CBCR_IMAGE); VS::get_singleton()->texture_bind(camera_Y, 0); VS::get_singleton()->texture_bind(camera_CbCr, 1); diff --git a/servers/camera/camera_feed.cpp b/servers/camera/camera_feed.cpp index 31b8b2874f..094c83cd7c 100644 --- a/servers/camera/camera_feed.cpp +++ b/servers/camera/camera_feed.cpp @@ -60,8 +60,8 @@ void CameraFeed::_bind_methods() { BIND_ENUM_CONSTANT(FEED_NOIMAGE); BIND_ENUM_CONSTANT(FEED_RGB); - BIND_ENUM_CONSTANT(FEED_YCbCr); - BIND_ENUM_CONSTANT(FEED_YCbCr_Sep); + BIND_ENUM_CONSTANT(FEED_YCBCR); + BIND_ENUM_CONSTANT(FEED_YCBCR_SEP); BIND_ENUM_CONSTANT(FEED_UNSPECIFIED); BIND_ENUM_CONSTANT(FEED_FRONT); @@ -145,7 +145,7 @@ CameraFeed::CameraFeed() { // create a texture object VisualServer *vs = VisualServer::get_singleton(); texture[CameraServer::FEED_Y_IMAGE] = vs->texture_create(); // also used for RGBA - texture[CameraServer::FEED_CbCr_IMAGE] = vs->texture_create(); + texture[CameraServer::FEED_CBCR_IMAGE] = vs->texture_create(); } CameraFeed::CameraFeed(String p_name, FeedPosition p_position) { @@ -162,14 +162,14 @@ CameraFeed::CameraFeed(String p_name, FeedPosition p_position) { // create a texture object VisualServer *vs = VisualServer::get_singleton(); texture[CameraServer::FEED_Y_IMAGE] = vs->texture_create(); // also used for RGBA - texture[CameraServer::FEED_CbCr_IMAGE] = vs->texture_create(); + texture[CameraServer::FEED_CBCR_IMAGE] = vs->texture_create(); } CameraFeed::~CameraFeed() { // Free our textures VisualServer *vs = VisualServer::get_singleton(); vs->free(texture[CameraServer::FEED_Y_IMAGE]); - vs->free(texture[CameraServer::FEED_CbCr_IMAGE]); + vs->free(texture[CameraServer::FEED_CBCR_IMAGE]); } void CameraFeed::set_RGB_img(Ref<Image> p_rgb_img) { @@ -208,7 +208,7 @@ void CameraFeed::set_YCbCr_img(Ref<Image> p_ycbcr_img) { } vs->texture_set_data(texture[CameraServer::FEED_RGBA_IMAGE], p_ycbcr_img); - datatype = CameraFeed::FEED_YCbCr; + datatype = CameraFeed::FEED_YCBCR; } } @@ -233,12 +233,12 @@ void CameraFeed::set_YCbCr_imgs(Ref<Image> p_y_img, Ref<Image> p_cbcr_img) { vs->texture_allocate(texture[CameraServer::FEED_Y_IMAGE], new_y_width, new_y_height, 0, Image::FORMAT_R8, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAG_USED_FOR_STREAMING); ///@TODO GLES2 doesn't support FORMAT_RG8, need to do some form of conversion - vs->texture_allocate(texture[CameraServer::FEED_CbCr_IMAGE], new_cbcr_width, new_cbcr_height, 0, Image::FORMAT_RG8, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAG_USED_FOR_STREAMING); + vs->texture_allocate(texture[CameraServer::FEED_CBCR_IMAGE], new_cbcr_width, new_cbcr_height, 0, Image::FORMAT_RG8, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAG_USED_FOR_STREAMING); } vs->texture_set_data(texture[CameraServer::FEED_Y_IMAGE], p_y_img); - vs->texture_set_data(texture[CameraServer::FEED_CbCr_IMAGE], p_cbcr_img); - datatype = CameraFeed::FEED_YCbCr_Sep; + vs->texture_set_data(texture[CameraServer::FEED_CBCR_IMAGE], p_cbcr_img); + datatype = CameraFeed::FEED_YCBCR_SEP; } } diff --git a/servers/camera/camera_feed.h b/servers/camera/camera_feed.h index 90c076071c..0c53ff9309 100644 --- a/servers/camera/camera_feed.h +++ b/servers/camera/camera_feed.h @@ -50,8 +50,8 @@ public: enum FeedDataType { FEED_NOIMAGE, // we don't have an image yet FEED_RGB, // our texture will contain a normal RGB texture that can be used directly - FEED_YCbCr, // our texture will contain a YCbCr texture that needs to be converted to RGB before output - FEED_YCbCr_Sep // our camera is split into two textures, first plane contains Y data, second plane contains CbCr data + FEED_YCBCR, // our texture will contain a YCbCr texture that needs to be converted to RGB before output + FEED_YCBCR_SEP // our camera is split into two textures, first plane contains Y data, second plane contains CbCr data }; enum FeedPosition { diff --git a/servers/camera_server.cpp b/servers/camera_server.cpp index 8d2ae37001..0f93221072 100644 --- a/servers/camera_server.cpp +++ b/servers/camera_server.cpp @@ -47,9 +47,9 @@ void CameraServer::_bind_methods() { ADD_SIGNAL(MethodInfo("camera_feed_removed", PropertyInfo(Variant::INT, "id"))); BIND_ENUM_CONSTANT(FEED_RGBA_IMAGE); - BIND_ENUM_CONSTANT(FEED_YCbCr_IMAGE); + BIND_ENUM_CONSTANT(FEED_YCBCR_IMAGE); BIND_ENUM_CONSTANT(FEED_Y_IMAGE); - BIND_ENUM_CONSTANT(FEED_CbCr_IMAGE); + BIND_ENUM_CONSTANT(FEED_CBCR_IMAGE); }; CameraServer *CameraServer::singleton = NULL; diff --git a/servers/camera_server.h b/servers/camera_server.h index d204142c7d..5a62af3d60 100644 --- a/servers/camera_server.h +++ b/servers/camera_server.h @@ -53,9 +53,9 @@ class CameraServer : public Object { public: enum FeedImage { FEED_RGBA_IMAGE = 0, - FEED_YCbCr_IMAGE = 0, + FEED_YCBCR_IMAGE = 0, FEED_Y_IMAGE = 0, - FEED_CbCr_IMAGE = 1, + FEED_CBCR_IMAGE = 1, FEED_IMAGES = 2 }; |