MCPcopy Create free account
hub / github.com/ZDoom/Raze / CopyPixelData

Method CopyPixelData

source/common/textures/bitmap.cpp:454–479  ·  view source on GitHub ↗

=========================================================================== Paletted to True Color texture copy function ===========================================================================

Source from the content-addressed store, hash-verified

452//
453//===========================================================================
454void FBitmap::CopyPixelData(int originx, int originy, const uint8_t * patch, int srcwidth, int srcheight,
455 int step_x, int step_y, int rotate, const PalEntry * palette, FCopyInfo *inf)
456{
457 if (ClipCopyPixelRect(&ClipRect, originx, originy, patch, srcwidth, srcheight, step_x, step_y, rotate))
458 {
459 uint8_t *buffer = data + 4*originx + Pitch*originy;
460 PalEntry penew[256];
461
462 memset(penew, 0, sizeof(penew));
463 if (inf)
464 {
465 if (inf->blend)
466 {
467 iCopyColors<cPalEntry, cBGRA, bCopy>((uint8_t*)penew, (const uint8_t*)palette, 256, 4, inf, 0, 0, 0);
468 palette = penew;
469 }
470 else if (inf->palette)
471 {
472 palette = inf->palette;
473 }
474 }
475
476 copypalettedfuncs[inf==NULL? OP_COPY : inf->op](buffer, patch, srcwidth, srcheight, Pitch,
477 step_x, step_y, rotate, palette, inf);
478 }
479}
480
481//===========================================================================
482//

Callers 13

CopyPixelsMethod · 0.80
CopyPixelsMethod · 0.80
CopyTranslatedPixelsMethod · 0.80
CopyPixelsMethod · 0.80
CopyPixelsMethod · 0.80
GetBgraBitmapMethod · 0.80
CopyPixelsMethod · 0.80
CopyPixelsMethod · 0.80
CopyPixelsMethod · 0.80
CopyPixelsMethod · 0.80
CopyPixelsMethod · 0.80
CopyPixelsMethod · 0.80

Calls 1

ClipCopyPixelRectFunction · 0.85

Tested by

no test coverage detected