forked from mia/Aegisub
Remove AegiVideoFrame::GetFloat and some related code as it was only there for fextracker.
Originally committed to SVN as r3727.
This commit is contained in:
parent
df5ada1006
commit
7581d41935
5 changed files with 30 additions and 81 deletions
|
@ -236,39 +236,6 @@ wxImage AegiVideoFrame::GetImage() const {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// @brief Get float luminosity data
|
||||
/// @param buffer
|
||||
///
|
||||
void AegiVideoFrame::GetFloat(float *buffer) const {
|
||||
int Bpp = GetBpp();
|
||||
const unsigned char *src = data[0];
|
||||
float *dst = buffer;
|
||||
float temp;
|
||||
|
||||
// Convert
|
||||
if (format == FORMAT_RGB32 || format == FORMAT_RGB24) {
|
||||
int delta = 4-Bpp;
|
||||
for (unsigned int y=0;y<h;y++) {
|
||||
dst = buffer + y*w;
|
||||
if (flipped) src = data[0] + (h-y-1)*pitch[0]; // I think that it requires flipped data - amz
|
||||
else src = data[0] + y*pitch[0];
|
||||
for (unsigned int x=0;x<w;x++) {
|
||||
//temp = (*src++)*0.3 + (*src++)*0.4 + (*src++)*0.3;
|
||||
temp = (*src++)*0.3;
|
||||
temp += (*src++)*0.4;
|
||||
temp += (*src++)*0.3;
|
||||
|
||||
src += delta;
|
||||
*dst++ = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// @brief Get bytes per pixel for the current frame format
|
||||
/// @param plane
|
||||
/// @return
|
||||
|
|
|
@ -43,30 +43,29 @@
|
|||
|
||||
/// DOCME
|
||||
enum VideoFrameFormat {
|
||||
|
||||
/// DOCME
|
||||
FORMAT_NONE = 0x0000,
|
||||
|
||||
/// DOCME
|
||||
FORMAT_RGB24 = 0x0001, // RGB, interleaved
|
||||
/// RGB, interleaved
|
||||
FORMAT_RGB24 = 0x0001,
|
||||
|
||||
/// DOCME
|
||||
FORMAT_RGB32 = 0x0002, // RGBA, interleaved
|
||||
/// RGBA, interleaved
|
||||
FORMAT_RGB32 = 0x0002,
|
||||
|
||||
/// DOCME
|
||||
FORMAT_YUY2 = 0x0004, // YCbCr 4:2:2, planar
|
||||
/// YCbCr 4:2:2, planar
|
||||
FORMAT_YUY2 = 0x0004,
|
||||
|
||||
/// DOCME
|
||||
FORMAT_YV12 = 0x0008, // YCbCr 4:2:0, planar
|
||||
/// YCbCr 4:2:0, planar
|
||||
FORMAT_YV12 = 0x0008,
|
||||
|
||||
/// DOCME
|
||||
FORMAT_YUV444 = 0x0010, // YCbCr 4:4:4, planar
|
||||
/// YCbCr 4:4:4, planar
|
||||
FORMAT_YUV444 = 0x0010,
|
||||
|
||||
/// DOCME
|
||||
FORMAT_YUV444A = 0x0020, // YCbCr 4:4:4 plus alpha, planar
|
||||
/// YCbCr 4:4:4 plus alpha, planar
|
||||
FORMAT_YUV444A = 0x0020,
|
||||
|
||||
/// DOCME
|
||||
FORMAT_YUVMONO = 0x0040, // Y only (greyscale)
|
||||
/// Y only (greyscale)
|
||||
FORMAT_YUVMONO = 0x0040,
|
||||
};
|
||||
|
||||
|
||||
|
@ -85,30 +84,30 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
/// DOCME
|
||||
unsigned char *data[4]; // Pointers to the data planes. Interleaved formats only use data[0]
|
||||
/// Pointers to the data planes. Interleaved formats only use data[0]
|
||||
unsigned char *data[4];
|
||||
|
||||
/// DOCME
|
||||
VideoFrameFormat format; // Data format
|
||||
/// Data format
|
||||
VideoFrameFormat format;
|
||||
|
||||
/// DOCME
|
||||
unsigned int w; // Width in pixels
|
||||
/// Width in pixels
|
||||
unsigned int w;
|
||||
|
||||
/// DOCME
|
||||
unsigned int h; // Height in pixels
|
||||
/// Height in pixels
|
||||
unsigned int h;
|
||||
|
||||
/// DOCME
|
||||
unsigned int pitch[4]; // Pitch, that is, the number of bytes used by each row.
|
||||
// Pitch, that is, the number of bytes used by each row.
|
||||
unsigned int pitch[4];
|
||||
|
||||
|
||||
/// DOCME
|
||||
bool flipped; // First row is actually the bottom one
|
||||
/// First row is actually the bottom one
|
||||
bool flipped;
|
||||
|
||||
/// DOCME
|
||||
bool invertChannels; // Swap Red and Blue channels or U and V planes (controls RGB versus BGR ordering etc)
|
||||
/// Swap Red and Blue channels or U and V planes (controls RGB versus BGR ordering etc)
|
||||
bool invertChannels;
|
||||
|
||||
/// DOCME
|
||||
bool cppAlloc; // Allocated with C++'s "new" operator, instead of "malloc"
|
||||
/// Allocated with C++'s "new" operator, instead of "malloc"
|
||||
bool cppAlloc;
|
||||
|
||||
AegiVideoFrame();
|
||||
AegiVideoFrame(int width,int height,VideoFrameFormat format=FORMAT_RGB32);
|
||||
|
@ -119,7 +118,6 @@ public:
|
|||
void ConvertFrom(const AegiVideoFrame &source);
|
||||
|
||||
wxImage GetImage() const;
|
||||
void GetFloat(float *buffer) const;
|
||||
int GetBpp(int plane=0) const;
|
||||
};
|
||||
|
||||
|
|
|
@ -107,8 +107,6 @@ public:
|
|||
~AvisynthVideoProvider();
|
||||
|
||||
const AegiVideoFrame GetFrame(int n);
|
||||
void GetFloatFrame(float* Buffer, int n);
|
||||
|
||||
|
||||
/// @brief // properties
|
||||
/// @return
|
||||
|
|
|
@ -88,19 +88,6 @@ const AegiVideoFrame VideoProviderCache::GetFrame(int n) {
|
|||
return *srcFrame;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// @brief Get as float
|
||||
/// @param buffer
|
||||
/// @param n
|
||||
///
|
||||
void VideoProviderCache::GetFloatFrame(float* buffer, int n) {
|
||||
const AegiVideoFrame frame = GetFrame(n);
|
||||
frame.GetFloat(buffer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// @brief Set maximum cache size
|
||||
/// @param n
|
||||
///
|
||||
|
|
|
@ -94,7 +94,6 @@ protected:
|
|||
|
||||
public:
|
||||
// Base methods
|
||||
void GetFloatFrame(float* Buffer, int n); // Get frame as float
|
||||
const AegiVideoFrame GetFrame(int n);
|
||||
VideoProviderCache(VideoProvider *master);
|
||||
virtual ~VideoProviderCache();
|
||||
|
|
Loading…
Reference in a new issue