mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	Converting the LCMS2 transform to a 3D LUT early causes issues: - It's a lossy process, the consumer will not be able to pick a 3D LUT size on their own. - It requires unnecessary conversions and allocations: an intermediate 3D LUT is allocated, but the renderer already allocates one. - It makes it harder to support arbitrary color transforms in the renderer, because each type needs to be handled differently. Instead, expose a function to evaluate a color transform, and use that to build the 3D LUT in the renderer.
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			682 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			682 B
		
	
	
	
		
			C
		
	
	
	
	
	
#include <stdlib.h>
 | 
						|
#include <wlr/util/log.h>
 | 
						|
#include "render/color.h"
 | 
						|
 | 
						|
struct wlr_color_transform *wlr_color_transform_init_linear_to_icc(
 | 
						|
		const void *data, size_t size) {
 | 
						|
	wlr_log(WLR_ERROR, "Cannot create color transform from ICC profile: "
 | 
						|
		"LCMS2 is compile-time disabled");
 | 
						|
	return NULL;
 | 
						|
}
 | 
						|
 | 
						|
struct wlr_color_transform_lcms2 *color_transform_lcms2_from_base(
 | 
						|
		struct wlr_color_transform *tr) {
 | 
						|
	abort(); // unreachable
 | 
						|
}
 | 
						|
 | 
						|
void color_transform_lcms2_finish(struct wlr_color_transform_lcms2 *tr) {
 | 
						|
	abort(); // unreachable
 | 
						|
}
 | 
						|
 | 
						|
void color_transform_lcms2_eval(struct wlr_color_transform_lcms2 *tr,
 | 
						|
		float out[static 3], const float in[static 3]) {
 | 
						|
	abort(); // unreachable
 | 
						|
}
 |