diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-26 20:01:43 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-26 20:01:43 +0000 |
| commit | bb969a0e8c27382688583554edc559bcebbca8c9 (patch) | |
| tree | f4b816b8f8db74abb98f66f48cd201f43b9a22b9 /src/lib | |
| parent | 563bd26ef4bfbbbd587e4c69e700f712070d6bbe (diff) | |
Fix DCP building with subs.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/image.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc index 5b5491101..e5f626c24 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -376,11 +376,18 @@ Image::make_black () void Image::alpha_blend (shared_ptr<const Image> other, Position<int> position) { - /* Only implemented for RGBA onto BGRA so far */ - assert (_pixel_format == PIX_FMT_BGRA && other->pixel_format() == PIX_FMT_RGBA); - - int const this_bpp = 4; - int const other_bpp = 4; + int this_bpp = 0; + int other_bpp = 0; + + if (_pixel_format == PIX_FMT_BGRA && other->pixel_format() == PIX_FMT_RGBA) { + this_bpp = 4; + other_bpp = 4; + } else if (_pixel_format == PIX_FMT_RGB24 && other->pixel_format() == PIX_FMT_RGBA) { + this_bpp = 3; + other_bpp = 4; + } else { + assert (false); + } int start_tx = position.x; int start_ox = 0; |
