X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcicolors.C;h=0d46ff06b91d502c29039d414b28280583efc69f;hp=a465b6a0005366325e09e16464523043c376157c;hb=21c2e6b36d6a96c2f662a89459d607b5a387f4eb;hpb=5a1b2bb96f2bd6b7ef4f8031763683726c02219d;ds=sidebyside diff --git a/cinelerra-5.1/cinelerra/cicolors.C b/cinelerra-5.1/cinelerra/cicolors.C index a465b6a0..0d46ff06 100644 --- a/cinelerra-5.1/cinelerra/cicolors.C +++ b/cinelerra-5.1/cinelerra/cicolors.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "cicolors.h" @@ -39,7 +39,7 @@ int HSV::rgb_to_hsv(float r, float g, float b, float &h, float &s, float &v) float min, max, delta; min = ((r < g) ? r : g) < b ? ((r < g) ? r : g) : b; max = ((r > g) ? r : g) > b ? ((r > g) ? r : g) : b; - v = max; + v = max; delta = max - min; @@ -49,7 +49,7 @@ int HSV::rgb_to_hsv(float r, float g, float b, float &h, float &s, float &v) if(r == max) h = (g - b) / delta; // between yellow & magenta - else + else if(g == max) h = 2 + (b - r) / delta; // between cyan & yellow else @@ -59,13 +59,13 @@ int HSV::rgb_to_hsv(float r, float g, float b, float &h, float &s, float &v) if(h < 0) h += 360; } - else + else { // r = g = b = 0 // s = 0, v is undefined s = 0; h = -1; } - + return 0; } @@ -73,7 +73,7 @@ int HSV::hsv_to_rgb(float &r, float &g, float &b, float h, float s, float v) { int i; float f, p, q, t; - if(s == 0) + if(s == 0) { // achromatic (grey) r = g = b = v; @@ -87,7 +87,7 @@ int HSV::hsv_to_rgb(float &r, float &g, float &b, float h, float s, float v) q = v * (1 - s * f); t = v * (1 - s * (1 - f)); - switch(i) + switch(i) { case 0: r = v;