mirror of
https://github.com/scrtwpns/mixbox.git
synced 2026-03-19 14:39:27 +01:00
update mixbox
This commit is contained in:
87729
mixbox.cpp
87729
mixbox.cpp
File diff suppressed because it is too large
Load Diff
124
mixbox.h
124
mixbox.h
@@ -1,35 +1,89 @@
|
|||||||
// MIXBOX v1.2 (c) 2022 Secret Weapons
|
// ==========================================================
|
||||||
// This is for non-commercial use only.
|
// MIXBOX 2.0 (c) 2022 Secret Weapons. All rights reserved.
|
||||||
// Contact: mixbox@scrtwpns.com
|
// License: Creative Commons Attribution-NonCommercial 4.0
|
||||||
|
// Authors: Sarka Sochorova and Ondrej Jamriska
|
||||||
#ifndef MIXBOX_H_
|
// ==========================================================
|
||||||
#define MIXBOX_H_
|
//
|
||||||
|
// BASIC USAGE
|
||||||
#define MIXBOX_NUMLATENTS 7
|
//
|
||||||
|
// mixbox_lerp(r1, g1, b1, // 1st color
|
||||||
void mixbox_lerp_srgb8(unsigned char r1,unsigned char g1,unsigned char b1,
|
// r2, g2, b2, // 2nd color
|
||||||
unsigned char r2,unsigned char g2,unsigned char b2,
|
// t, // mixing ratio
|
||||||
float t,
|
// &r, &g, &b); // result
|
||||||
unsigned char* out_r,unsigned char* out_g,unsigned char* out_b);
|
//
|
||||||
|
// MULTI-COLOR MIXING
|
||||||
void mixbox_lerp_srgb32f(float r1,float g1,float b1,
|
//
|
||||||
float r2,float g2,float b2,
|
// mixbox_latent z1, z2, z3, z_mix;
|
||||||
float t,
|
// mixbox_rgb_to_latent(r1, g1, b1, z1);
|
||||||
float* out_r,float* out_g,float* out_b);
|
// mixbox_rgb_to_latent(r2, g2, b2, z2);
|
||||||
|
// mixbox_rgb_to_latent(r3, g3, b3, z3);
|
||||||
void mixbox_srgb8_to_latent(unsigned char r,unsigned char g,unsigned char b,float* out_latent);
|
//
|
||||||
void mixbox_latent_to_srgb8(float* latent,unsigned char* out_r,unsigned char* out_g,unsigned char* out_b);
|
// for (int i = 0; i < MIXBOX_LATENT_SIZE; i++) {
|
||||||
|
// // mix 30% of rgb1, 60% of rgb2, and 10% of rgb3
|
||||||
void mixbox_srgb32f_to_latent(float r,float g,float b,float* out_latent);
|
// z_mix[i] = 0.3f*z1[i] + 0.6f*z2[i] + 0.1f*z3[i];
|
||||||
void mixbox_latent_to_srgb32f(float* latent,float* out_r,float* out_g,float* out_b);
|
// }
|
||||||
|
//
|
||||||
|
// mixbox_latent_to_rgb(z_mix, &r, &g, &b);
|
||||||
void mixbox_lerp_srgb8_dither(unsigned char r1,unsigned char g1,unsigned char b1,
|
//
|
||||||
unsigned char r2,unsigned char g2,unsigned char b2,
|
// PIGMENT COLORS
|
||||||
float t,
|
//
|
||||||
float dither_r,float dither_g,float dither_b,
|
// Cadmium Yellow 254, 236, 0
|
||||||
unsigned char* out_r,unsigned char* out_g,unsigned char* out_b);
|
// Hansa Yellow 252, 211, 0
|
||||||
|
// Cadmium Orange 255, 105, 0
|
||||||
void mixbox_latent_to_srgb8_dither(float* latent,float dither_r,float dither_g,float dither_b,unsigned char* out_r,unsigned char* out_g,unsigned char* out_b);
|
// Cadmium Red 255, 39, 2
|
||||||
|
// Quinacridone Magenta 128, 2, 46
|
||||||
#endif
|
// Cobalt Violet 78, 0, 66
|
||||||
|
// Ultramarine Blue 25, 0, 89
|
||||||
|
// Cobalt Blue 0, 33, 133
|
||||||
|
// Phthalo Blue 13, 27, 68
|
||||||
|
// Phthalo Green 0, 60, 50
|
||||||
|
// Permanent Green 7, 109, 22
|
||||||
|
// Sap Green 107, 148, 4
|
||||||
|
// Burnt Sienna 123, 72, 0
|
||||||
|
//
|
||||||
|
// LICENSING
|
||||||
|
//
|
||||||
|
// If you want to obtain commercial license, please
|
||||||
|
// contact us at: mixbox@scrtwpns.com
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef MIXBOX_H_
|
||||||
|
#define MIXBOX_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MIXBOX_LATENT_SIZE 7
|
||||||
|
|
||||||
|
typedef float mixbox_latent[MIXBOX_LATENT_SIZE];
|
||||||
|
|
||||||
|
void mixbox_lerp(unsigned char r1, unsigned char g1, unsigned char b1,
|
||||||
|
unsigned char r2, unsigned char g2, unsigned char b2,
|
||||||
|
float t,
|
||||||
|
unsigned char* out_r, unsigned char* out_g, unsigned char* out_b);
|
||||||
|
|
||||||
|
void mixbox_lerp_float(float r1, float g1, float b1,
|
||||||
|
float r2, float g2, float b2,
|
||||||
|
float t,
|
||||||
|
float* out_r, float* out_g, float* out_b);
|
||||||
|
|
||||||
|
void mixbox_lerp_linear_float(float r1, float g1, float b1,
|
||||||
|
float r2, float g2, float b2,
|
||||||
|
float t,
|
||||||
|
float* out_r, float* out_g, float* out_b);
|
||||||
|
|
||||||
|
void mixbox_rgb_to_latent(unsigned char r, unsigned char g, unsigned char b, mixbox_latent out_latent);
|
||||||
|
void mixbox_latent_to_rgb(mixbox_latent latent, unsigned char* out_r, unsigned char* out_g, unsigned char* out_b);
|
||||||
|
|
||||||
|
void mixbox_float_rgb_to_latent(float r, float g, float b, mixbox_latent out_latent);
|
||||||
|
void mixbox_latent_to_float_rgb(mixbox_latent latent, float* out_r, float* out_g, float* out_b);
|
||||||
|
|
||||||
|
void mixbox_linear_float_rgb_to_latent(float r, float g, float b, mixbox_latent out_latent);
|
||||||
|
void mixbox_latent_to_linear_float_rgb(mixbox_latent latent, float* out_r, float* out_g, float* out_b);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
BIN
mixbox_lut.png
BIN
mixbox_lut.png
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 MiB After Width: | Height: | Size: 172 KiB |
Reference in New Issue
Block a user