Text archives Help
- From: rocky@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r384 - branches/itanium2/Engine/Display
- Date: Wed, 15 Jun 2005 18:51:16 -0600 (MDT)
Author: rocky
Date: Wed Jun 15 18:51:13 2005
New Revision: 384
Added:
branches/itanium2/Engine/Display/FileDisplay.cc
branches/itanium2/Engine/Display/FileDisplay.h
Log:
copied over FileDisplay stuff from main trunk
Added: branches/itanium2/Engine/Display/FileDisplay.cc
==============================================================================
--- (empty file)
+++ branches/itanium2/Engine/Display/FileDisplay.cc Wed Jun 15 18:51:13
2005
@@ -0,0 +1,65 @@
+
+#include <fstream>
+#include <sstream>
+#include <iomanip>
+#include <Engine/Display/FileDisplay.h>
+#include <Core/Exceptions/IllegalArgument.h>
+#include <Core/Exceptions/InternalError.h>
+#include <Core/Util/NotFinished.h>
+#include <Image/NullImage.h>
+#include <Image/Pixel.h>
+#include <Image/SimpleImage.h>
+#include <Image/TGAFile.h>
+
+using namespace Manta;
+using namespace std;
+using SCIRun::IllegalValue;
+using SCIRun::InternalError;
+
+ImageDisplay *FileDisplay::create(
+ const vector< string > &args )
+{
+ return new FileDisplay(args);
+}
+
+FileDisplay::FileDisplay(
+ const vector<string> &args )
+{
+ if( args.size() != 1 )
+ throw IllegalArgument( "FileDisplay", 0, args );
+ baseName = args[ 0 ];
+ currentFrame = 0;
+}
+
+FileDisplay::~FileDisplay()
+{
+}
+
+void FileDisplay::setupDisplayChannel(
+ SetupContext & )
+{
+}
+
+void FileDisplay::displayImage(
+ const DisplayContext &context,
+ const Image *image )
+{
+ bool stereo;
+ int xres, yres;
+ image->getResolution( stereo, xres, yres );
+ if ( stereo ) {
+ stringstream lss, rss;
+ lss << baseName << "_left_" << setfill( '0' ) << setw( 5 ) <<
currentFrame << ".tga";
+ rss << baseName << "_right_" << setfill( '0' ) << setw( 5 ) <<
currentFrame << ".tga";
+ string left = lss.str();
+ string right = rss.str();
+ writeTGA( image, left, 0 );
+ writeTGA( image, right, 1 );
+ } else {
+ stringstream ss;
+ ss << baseName << "_" << setfill( '0' ) << setw( 5 ) << currentFrame <<
".tga";
+ string name = ss.str();
+ writeTGA( image, name, 0 );
+ }
+ ++currentFrame;
+}
Added: branches/itanium2/Engine/Display/FileDisplay.h
==============================================================================
--- (empty file)
+++ branches/itanium2/Engine/Display/FileDisplay.h Wed Jun 15 18:51:13
2005
@@ -0,0 +1,30 @@
+
+#ifndef Manta_Engine_FileDisplay_h
+#define Manta_Engine_FileDisplay_h
+
+#include <Interface/ImageDisplay.h>
+#include <sgi_stl_warnings_off.h>
+#include <string>
+#include <vector>
+#include <sgi_stl_warnings_on.h>
+
+namespace Manta {
+ using namespace std;
+ class FileDisplay : public ImageDisplay {
+ public:
+ FileDisplay(const vector<string>& args);
+ virtual ~FileDisplay();
+ virtual void setupDisplayChannel(SetupContext&);
+ virtual void displayImage(const DisplayContext& context,
+ const Image* image);
+ static ImageDisplay* create(const vector<string>& args);
+ protected:
+ string baseName;
+ int currentFrame;
+ private:
+ FileDisplay(const FileDisplay&);
+ FileDisplay& operator=(const FileDisplay&);
+ };
+}
+
+#endif
- [MANTA] r384 - branches/itanium2/Engine/Display, rocky, 06/15/2005
Archive powered by MHonArc 2.6.16.