Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-05-07 18:31:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-07 18:51:40 +0300
commitf74d85ffc8232a859b1419f5dc25b244ae04375f (patch)
treef74928d7681488c044ea65249eaaa5b6900d246b /source/blender/alembic
parent905eeb0bc7f46efb95cb5450cc6c2ec27f02730c (diff)
Cleanup: rename char/float conversion functions
- FTOCHAR -> unit_float_to_uchar_clamp - F3TOCHAR3 -> unit_float_to_uchar_clamp_v3 (swap args) - F4TOCHAR4 -> unit_float_to_uchar_clamp_v4 (swap args) - FTOUSHORT -> unit_float_to_ushort_clamp - USHORTTOUCHAR -> unit_ushort_to_uchar
Diffstat (limited to 'source/blender/alembic')
-rw-r--r--source/blender/alembic/intern/abc_customdata.cc14
-rw-r--r--source/blender/alembic/intern/abc_mesh.cc2
2 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/alembic/intern/abc_customdata.cc b/source/blender/alembic/intern/abc_customdata.cc
index 3b6c87ea1a0..b98d82f0c7d 100644
--- a/source/blender/alembic/intern/abc_customdata.cc
+++ b/source/blender/alembic/intern/abc_customdata.cc
@@ -362,9 +362,9 @@ static void read_custom_data_mcols(const std::string & iobject_full_name,
bounds_warning_given);
const Imath::C3f &color = (*c3f_ptr)[color_index];
- cface->a = FTOCHAR(color[0]);
- cface->r = FTOCHAR(color[1]);
- cface->g = FTOCHAR(color[2]);
+ cface->a = unit_float_to_uchar_clamp(color[0]);
+ cface->r = unit_float_to_uchar_clamp(color[1]);
+ cface->g = unit_float_to_uchar_clamp(color[2]);
cface->b = 255;
}
else {
@@ -375,10 +375,10 @@ static void read_custom_data_mcols(const std::string & iobject_full_name,
bounds_warning_given);
const Imath::C4f &color = (*c4f_ptr)[color_index];
- cface->a = FTOCHAR(color[0]);
- cface->r = FTOCHAR(color[1]);
- cface->g = FTOCHAR(color[2]);
- cface->b = FTOCHAR(color[3]);
+ cface->a = unit_float_to_uchar_clamp(color[0]);
+ cface->r = unit_float_to_uchar_clamp(color[1]);
+ cface->g = unit_float_to_uchar_clamp(color[2]);
+ cface->b = unit_float_to_uchar_clamp(color[3]);
}
}
}
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index 90e95542a9a..ef0a823ac3e 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -1331,7 +1331,7 @@ void AbcSubDReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelec
MEdge *edge = find_edge(edges, mesh->totedge, (*indices)[i], (*indices)[i + 1]);
if (edge) {
- edge->crease = FTOCHAR((*sharpnesses)[s]);
+ edge->crease = unit_float_to_uchar_clamp((*sharpnesses)[s]);
}
}