This commit is contained in:
purplerain 2024-10-06 22:00:57 +00:00
parent 50c8bafd9f
commit ac06c97e30
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
820 changed files with 467502 additions and 386453 deletions

View file

@ -38,12 +38,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, 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 software; see the file COPYING.GPL. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
@ -60,9 +60,9 @@
#define SCALE 65535.0
#define HALF_SCALE (SCALE / 2)
typedef enum {
R_MAX_G_MIN, R_MAX_B_MIN,
G_MAX_B_MIN, G_MAX_R_MIN,
B_MAX_R_MIN, B_MAX_G_MIN
R_MAX_G_MIN, R_MAX_B_MIN,
G_MAX_B_MIN, G_MAX_R_MIN,
B_MAX_R_MIN, B_MAX_G_MIN
} MinMaxState;
@ -73,9 +73,9 @@ typedef enum {
/* FIXMS: This can probably be optimized more, examine later. */
static void
color_mult (unsigned short *red,
unsigned short *green,
static void
color_mult (unsigned short *red,
unsigned short *green,
unsigned short *blue, double k)
{
if (*red == *green && *red == *blue) {
@ -129,7 +129,7 @@ color_mult (unsigned short *red,
} else {
min = r;
min_max_state = G_MAX_R_MIN;
a = b - r;
a = b - r;
}
} else {
max = b;
@ -138,7 +138,7 @@ color_mult (unsigned short *red,
a = g - r;
}
}
delta = max - min;
a = a / delta;
@ -149,7 +149,7 @@ color_mult (unsigned short *red,
s = 2.0 * SCALE - (max + min);
}
s = delta/s;
l *= k;
if (l > SCALE) {
l = SCALE;
@ -162,7 +162,7 @@ color_mult (unsigned short *red,
if (l <= HALF_SCALE) {
max = l * (1 + s);
} else {
max = s * SCALE + l - s * l;
max = s * SCALE + l - s * l;
}
min = 2 * l - max;
@ -204,7 +204,7 @@ color_mult (unsigned short *red,
*red = (unsigned short) r;
*green = (unsigned short) g;
*blue = (unsigned short) b;
*blue = (unsigned short) b;
}
}