Skip to content

Commit

Permalink
temp commit
Browse files Browse the repository at this point in the history
Co-authored-by: David Lechner <[email protected]>
  • Loading branch information
Novakasa and dlech authored Sep 5, 2022
1 parent 3b7e902 commit 14c82b6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/pbio/src/color/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int32_t sin_deg_branch0(int32_t x) {
}

// integer sine approximation from degrees to (-10000, 10000)
int32_t sin_deg(int32_t x) {
static int32_t sin_deg(int32_t x) {
x = x % 360;
if (x < 90) {
return sin_deg_branch0(x);
Expand All @@ -22,11 +22,16 @@ int32_t sin_deg(int32_t x) {
return -sin_deg_branch0(360 - x);
}

int32_t cos_deg(int32_t x) {
static int32_t cos_deg(int32_t x) {
return sin_deg(x + 90);
}

// gets squared cartesian distance between hsv colors mapped into a chroma-lightness-bicone
/**
* Gets squared Cartesian distance between HSV colors mapped into a chroma-lightness-bicone.
* @param [in] hsv_a The first HSV color.
* @param [in] hsv_b The second HSV color.
* @returns This distance (0 to ???).
*/
int32_t pbio_get_bicone_cost(const pbio_color_hsv_t *hsv_a, const pbio_color_hsv_t *hsv_b) {

int32_t a_h = hsv_a->h;
Expand Down

0 comments on commit 14c82b6

Please sign in to comment.