polaroid-pp

Schlieren and contour plot tool
git clone https://git.0xfab.ch/polaroid-pp.git
Log | Files | Refs | Submodules | README | LICENSE

commit 3d4420bff152d2e581101d17ecc151dd035ca899
parent 78e2a32c6c1c442b3d8e4583175fc869f1578216
Author: Fabian Wermelinger <fabianw@mavt.ethz.ch>
Date:   Thu, 30 Jun 2016 15:53:44 +0200

modified signature of set_pixel method

Diffstat:
Mapps/polaroidCamera/BoundedLogNormalizerCartridge.h | 2+-
Mapps/polaroidCamera/BoundedNormalizerCartridge.h | 2+-
Mapps/polaroidCamera/BoundedTransmissionCartridge.h | 2+-
Mapps/polaroidCamera/LogNormalizerCartridge.h | 2+-
Mapps/polaroidCamera/NormalizerCartridge.h | 2+-
Mapps/polaroidCamera/SchlierenCartridge.h | 2+-
Mapps/polaroidCamera/TransmissionCartridge.h | 2+-
Minclude/PhotoHDF5.h | 2+-
Minclude/PhotoPNG.h | 4++--
Minclude/PhotoPaper.h | 6+++---
Msrc/PhotoHDF5.cpp | 2+-
Msrc/PhotoPNG.cpp | 4++--
12 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/apps/polaroidCamera/BoundedLogNormalizerCartridge.h b/apps/polaroidCamera/BoundedLogNormalizerCartridge.h @@ -39,7 +39,7 @@ public: { const Real bound = std::max(static_cast<Real>(0.0), std::min(static_cast<Real>(1.0), log(data(w,h)*dataMinInv)*fac)); assert(!isnan(bound)); - photo.set_pixel(w, h, bound); + photo.set_pixel(bound, w, h); } photo.write(); diff --git a/apps/polaroidCamera/BoundedNormalizerCartridge.h b/apps/polaroidCamera/BoundedNormalizerCartridge.h @@ -32,7 +32,7 @@ public: for (int w=0; w < data.width(); ++w) { const Real bound = std::max(static_cast<Real>(0.0),std::min(static_cast<Real>(1.0), (data(w,h)-lower)*data_normInv)); - photo.set_pixel(w, h, bound); + photo.set_pixel(bound, w, h); } photo.write(); diff --git a/apps/polaroidCamera/BoundedTransmissionCartridge.h b/apps/polaroidCamera/BoundedTransmissionCartridge.h @@ -30,7 +30,7 @@ public: for (int w=0; w < data.width(); ++w) { const Real bound = std::max(lower,std::min(upper,data(w,h))); - photo.set_pixel(w, h, bound); + photo.set_pixel(bound, w, h); } photo.write(); diff --git a/apps/polaroidCamera/LogNormalizerCartridge.h b/apps/polaroidCamera/LogNormalizerCartridge.h @@ -40,7 +40,7 @@ public: { const Real logData = log(data(w,h)*dataMinInv); assert(!isnan(logData)); - photo.set_pixel(w, h, fac*logData); + photo.set_pixel(fac*logData, w, h); } photo.write(); diff --git a/apps/polaroidCamera/NormalizerCartridge.h b/apps/polaroidCamera/NormalizerCartridge.h @@ -33,7 +33,7 @@ public: // pixel shader for (int h=0; h < data.height(); ++h) for (int w=0; w < data.width(); ++w) - photo.set_pixel(w, h, (data(w,h) - m_dataMin) * data_normInv); + photo.set_pixel((data(w,h) - m_dataMin) * data_normInv, w, h); photo.write(); } diff --git a/apps/polaroidCamera/SchlierenCartridge.h b/apps/polaroidCamera/SchlierenCartridge.h @@ -56,7 +56,7 @@ public: for (int w=0; w < data.width(); ++w) { const Real phi = std::exp(fac*(data(w,h)*dataMaxInv - k0)); - photo.set_pixel(w, h, gammaCorrect(phi)); + photo.set_pixel(gammaCorrect(phi), w, h); } photo.write(); diff --git a/apps/polaroidCamera/TransmissionCartridge.h b/apps/polaroidCamera/TransmissionCartridge.h @@ -24,7 +24,7 @@ public: // put pixel for (int h=0; h < data.height(); ++h) for (int w=0; w < data.width(); ++w) - photo.set_pixel(w, h, data(w,h)); + photo.set_pixel(data(w,h), w, h); photo.write(); } diff --git a/include/PhotoHDF5.h b/include/PhotoHDF5.h @@ -48,7 +48,7 @@ public: virtual void make_new(const std::string name, const int width, const int height); virtual void resize(const int width, const int height); virtual void write(); - virtual void set_pixel(const int x, const int y, const double phi); + virtual void set_pixel(const double phi, const int x, const int y); virtual std::string suffix() const { return std::string(".h5"); } virtual void set_description(const char* const desc) { m_description = std::string(desc); } inline void set_time(const Real t) { m_time = t; } diff --git a/include/PhotoPNG.h b/include/PhotoPNG.h @@ -63,7 +63,7 @@ public: virtual void make_new(const std::string name, const int width, const int height); virtual void resize(const int width, const int height); virtual void write(); - virtual void set_pixel(const int x, const int y, const double phi); + virtual void set_pixel(const double phi, const int x, const int y); virtual std::string suffix() const { return std::string(".png"); } virtual void set_description(const char* const desc) { m_description = desc; } }; @@ -75,7 +75,7 @@ public: PNG_MONO(const Polaroid& cam, const std::string filename="mono") : PNG_HSV(cam, filename) { } PNG_MONO(const int width, const int height, const std::string filename="mono") : PNG_HSV(width, height, filename) { } - virtual void set_pixel(const int x, const int y, const double phi); + virtual void set_pixel(const double phi, const int x, const int y); }; class PNG_RGB : public PNG_HSV diff --git a/include/PhotoPaper.h b/include/PhotoPaper.h @@ -19,10 +19,10 @@ public: PhotoPaper(const int width, const int height, const std::string& name) : m_width(width), m_height(height), m_fname(name) {}; virtual ~PhotoPaper() {}; - virtual void make_new(const std::string name, const int width, const int height=1) = 0; - virtual void resize(const int width, const int height=1) = 0; + virtual void make_new(const std::string name, const int width, const int height=0) = 0; + virtual void resize(const int width, const int height=0) = 0; virtual void write() = 0; - virtual void set_pixel(const int x, const int y, const double phi) = 0; + virtual void set_pixel(const double phi, const int x, const int y=0) = 0; virtual std::string suffix() const = 0; virtual void set_description(const char* const desc) { } inline void set_name(const std::string& name) { m_fname = name; } diff --git a/src/PhotoHDF5.cpp b/src/PhotoHDF5.cpp @@ -109,7 +109,7 @@ void PhotoHDF5::write() } } -void PhotoHDF5::set_pixel(const int ix, const int iy, const double phi) +void PhotoHDF5::set_pixel(const double phi, const int ix, const int iy) { if (m_open) { diff --git a/src/PhotoPNG.cpp b/src/PhotoPNG.cpp @@ -37,7 +37,7 @@ void PNG_HSV::write() } } -void PNG_HSV::set_pixel(const int x, const int y, const double phi) +void PNG_HSV::set_pixel(const double phi, const int x, const int y) { if (m_open) { @@ -46,7 +46,7 @@ void PNG_HSV::set_pixel(const int x, const int y, const double phi) } } -void PNG_MONO::set_pixel(const int x, const int y, const double phi) +void PNG_MONO::set_pixel(const double phi, const int x, const int y) { if (m_open) m_png->plot(x+1, y+1, phi, phi, phi);