MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / insertHorizontal

Method insertHorizontal

sources/image/Image.cpp:108–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107template <typename ColorSpace>
108void Image<ColorSpace>::insertHorizontal(int x, Image<ColorSpace>& source)
109{
110 int copyX = ((x + source.width()) > width()) ? width() - x : source.width();
111 int copyY = std::min(source.height(), height());
112 uint8_t* dest = rawMem() + sizeof(ColorSpace) * x;
113 uint8_t* src = source.rawMem();
114 auto destRowSize = sizeof(ColorSpace) * width();
115 auto srcRowSize = sizeof(ColorSpace) * source.width();
116
117 for (int y = 0; y < copyY; y++)
118 {
119 memcpy(dest, src, copyX * sizeof(ColorSpace));
120 dest += destRowSize;
121 src += srcRowSize;
122 }
123}
124
125template <typename ColorSpace>
126unsigned Image<ColorSpace>::width() const

Callers 1

grabFrameMethod · 0.80

Calls 3

widthMethod · 0.45
heightMethod · 0.45
rawMemMethod · 0.45

Tested by

no test coverage detected