Skip to content

Commit

Permalink
guassian float filter bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
zpelgrims committed Aug 19, 2022
1 parent cc6917f commit d5889b9
Showing 1 changed file with 7 additions and 40 deletions.
47 changes: 7 additions & 40 deletions src/lentil_imager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ driver_process_bucket {

// all other AOVS
else {
// note, converting all to AtRGBA because the lentil_filter converts any type to AtRGBA.
switch (aov_current->type){
case AI_TYPE_RGBA: {

// note, converting all to AtRGBA because the lentil_filter converts any type to AtRGBA.
// switch (aov_current->type){
// case AI_TYPE_RGBA: {
if (aov_current->original_filter == camera_data->atstring_filter_gaussian){
AtRGBA image = aov_current->buffer[linear_pixel];

if (aov_current->name != camera_data->atstring_lentil_debug) {
Expand All @@ -175,48 +176,14 @@ driver_process_bucket {
}

((AtRGBA*)bucket_data)[in_idx] = image;

break;
}

case AI_TYPE_RGB: {
AtRGBA image = aov_current->buffer[linear_pixel];
if ((camera_data->filter_weight_buffer[linear_pixel] != 0.0)){
image /= camera_data->filter_weight_buffer[linear_pixel];
}

AtRGBA final_value = AtRGBA(image.r, image.g, image.b, 1.0);
((AtRGBA*)bucket_data)[in_idx] = final_value;
break;
}

case AI_TYPE_FLOAT: {
else if (aov_current->original_filter == camera_data->atstring_filter_closest){
((AtRGBA*)bucket_data)[in_idx] = AtRGBA(aov_current->buffer[linear_pixel].r,
aov_current->buffer[linear_pixel].r,
aov_current->buffer[linear_pixel].r,
aov_current->buffer[linear_pixel].g,
aov_current->buffer[linear_pixel].b,
1.0);
break;
}

case AI_TYPE_VECTOR: {
AtRGBA final_value (aov_current->buffer[linear_pixel].r,
aov_current->buffer[linear_pixel].g,
aov_current->buffer[linear_pixel].b,
1.0);
((AtRGBA*)bucket_data)[in_idx] = final_value;
break;
}

// case AI_TYPE_INT: {
// ((int*)bucket_data)[in_idx] = aov_current->buffer[linear_pixel].r;
// break;
// }

// case AI_TYPE_UINT: {
// ((unsigned int*)bucket_data)[in_idx] = std::abs(aov_current->buffer[linear_pixel].r);
// break;
// }
}
}
}
}
Expand Down

0 comments on commit d5889b9

Please sign in to comment.