diff options
author | Matthew Hoops | 2014-09-05 21:03:52 -0400 |
---|---|---|
committer | Matthew Hoops | 2015-04-11 14:37:04 -0400 |
commit | b170b0882237a4c8b8119d2875bf2e05c03168e5 (patch) | |
tree | 4281696a403db82c7d9536e571365cfb6fa3dac2 /video/qt_decoder.cpp | |
parent | 1271fbde8f30fdf2d0664bb1e3382928380f9aa9 (diff) | |
download | scummvm-rg350-b170b0882237a4c8b8119d2875bf2e05c03168e5.tar.gz scummvm-rg350-b170b0882237a4c8b8119d2875bf2e05c03168e5.tar.bz2 scummvm-rg350-b170b0882237a4c8b8119d2875bf2e05c03168e5.zip |
VIDEO: Add support for dithering in QuickTime videos
Diffstat (limited to 'video/qt_decoder.cpp')
-rw-r--r-- | video/qt_decoder.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 9b77ef70c1..cab7372a6d 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -751,4 +751,27 @@ bool QuickTimeDecoder::VideoTrackHandler::endOfCurEdit() const { return getRateAdjustedFrameTime() >= getCurEditTimeOffset() + getCurEditTrackDuration(); } +bool QuickTimeDecoder::VideoTrackHandler::canDither() const { + for (uint i = 0; i < _parent->sampleDescs.size(); i++) { + VideoSampleDesc *desc = (VideoSampleDesc *)_parent->sampleDescs[i]; + + if (!desc || !desc->_videoCodec) + return false; + + if (!desc->_videoCodec->canDither(Image::Codec::kDitherTypeQT)) + return false; + } + + return true; +} + +void QuickTimeDecoder::VideoTrackHandler::setDither(const byte *palette) { + assert(canDither()); + + for (uint i = 0; i < _parent->sampleDescs.size(); i++) { + VideoSampleDesc *desc = (VideoSampleDesc *)_parent->sampleDescs[i]; + desc->_videoCodec->setDither(Image::Codec::kDitherTypeQT, palette); + } +} + } // End of namespace Video |