MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / Create

Method Create

python/mod_cvcuda/nvcv/Image.cpp:546–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546std::shared_ptr<Image> Image::Create(const Size2D &size, nvcv::ImageFormat fmt, int rowAlign)
547{
548 std::vector<std::shared_ptr<CacheItem>> vcont = Cache::Instance().fetch(Key{size, fmt});
549
550 // None found?
551 if (vcont.empty())
552 {
553 std::shared_ptr<Image> img(new Image(size, fmt, rowAlign));
554 Cache::Instance().add(*img);
555 return img;
556 }
557 else
558 {
559 // Get the first one
560 return std::static_pointer_cast<Image>(vcont[0]);
561 }
562}
563
564std::shared_ptr<Image> Image::Zeros(const Size2D &size, nvcv::ImageFormat fmt, int rowAlign)
565{

Callers

nothing calls this directly

Calls 3

fetchMethod · 0.45
emptyMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected