Skip to content

Commit

Permalink
Correct handling IOP_CS_RAW colorspace conversions
Browse files Browse the repository at this point in the history
For non-raw images we can simply avoid the IOP_CS_RGB to IOP_CS_RAW colorspace conversions
completely. This avoids
- stupid fallbacks to CPU code if running OpenCL
- costly copy of data
  • Loading branch information
jenshannoschwalm authored and TurboGit committed Jul 8, 2024
1 parent 145a07d commit b6f5041
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/common/iop_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,10 @@ static inline void _transform_matrix(struct dt_iop_module_t *self,
{
_transform_lab_to_rgb_matrix(image_in, image_out, width, height, profile_info);
}
else if(cst_from == IOP_CS_RGB && cst_to == IOP_CS_RAW)
{
*converted_cst = cst_from;
}
else
{
*converted_cst = cst_from;
Expand Down Expand Up @@ -1186,6 +1190,11 @@ void dt_ioppr_transform_image_colorspace
*converted_cst = cst_from;
return;
}
if(cst_from == IOP_CS_RGB && cst_to == IOP_CS_RAW)
{
*converted_cst = cst_from;
return ;
}

dt_times_t start_time = { 0 };
dt_get_perf_times(&start_time);
Expand Down Expand Up @@ -1453,6 +1462,11 @@ gboolean dt_ioppr_transform_image_colorspace_cl
*converted_cst = cst_from;
return TRUE;
}
if(cst_from == IOP_CS_RGB && cst_to == IOP_CS_RAW)
{
*converted_cst = cst_from;
return TRUE;
}

const size_t ch = 4;
float *src_buffer = NULL;
Expand Down

0 comments on commit b6f5041

Please sign in to comment.