34 #ifndef AIMS_IO_QTFORMATSW_H
35 #define AIMS_IO_QTFORMATSW_H
46 #include <qapplication.h>
63 unsigned zfame,
unsigned tframe );
64 std::string
format()
const;
69 static QRgb convertColor(
const T & );
74 inline QtFormatsWriter<T> &
77 writer.
write( thing );
86 std::string fmt = format();
88 if( !qApp && ( fmt ==
"EPS" || fmt ==
"EPSF" || fmt ==
"EPSI" ) )
91 unsigned t, z, dt = thing.
dimT(), dz = thing.
dimZ();
110 for( t=0; t<dt; ++t )
111 for( z=0; z<dz; ++z, ++i )
112 writeFrame( thing, dir + files[i], z, t );
134 const std::string & filename,
135 unsigned z,
unsigned t )
137 int x, y, dx = thing.
dimX(), dy = thing.
dimY();
138 QImage im( dx, dy, QImage::Format_RGB32 );
141 im = im.convertToFormat( QImage::Format_ARGB32 );
142 im.setDotsPerMeterX( (
int) rint( 1000 / thing.
sizeX() ) );
143 im.setDotsPerMeterY( (
int) rint( 1000 / thing.
sizeY() ) );
144 for( y=0; y<dy; ++y )
145 for( x=0; x<dx; ++x )
146 im.setPixel( x, y, convertColor( thing( x, y, z, t ) ) );
147 if( !im.save( filename.c_str(),
157 const std::string & filename,
158 unsigned z,
unsigned t )
160 int x, y, dx = thing.
dimX(), dy = thing.
dimY();
161 QImage im( dx, dy, QImage::Format_Indexed8 );
162 im.setDotsPerMeterX( (
int) rint( 1000 / thing.
sizeX() ) );
163 im.setDotsPerMeterY( (
int) rint( 1000 / thing.
sizeY() ) );
164 for( x=0; x<256; ++x )
165 im.setColor( x, qRgb( x, x, x ) );
166 for( y=0; y<dy; ++y )
167 for( x=0; x<dx; ++x )
168 im.setPixel( x, y, thing( x, y, z, t ) );
169 if( !im.save( filename.c_str(),
177 template<
typename T>
inline
180 return qRgb( x, x, x );
185 QRgb QtFormatsWriter<AimsRGB>::convertColor(
const AimsRGB & x )
192 QRgb QtFormatsWriter<AimsRGBA>::convertColor(
const AimsRGBA & x )
const aims::Header * header() const
void write(const AffineTransformation3d &thing)
static std::string dirname(const std::string &)
static std::string extension(const std::string &)
static std::string removeExtension(const std::string &)
virtual void setProperty(const std::string &, Object)
const uint8_t & green() const
const uint8_t & blue() const
const uint8_t & alpha() const
const uint8_t & red() const
const uint8_t & red() const
const uint8_t & blue() const
const uint8_t & green() const
static void launchErrnoExcept(const std::string &filename="")
MotionWriter & operator<<(MotionWriter &writer, const AffineTransformation3d &thing) __attribute__((__deprecated__("OBSOLETE")))
std::string stringUpper(const std::string &)