| 62 | } |
| 63 | |
| 64 | ImageBatchVarShape CompositeVarShapeInto(ImageBatchVarShape &output, ImageBatchVarShape &foreground, |
| 65 | ImageBatchVarShape &background, ImageBatchVarShape &fgMask, |
| 66 | std::optional<Stream> pstream) |
| 67 | { |
| 68 | if (!pstream) |
| 69 | { |
| 70 | pstream = Stream::Current(); |
| 71 | } |
| 72 | |
| 73 | auto composite = CreateOperator<cvcuda::Composite>(); |
| 74 | |
| 75 | ResourceGuard guard(*pstream); |
| 76 | guard.add(LockMode::LOCK_MODE_READ, {foreground, background, fgMask}); |
| 77 | guard.add(LockMode::LOCK_MODE_WRITE, {output}); |
| 78 | guard.add(LockMode::LOCK_MODE_NONE, {*composite}); |
| 79 | |
| 80 | composite->submit(pstream->cudaHandle(), foreground, background, fgMask, output); |
| 81 | |
| 82 | return output; |
| 83 | } |
| 84 | |
| 85 | ImageBatchVarShape CompositeVarShape(ImageBatchVarShape &foreground, ImageBatchVarShape &background, |
| 86 | ImageBatchVarShape &fgMask, std::optional<Stream> pstream) |
no test coverage detected