Skip to content

Commit

Permalink
Merge branch 'master' into wip/16bit-shader-conversions2
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Jan 21, 2025
2 parents 448e927 + a355a4d commit be43820
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/accelerator/ogl/image/image_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@ struct image_kernel::impl
// Setup shader
shader_->use();

shader_->set("is_straight_alpha", params.pix_desc.is_straight);

shader_->set("is_straight_alpha", params.pix_desc.is_straight_alpha);
shader_->set("plane[0]", texture_id::plane0);
shader_->set("plane[1]", texture_id::plane1);
shader_->set("plane[2]", texture_id::plane2);
Expand Down
4 changes: 2 additions & 2 deletions src/core/frame/pixel_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ struct pixel_format_desc final
{
}

pixel_format format = pixel_format::invalid;
bool is_straight = false;
pixel_format format = pixel_format::invalid;
bool is_straight_alpha = false;
std::vector<plane> planes;
core::color_space color_space = core::color_space::bt709;
};
Expand Down
2 changes: 1 addition & 1 deletion src/modules/image/producer/image_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct image_producer : public core::frame_producer
void load(const loaded_image& image, core::frame_geometry::scale_mode scale_mode)
{
core::pixel_format_desc desc(image.format);
desc.is_straight = image.is_straight;
desc.is_straight_alpha = image.is_straight;
desc.planes.emplace_back(
FreeImage_GetWidth(image.bitmap.get()), FreeImage_GetHeight(image.bitmap.get()), image.stride, image.depth);

Expand Down
12 changes: 6 additions & 6 deletions src/modules/image/producer/image_scroll_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ struct image_scroll_producer : public core::frame_producer
if (end_time_)
speed = -1.0;

auto bitmap = load_image(filename_, false);
FreeImage_FlipVertical(bitmap.bitmap.get());
auto image = load_image(filename_, false);
FreeImage_FlipVertical(image.bitmap.get());

width_ = FreeImage_GetWidth(bitmap.bitmap.get());
height_ = FreeImage_GetHeight(bitmap.bitmap.get());
width_ = FreeImage_GetWidth(image.bitmap.get());
height_ = FreeImage_GetHeight(image.bitmap.get());

bool vertical = width_ == format_desc_.width;
bool horizontal = height_ == format_desc_.height;
Expand All @@ -170,7 +170,7 @@ struct image_scroll_producer : public core::frame_producer

speed_ = speed_tweener(speed, speed, 0, tweener(L"linear"));

auto bytes = FreeImage_GetBits(bitmap.bitmap.get());
auto bytes = FreeImage_GetBits(image.bitmap.get());
auto count = width_ * height_ * 4;
image_view<bgra_pixel> original_view(bytes, width_, height_);

Expand All @@ -194,7 +194,7 @@ struct image_scroll_producer : public core::frame_producer
caspar::tweener blur_tweener(L"easeInQuad");
blur(original_view, blurred_view, angle, motion_blur_px, blur_tweener);
bytes = blurred_copy.get();
bitmap.bitmap.reset();
image.bitmap.reset();
}

if (vertical) {
Expand Down
3 changes: 2 additions & 1 deletion src/modules/image/util/image_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct loaded_image

loaded_image load_image(const std::wstring& filename, bool allow_all_formats);
loaded_image load_png_from_memory(const void* memory_location, size_t size, bool allow_all_formats);
bool is_valid_file(const boost::filesystem::path& filename);

bool is_valid_file(const boost::filesystem::path& filename);

}} // namespace caspar::image

0 comments on commit be43820

Please sign in to comment.