MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / Blit

Method Blit

deps/LLGL/sources/Core/Image.cpp:244–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244void Image::Blit(Offset3D dstRegionOffset, const Image& srcImage, Offset3D srcRegionOffset, Extent3D srcRegionExtent)
245{
246 if (GetFormat() == srcImage.GetFormat() && GetDataType() == srcImage.GetDataType())
247 {
248 /* First clamp source region to source image dimension */
249 srcImage.ClampRegion(srcRegionOffset, srcRegionExtent);
250
251 /* Then shift negative destination region */
252 if ( ShiftNegative1DRegion(dstRegionOffset.x, GetExtent().width, srcRegionOffset.x, srcRegionExtent.width ) &&
253 ShiftNegative1DRegion(dstRegionOffset.y, GetExtent().height, srcRegionOffset.y, srcRegionExtent.height) &&
254 ShiftNegative1DRegion(dstRegionOffset.z, GetExtent().depth, srcRegionOffset.z, srcRegionExtent.depth ) )
255 {
256 /* Check if a temporary copy of the source image must be allocated */
257 Image srcImageTemp;
258 const Image* srcImageRef = &srcImage;
259
260 if (srcImageRef == this && Overlap3DRegion(dstRegionOffset, srcRegionOffset, srcRegionExtent))
261 {
262 /* Copy source image */
263 srcImageTemp = *this;
264 srcImageRef = &srcImageTemp;
265 }
266
267 /* Copy image buffer region */
268 const auto srcExtent = srcImageRef->GetExtent();
269 const auto dstExtent = GetExtent();
270
271 CopyImageBufferRegion(
272 GetDstDesc(),
273 dstRegionOffset,
274 dstExtent.width,
275 dstExtent.width * dstExtent.height,
276 srcImageRef->GetSrcDesc(),
277 srcRegionOffset,
278 srcExtent.width,
279 srcExtent.width * srcExtent.height,
280 srcRegionExtent
281 );
282 }
283 }
284}
285
286void Image::Fill(Offset3D offset, Extent3D extent, const ColorRGBAd& fillColor)
287{

Callers 3

DirectFB_RunCommandQueueFunction · 0.45
DirectFB_RenderPresentFunction · 0.45
Test_BlitFunction · 0.45

Calls 8

GetFormatFunction · 0.85
GetDataTypeFunction · 0.85
ShiftNegative1DRegionFunction · 0.85
Overlap3DRegionFunction · 0.85
CopyImageBufferRegionFunction · 0.85
ClampRegionMethod · 0.80
GetSrcDescMethod · 0.80
GetFormatMethod · 0.45

Tested by 1

Test_BlitFunction · 0.36