commit f92eddb90dbe15af14c4b66237397f92470496f4
parent 3772c7280d41f20f28d6c6553eb0d58abeafa7d6
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 21 Feb 2019 15:09:09 +0100
Fix the function names of the scene analysis API
Match the Stardis API naming convention and fix misspelings.
Diffstat:
3 files changed, 30 insertions(+), 34 deletions(-)
diff --git a/src/sdis.h b/src/sdis.h
@@ -619,22 +619,22 @@ sdis_scene_boundary_project_position
const double pos[3],
double uv[]);
-/* Get the descriptor of the 2D scene's enclosures */
+/* Get the descriptor of the 3D scene's enclosures */
SDIS_API res_T
-sdis_get_scene_2d_analyze
+sdis_scene_get_analysis
(struct sdis_scene* scn,
- struct senc2d_descriptor** descriptor);
+ struct senc_descriptor** descriptor);
-/* Get the descriptor of the 3D scene's enclosures */
+/* Get the descriptor of the 2D scene's enclosures */
SDIS_API res_T
-sdis_get_scene_analyze
+sdis_scene_2d_get_analysis
(struct sdis_scene* scn,
- struct senc_descriptor** descriptor);
+ struct senc2d_descriptor** descriptor);
/* Release the descriptor of the scene's enclosures; subsequent attempts to get
* it will fail. */
SDIS_API res_T
-sdis_release_scene_analyze
+sdis_scene_release_analysis
(struct sdis_scene* scn);
SDIS_API res_T
diff --git a/src/sdis_scene.c b/src/sdis_scene.c
@@ -276,7 +276,7 @@ sdis_scene_boundary_project_position
}
res_T
-sdis_get_scene_2d_analyze
+sdis_scene_2d_get_analysis
(struct sdis_scene* scn,
struct senc2d_descriptor** descriptor)
{
@@ -288,7 +288,7 @@ sdis_get_scene_2d_analyze
}
res_T
-sdis_get_scene_analyze
+sdis_scene_get_analysis
(struct sdis_scene* scn,
struct senc_descriptor** descriptor)
{
@@ -300,13 +300,11 @@ sdis_get_scene_analyze
}
res_T
-sdis_release_scene_analyze(struct sdis_scene* scn)
+sdis_scene_release_analysis(struct sdis_scene* scn)
{
if(!scn) return RES_BAD_ARG;
- if(scn->senc2d_descriptor)
- SENC2D(descriptor_ref_put(scn->senc2d_descriptor));
- if(scn->senc_descriptor)
- SENC(descriptor_ref_put(scn->senc_descriptor));
+ if(scn->senc2d_descriptor) SENC2D(descriptor_ref_put(scn->senc2d_descriptor));
+ if(scn->senc_descriptor) SENC(descriptor_ref_put(scn->senc_descriptor));
scn->senc_descriptor = NULL;
scn->senc2d_descriptor = NULL;
return RES_OK;
diff --git a/src/test_sdis_scene.c b/src/test_sdis_scene.c
@@ -172,19 +172,19 @@ test_scene_3d(struct sdis_device* dev, struct sdis_interface* interf)
OK(sdis_scene_get_boundary_position(scn, 6, uv1, pos1));
CHK(!d3_eq_eps(pos1, pos, 1.e-6));
- BA(sdis_get_scene_analyze(NULL, NULL));
- BA(sdis_get_scene_analyze(scn, NULL));
- BA(sdis_get_scene_analyze(NULL, &descriptor));
- OK(sdis_get_scene_analyze(scn, &descriptor));
+ BA(sdis_scene_get_analysis(NULL, NULL));
+ BA(sdis_scene_get_analysis(scn, NULL));
+ BA(sdis_scene_get_analysis(NULL, &descriptor));
+ OK(sdis_scene_get_analysis(scn, &descriptor));
OK(senc_descriptor_ref_put(descriptor));
/* No 2D available */
- BA(sdis_get_scene_2d_analyze(scn, &descriptor2d));
- BA(sdis_release_scene_analyze(NULL));
- OK(sdis_release_scene_analyze(scn));
+ BA(sdis_scene_2d_get_analysis(scn, &descriptor2d));
+ BA(sdis_scene_release_analysis(NULL));
+ OK(sdis_scene_release_analysis(scn));
/* Already released */
- OK(sdis_release_scene_analyze(scn));
+ OK(sdis_scene_release_analysis(scn));
/* Descriptor released: cannot get it anymore */
- BA(sdis_get_scene_analyze(scn, &descriptor));
+ BA(sdis_scene_get_analysis(scn, &descriptor));
BA(sdis_scene_ref_get(NULL));
OK(sdis_scene_ref_get(scn));
@@ -280,21 +280,19 @@ test_scene_2d(struct sdis_device* dev, struct sdis_interface* interf)
OK(sdis_scene_boundary_project_position(scn, 3, pos, &u0));
CHK(eq_eps(u0, 1, 1.e-6));
- BA(sdis_get_scene_2d_analyze(NULL, NULL));
- BA(sdis_get_scene_2d_analyze(scn, NULL));
- BA(sdis_get_scene_2d_analyze(NULL, &descriptor));
- OK(sdis_get_scene_2d_analyze(scn, &descriptor));
+ BA(sdis_scene_2d_get_analysis(NULL, NULL));
+ BA(sdis_scene_2d_get_analysis(scn, NULL));
+ BA(sdis_scene_2d_get_analysis(NULL, &descriptor));
+ OK(sdis_scene_2d_get_analysis(scn, &descriptor));
OK(senc2d_descriptor_ref_put(descriptor));
/* No 3D available */
- BA(sdis_get_scene_analyze(scn, &descriptor3d));
- BA(sdis_release_scene_analyze(NULL));
- OK(sdis_release_scene_analyze(scn));
- /* Allready released */
- BA(sdis_release_scene_analyze(scn));
+ BA(sdis_scene_get_analysis(scn, &descriptor3d));
+ BA(sdis_scene_release_analysis(NULL));
+ OK(sdis_scene_release_analysis(scn));
/* Already released */
- OK(sdis_release_scene_analyze(scn));
+ OK(sdis_scene_release_analysis(scn));
/* Descriptor released: cannot get it anymore */
- BA(sdis_get_scene_2d_analyze(scn, &descriptor));
+ BA(sdis_scene_2d_get_analysis(scn, &descriptor));
OK(sdis_scene_ref_put(scn));
}