Добавление квалификатора const для запрета изменения указаелей внутри функций
This commit is contained in:
parent
610756ffed
commit
e6ac9023ec
24 changed files with 951 additions and 951 deletions
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
// ==================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_affine3_reset(BGC_FP32_Affine3 * affine)
|
||||
inline void bgc_fp32_affine3_reset(BGC_FP32_Affine3* const affine)
|
||||
{
|
||||
bgc_fp32_matrix3x3_make_identity(&affine->distortion);
|
||||
bgc_fp32_vector3_reset(&affine->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_reset(BGC_FP64_Affine3 * affine)
|
||||
inline void bgc_fp64_affine3_reset(BGC_FP64_Affine3* const affine)
|
||||
{
|
||||
bgc_fp64_matrix3x3_make_identity(&affine->distortion);
|
||||
bgc_fp64_vector3_reset(&affine->shift);
|
||||
|
|
@ -21,13 +21,13 @@ inline void bgc_fp64_affine3_reset(BGC_FP64_Affine3 * affine)
|
|||
|
||||
// ==================== Make ===================== //
|
||||
|
||||
inline void bgc_fp32_affine3_make(BGC_FP32_Affine3* affine, const BGC_FP32_Matrix3x3 * distortion, const BGC_FP32_Vector3 * shift)
|
||||
inline void bgc_fp32_affine3_make(BGC_FP32_Affine3* const affine, const BGC_FP32_Matrix3x3* const distortion, const BGC_FP32_Vector3* const shift)
|
||||
{
|
||||
bgc_fp32_matrix3x3_copy(&affine->distortion, distortion);
|
||||
bgc_fp32_vector3_copy(&affine->shift, shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_make(BGC_FP64_Affine3* affine, const BGC_FP64_Matrix3x3 * distortion, const BGC_FP64_Vector3 * shift)
|
||||
inline void bgc_fp64_affine3_make(BGC_FP64_Affine3* const affine, const BGC_FP64_Matrix3x3* const distortion, const BGC_FP64_Vector3* const shift)
|
||||
{
|
||||
bgc_fp64_matrix3x3_copy(&affine->distortion, distortion);
|
||||
bgc_fp64_vector3_copy(&affine->shift, shift);
|
||||
|
|
@ -35,13 +35,13 @@ inline void bgc_fp64_affine3_make(BGC_FP64_Affine3* affine, const BGC_FP64_Matri
|
|||
|
||||
// ==================== Copy ===================== //
|
||||
|
||||
inline void bgc_fp32_affine3_copy(BGC_FP32_Affine3* destination, const BGC_FP32_Affine3 * source)
|
||||
inline void bgc_fp32_affine3_copy(BGC_FP32_Affine3* const destination, const BGC_FP32_Affine3* const source)
|
||||
{
|
||||
bgc_fp32_matrix3x3_copy(&destination->distortion, &source->distortion);
|
||||
bgc_fp32_vector3_copy(&destination->shift, &source->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_copy(BGC_FP64_Affine3* destination, const BGC_FP64_Affine3 * source)
|
||||
inline void bgc_fp64_affine3_copy(BGC_FP64_Affine3* const destination, const BGC_FP64_Affine3* const source)
|
||||
{
|
||||
bgc_fp64_matrix3x3_copy(&destination->distortion, &source->distortion);
|
||||
bgc_fp64_vector3_copy(&destination->shift, &source->shift);
|
||||
|
|
@ -49,13 +49,13 @@ inline void bgc_fp64_affine3_copy(BGC_FP64_Affine3* destination, const BGC_FP64_
|
|||
|
||||
// ==================== Swap ===================== //
|
||||
|
||||
inline void bgc_fp32_affine3_swap(BGC_FP32_Affine3 * first, BGC_FP32_Affine3 * second)
|
||||
inline void bgc_fp32_affine3_swap(BGC_FP32_Affine3* const first, BGC_FP32_Affine3* const second)
|
||||
{
|
||||
bgc_fp32_matrix3x3_swap(&first->distortion, &second->distortion);
|
||||
bgc_fp32_vector3_swap(&first->shift, &second->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_swap(BGC_FP64_Affine3 * first, BGC_FP64_Affine3 * second)
|
||||
inline void bgc_fp64_affine3_swap(BGC_FP64_Affine3* const first, BGC_FP64_Affine3* const second)
|
||||
{
|
||||
bgc_fp64_matrix3x3_swap(&first->distortion, &second->distortion);
|
||||
bgc_fp64_vector3_swap(&first->shift, &second->shift);
|
||||
|
|
@ -63,13 +63,13 @@ inline void bgc_fp64_affine3_swap(BGC_FP64_Affine3 * first, BGC_FP64_Affine3 * s
|
|||
|
||||
// =================== Convert =================== //
|
||||
|
||||
inline void bgc_fp32_affine3_convert_to_fp64(BGC_FP64_Affine3* destination, const BGC_FP32_Affine3 * source)
|
||||
inline void bgc_fp32_affine3_convert_to_fp64(BGC_FP64_Affine3* const destination, const BGC_FP32_Affine3* const source)
|
||||
{
|
||||
bgc_fp32_matrix3x3_convert_to_fp64(&destination->distortion, &source->distortion);
|
||||
bgc_fp32_vector3_convert_to_fp64(&destination->shift, &source->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_convert_to_fp32(BGC_FP32_Affine3* destination, const BGC_FP64_Affine3* source)
|
||||
inline void bgc_fp64_affine3_convert_to_fp32(BGC_FP32_Affine3* const destination, const BGC_FP64_Affine3* const source)
|
||||
{
|
||||
bgc_fp64_matrix3x3_convert_to_fp32(&destination->distortion, &source->distortion);
|
||||
bgc_fp64_vector3_convert_to_fp32(&destination->shift, &source->shift);
|
||||
|
|
@ -77,7 +77,7 @@ inline void bgc_fp64_affine3_convert_to_fp32(BGC_FP32_Affine3* destination, cons
|
|||
|
||||
// =================== Invert ==================== //
|
||||
|
||||
inline int bgc_fp32_affine3_invert(BGC_FP32_Affine3 * affine)
|
||||
inline int bgc_fp32_affine3_invert(BGC_FP32_Affine3* const affine)
|
||||
{
|
||||
if (bgc_fp32_matrix3x3_invert(&affine->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -89,7 +89,7 @@ inline int bgc_fp32_affine3_invert(BGC_FP32_Affine3 * affine)
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_affine3_invert(BGC_FP64_Affine3 * affine)
|
||||
inline int bgc_fp64_affine3_invert(BGC_FP64_Affine3* const affine)
|
||||
{
|
||||
if (bgc_fp64_matrix3x3_invert(&affine->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -103,7 +103,7 @@ inline int bgc_fp64_affine3_invert(BGC_FP64_Affine3 * affine)
|
|||
|
||||
// ================= Get Inverse ================= //
|
||||
|
||||
inline int bgc_fp32_affine3_get_inverse(BGC_FP32_Affine3* destination, const BGC_FP32_Affine3 * source)
|
||||
inline int bgc_fp32_affine3_get_inverse(BGC_FP32_Affine3* const destination, const BGC_FP32_Affine3* const source)
|
||||
{
|
||||
if (bgc_fp32_matrix3x3_get_inverse(&destination->distortion, &source->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -115,7 +115,7 @@ inline int bgc_fp32_affine3_get_inverse(BGC_FP32_Affine3* destination, const BGC
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_affine3_get_inverse(BGC_FP64_Affine3* destination, const BGC_FP64_Affine3 * source)
|
||||
inline int bgc_fp64_affine3_get_inverse(BGC_FP64_Affine3* const destination, const BGC_FP64_Affine3* const source)
|
||||
{
|
||||
if (bgc_fp64_matrix3x3_get_inverse(&destination->distortion, &source->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -129,7 +129,7 @@ inline int bgc_fp64_affine3_get_inverse(BGC_FP64_Affine3* destination, const BGC
|
|||
|
||||
// =================== Combine =================== //
|
||||
|
||||
inline void bgc_fp32_affine3_combine(BGC_FP32_Affine3* combination, const BGC_FP32_Affine3 * first, const BGC_FP32_Affine3 * second)
|
||||
inline void bgc_fp32_affine3_combine(BGC_FP32_Affine3* const combination, const BGC_FP32_Affine3* const first, const BGC_FP32_Affine3* const second)
|
||||
{
|
||||
BGC_FP32_Vector3 first_shift;
|
||||
bgc_fp32_matrix3x3_multiply_by_vector3(&first_shift, &second->distortion, &first->shift);
|
||||
|
|
@ -137,7 +137,7 @@ inline void bgc_fp32_affine3_combine(BGC_FP32_Affine3* combination, const BGC_FP
|
|||
bgc_fp32_vector3_add(&combination->shift, &first_shift, &second->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_combine(BGC_FP64_Affine3* combination, const BGC_FP64_Affine3 * first, const BGC_FP64_Affine3 * second)
|
||||
inline void bgc_fp64_affine3_combine(BGC_FP64_Affine3* const combination, const BGC_FP64_Affine3* const first, const BGC_FP64_Affine3* const second)
|
||||
{
|
||||
BGC_FP64_Vector3 first_shift;
|
||||
bgc_fp64_matrix3x3_multiply_by_vector3(&first_shift, &second->distortion, &first->shift);
|
||||
|
|
@ -147,14 +147,14 @@ inline void bgc_fp64_affine3_combine(BGC_FP64_Affine3* combination, const BGC_FP
|
|||
|
||||
// =============== Transform Point =============== //
|
||||
|
||||
inline void bgc_fp32_affine3_transform_point(BGC_FP32_Vector3* transformed_point, const BGC_FP32_Affine3 * affine, const BGC_FP32_Vector3 * initial_point)
|
||||
inline void bgc_fp32_affine3_transform_point(BGC_FP32_Vector3* const transformed_point, const BGC_FP32_Affine3* const affine, const BGC_FP32_Vector3* const initial_point)
|
||||
{
|
||||
BGC_FP32_Vector3 distorted;
|
||||
bgc_fp32_matrix3x3_multiply_by_vector3(&distorted, &affine->distortion, initial_point);
|
||||
bgc_fp32_vector3_add(transformed_point, &affine->shift, &distorted);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_transform_point(BGC_FP64_Vector3* transformed_point, const BGC_FP64_Affine3 * affine, const BGC_FP64_Vector3 * initial_point)
|
||||
inline void bgc_fp64_affine3_transform_point(BGC_FP64_Vector3* const transformed_point, const BGC_FP64_Affine3* const affine, const BGC_FP64_Vector3* const initial_point)
|
||||
{
|
||||
BGC_FP64_Vector3 distorted;
|
||||
bgc_fp64_matrix3x3_multiply_by_vector3(&distorted, &affine->distortion, initial_point);
|
||||
|
|
@ -163,12 +163,12 @@ inline void bgc_fp64_affine3_transform_point(BGC_FP64_Vector3* transformed_point
|
|||
|
||||
// ============== Transform Vector =============== //
|
||||
|
||||
inline void bgc_fp32_affine3_transform_vector(BGC_FP32_Vector3* transformed_vector, const BGC_FP32_Affine3 * affine, const BGC_FP32_Vector3 * initial_vector)
|
||||
inline void bgc_fp32_affine3_transform_vector(BGC_FP32_Vector3* const transformed_vector, const BGC_FP32_Affine3* const affine, const BGC_FP32_Vector3* const initial_vector)
|
||||
{
|
||||
bgc_fp32_matrix3x3_multiply_by_vector3(transformed_vector, &affine->distortion, initial_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_transform_vector(BGC_FP64_Vector3* transformed_vector, const BGC_FP64_Affine3 * affine, const BGC_FP64_Vector3 * initial_vector)
|
||||
inline void bgc_fp64_affine3_transform_vector(BGC_FP64_Vector3* const transformed_vector, const BGC_FP64_Affine3* const affine, const BGC_FP64_Vector3* const initial_vector)
|
||||
{
|
||||
bgc_fp64_matrix3x3_multiply_by_vector3(transformed_vector, &affine->distortion, initial_vector);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue