Add support to save the current frame

This commit is contained in:
jfmcarreira committed 2014-01-31 01:33:31 +00:00
1 parent fbbed36820
commit 4280017fa0
6 files changed
+93 -26

No files matched your search

+43
View File
@@ -70,6 +70,18 @@ QString InputStream::supportedReadFormats()
return formats;
}
QString InputStream::supportedWriteFormats()
{
QString formats;
formats = "*.bmp " // Windows Bitmap
"*.jpg " // Joint Photographic Experts Group
"*.jpeg " // Joint Photographic Experts Group
"*.png " // Portable Network Graphics
;
return formats;
}
QStringList InputStream::supportedReadFormatsList()
{
QStringList formats;
@@ -78,6 +90,22 @@ QStringList InputStream::supportedReadFormatsList()
return formats;
}
QStringList InputStream::supportedWriteFormatsList()
{
QStringList formats;
formats << "Windows Bitmap (*.bmp)"
<< "Joint Photographic Experts Group (*.jpg *.jpeg)"
<< "Portable Network Graphics (*.png)"
<< "Portable Bitmap (*.pbm)"
<< "Portable Graymap (*.pgm)"
<< "Portable Pixmap (*.ppm)"
<< "Tagged Image File Format (*.tiff)"
<< "X11 Bitmap (*.xbm)"
<< "X11 Pixmap (*.xpm)";
return formats;
}
QStringList InputStream::supportedPixelFormatList()
{
QStringList formats;
@@ -288,6 +316,12 @@ Void InputStream::readFrame()
return;
}
Bool InputStream::writeFrame( const QString& filename )
{
getFrameQImage().save(filename);
return true;
}
QImage InputStream::getFrameQImage()
{
// Create QImage
@@ -315,6 +349,15 @@ QImage InputStream::getFrameQImage()
return img;
}
#ifdef USE_OPENCV
cv::Mat InputStream::getFrameCvMat()
{
cv::Mat cvMat( m_uiHeight, m_uiWidth, CV_8UC3 );
return cvMat;
}
#endif
Void InputStream::seekInput( Int new_frame_num )
{
UInt64 frame_bytes_input = m_uiWidth * m_uiHeight * 1.5;