Skip to content

Commit

Permalink
Vers 2.033
Browse files Browse the repository at this point in the history
Rebuild with SpoutDX 2.007.015
  • Loading branch information
leadedge committed Aug 27, 2024
1 parent da5914d commit 87217b5
Show file tree
Hide file tree
Showing 19 changed files with 397 additions and 136 deletions.
1 change: 0 additions & 1 deletion SpoutDX/source/SpoutCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// Optional _#define legacyOpenGL_ to enable legacy draw functions
//


/*
Thanks and credit to Malcolm Bechard, the author of this file
https://github.com/mbechard
Expand Down
18 changes: 17 additions & 1 deletion SpoutDX/source/SpoutCopy.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Functions to manage pixel data copy
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down Expand Up @@ -73,6 +72,9 @@
07.10.23 - Conditional compile options for _M_ARM64 in CheckSSE and header
20.10.23 - FlipBuffer / CopyPixels - default pitch width*4
Version 2.007.013
Version 2.007.014
19.06.24 - Add ClearAlpha
*/

#include "SpoutCopy.h"
Expand Down Expand Up @@ -207,6 +209,20 @@ void spoutCopy::RemovePadding(const unsigned char *source, unsigned char *dest,
}
}

//---------------------------------------------------------
// Function: ClearAlpha
// Clear alpha of rgba image pixels to the required value
void spoutCopy::ClearAlpha(unsigned char* src, unsigned int width, unsigned int height, unsigned char alpha) const
{
unsigned char* pixels = src;
for (unsigned int i = 0; i<width*height; i++) {
*(pixels + 3) = alpha; // alpha is the last of the 4 bytes
pixels += 4; // move the pointer along to the next rgba pixel
}
}



//
// Fast memcpy.
//
Expand Down
7 changes: 4 additions & 3 deletions SpoutDX/source/SpoutCopy.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
SpoutCopy.h
Functions to manage pixel buffer copying
Expand Down Expand Up @@ -70,6 +69,10 @@ class SPOUT_DLLEXP spoutCopy {
unsigned int width, unsigned int height,
unsigned int source_stride, GLenum glFormat) const;

// Clear alpha of rgba image pixels to the required value
void ClearAlpha(unsigned char* src, unsigned int width,
unsigned int height, unsigned char alpha) const;

// SSE2 version of memcpy
void memcpy_sse2(void* dst, const void* src, size_t size) const;

Expand Down Expand Up @@ -200,8 +203,6 @@ class SPOUT_DLLEXP spoutCopy {
// Copy BGRA to BGR
void bgra2bgr (const void* bgra_source, void *bgr_dest, unsigned int width, unsigned int height, bool bInvert = false) const;



protected :

void CheckSSE();
Expand Down
Loading

0 comments on commit 87217b5

Please sign in to comment.