diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-07-06 23:09:08 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-11-29 21:19:55 +0100 |
| commit | 6f581b976599c893e07f4e0bd767ce661b5aad1c (patch) | |
| tree | b8ba9706f6f7a0ba224d1184ce3b0b4573783e78 /src/lib/dcp_video.cc | |
| parent | c4fc41b5c4d45f9f4181e4af4d16b1346e956105 (diff) | |
Patch from Aaron Boxer adding initial support for GPU-powered J2K encoding via his tool "grok".
Diffstat (limited to 'src/lib/dcp_video.cc')
| -rw-r--r-- | src/lib/dcp_video.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc index 217b72183..204c390ee 100644 --- a/src/lib/dcp_video.cc +++ b/src/lib/dcp_video.cc @@ -117,6 +117,27 @@ DCPVideo::convert_to_xyz (shared_ptr<const PlayerVideo> frame) return xyz; } +dcp::Size +DCPVideo::get_size(void) { + auto image = _frame->image (bind(&PlayerVideo::keep_xyz_or_rgb, _1), VideoRange::FULL, false); + return image->size(); +} + +void +DCPVideo::convert_to_xyz (uint16_t *dst) { + + auto image = _frame->image (bind(&PlayerVideo::keep_xyz_or_rgb, _1), VideoRange::FULL, false); + if (_frame->colour_conversion()) { + dcp::rgb_to_xyz ( + image->data()[0], + dst, + image->size(), + image->stride()[0], + _frame->colour_conversion().get() + ); + } +} + /** J2K-encode this frame on the local host. * @return Encoded data. */ |
