Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
omni::proj::Calibration Class Reference

Calibration generated from a tuning Calibration has output mode with either UVW or TEXCOORDS. More...

#include <Calibration.h>

Collaboration diagram for omni::proj::Calibration:
Collaboration graph
[legend]

Public Member Functions

 Calibration (CalibrationMode=CalibrationMode::TEXCOORDS)
 Create empty calibration from with optional output mode. More...
 
 Calibration (Tuning const &, CalibrationMode=CalibrationMode::TEXCOORDS)
 Create and render calibration from tuning. More...
 
void render (Tuning const &)
 Render calibration from tuning. More...
 
void render (Tuning const &, CalibrationMode)
 Render calibration from tuning and set calibration mode. More...
 
void render (Tuning const &, ContextBoundPtr< visual::Framebuffer32F > &)
 Render to framebuffer object. More...
 
QImage toImage () const
 Render to image. More...
 
QImage toPreviewImage () const
 Render to preview image. More...
 
CalibrationMode mode () const
 Return output type. More...
 
RenderBuffer const & buffer () const
 Return buffer. More...
 
QRect const & screenGeometry () const
 Return screen geometry rectangle. More...
 
QRect const & contentGeometry () const
 Return output geometry rectangle. More...
 
QSize renderSize () const
 Return actual size of rendered output. More...
 
void setRenderSize (QSize const &)
 Set new size for renderer output. Resets calibration. More...
 
ColorCorrection const & colorCorrection () const
 Return color correction. More...
 
bool virtualScreen () const
 Return true if screen is virtual. More...
 

Private Member Functions

void getUpper8bit (QImage &_image) const
 Encode upper 8 bit of buffer into image. More...
 
void getLower8bit (QImage &_image) const
 Encode lower 8 bit of buffer into image. More...
 
void getAlphaMask (QImage &_image, Channel=Channel::ALL) const
 Encode alpha mask into selected channel. More...
 
void encodeColorCorrection (QImage &, Channel) const
 Encode color correction into selected image channel. More...
 

Static Private Member Functions

template<typename OPERATION >
static void bufferToImage (RenderBuffer const &_buffer, QImage &_image, OPERATION _f)
 

Private Attributes

bool virtualScreen_ = true
 
QRect screenGeometry_
 
QRect contentGeometry_
 
CalibrationMode mode_
 
ColorCorrection colorCorrection_
 
RenderBuffer buffer_
 

Friends

class CalibrationRenderer
 

Detailed Description

Calibration generated from a tuning Calibration has output mode with either UVW or TEXCOORDS.

Constructor & Destructor Documentation

omni::proj::Calibration::Calibration ( CalibrationMode  _mode = CalibrationMode::TEXCOORDS)

Create empty calibration from with optional output mode.

32 : mode_(_mode) {}
CalibrationMode mode_
Definition: Calibration.h:111
omni::proj::Calibration::Calibration ( Tuning const &  _tuning,
CalibrationMode  _mode = CalibrationMode::TEXCOORDS 
)

Create and render calibration from tuning.

34  :
35  mode_(_mode) {
36  render(_tuning, mode_);
37  }
void render(Tuning const &)
Render calibration from tuning.
Definition: Calibration.cpp:168
CalibrationMode mode_
Definition: Calibration.h:111

Member Function Documentation

RenderBuffer const & omni::proj::Calibration::buffer ( ) const

Return buffer.

286  {
287  return buffer_;
288  }
RenderBuffer buffer_
Definition: Calibration.h:113
template<typename OPERATION >
void omni::proj::Calibration::bufferToImage ( RenderBuffer const &  _buffer,
QImage &  _image,
OPERATION  _f 
)
staticprivate
318  {
319  if ((_image.width() != _buffer.width()) &&
320  (_image.height() != _buffer.height())) {
321  _image = QImage(_buffer.width(), _buffer.height(), QImage::Format_ARGB32);
322  }
323 
324  int _pos = 0;
325 
326  for (int y = 0; y < _image.height(); ++y)
327  {
328  uchar *_line = _image.scanLine(y);
329 
330  for (int x = 0; x < _image.width() * 4; x += 4)
331  {
332  RGBAFloat _imagePixel(
333  _line[x + 2] / 255.0,
334  _line[x + 1] / 255.0,
335  _line[x + 0] / 255.0,
336  _line[x + 3] / 255.0);
337 
338  RGBAFloat _pixel = _f(_imagePixel, _buffer.data()[_pos + x / 4]);
339  _line[x + 2] = qBound(0, int(_pixel.r * 255), 255);
340  _line[x + 1] = qBound(0, int(_pixel.g * 255), 255);
341  _line[x + 0] = qBound(0, int(_pixel.b * 255), 255);
342  _line[x + 3] = qBound(0, int(_pixel.a * 255), 255);
343  }
344  _pos += _image.width();
345  }
346  }
ColorCorrection const & omni::proj::Calibration::colorCorrection ( ) const

Return color correction.

306  {
307  return colorCorrection_;
308  }
ColorCorrection colorCorrection_
Definition: Calibration.h:112
QRect const & omni::proj::Calibration::contentGeometry ( ) const

Return output geometry rectangle.

294  {
295  return contentGeometry_;
296  }
QRect contentGeometry_
Definition: Calibration.h:110
void omni::proj::Calibration::encodeColorCorrection ( QImage &  _image,
Channel  _channel 
) const
private

Encode color correction into selected image channel.

436  {
437  for (int y = 0; y < _image.height(); ++y)
438  {
439  uchar *_line = _image.scanLine(y);
440 
441  // Channel correction index (0 = ALL, 1 = RED, 2 = GREEN, 3 = BLUE)
442  int _ccIndex = y * 4 / _image.height();
443 
444  // Component index (0 = Gamma, 1 = brightness, 2 = contrast, 3 =
445  // multiplier)
446  int _componentIndex = (y * 16 / _image.height()) % 4;
447 
448  proj::ChannelCorrection const *_channelCorrection =
449  colorCorrection_.correction(util::intToEnum<proj::Channel>(
450  _ccIndex));
451 
452  float _component = 0.0;
453  int _result = 0;
454 
455  // Get channel correction component, based in given component index
456  if (_channelCorrection) {
457  switch (_componentIndex) {
458  case 0: _component = _channelCorrection->gamma(); break;
459 
460  case 1: _component = _channelCorrection->brightness(); break;
461 
462  case 2: _component = _channelCorrection->contrast(); break;
463 
464  case 3: _component = _channelCorrection->multiplier(); break;
465  }
466 
467  // Convert float to byte
468  _result = qBound(0, int((_component + 1.0) * 0.5 * 255), 255);
469  }
470 
471  for (int x = 0; x < _image.width() * 4; x += 4)
472  {
473  // Insert result value into destination color channel
474  switch (_channel) {
475  case Channel::ALL:
476  _line[x + 0] = _result;
477  _line[x + 1] = _result;
478  _line[x + 2] = _result;
479  break;
480 
481  default:
482  case Channel::GREEN:
483  _line[x + 1] = _result;
484  break;
485 
486  case Channel::BLUE:
487  _line[x + 0] = _result;
488  break;
489 
490  case Channel::RED:
491  _line[x + 2] = _result;
492  }
493  }
494  }
495  }
ChannelCorrection * correction(Channel)
Return color correction for given channel.
Definition: ColorCorrection.cpp:95
double gamma() const
Return gamma value.
Definition: ChannelCorrection.cpp:27
ColorCorrection colorCorrection_
Definition: Calibration.h:112
void omni::proj::Calibration::getAlphaMask ( QImage &  _image,
Channel  _channel = Channel::ALL 
) const
private

Encode alpha mask into selected channel.

416  {
417  bufferToImage(buffer_, _image,
418  [&](RGBAFloat const& _input, RGBAFloat const& _pixel)
419  {
420  RGBAFloat _output = _input;
421 
422  switch (_channel) {
423  case Channel::RED: _output.r = _pixel.a; break;
424 
425  case Channel::GREEN: _output.g = _pixel.a; break;
426 
427  case Channel::BLUE: _output.b = _pixel.a; break;
428 
429  case Channel::ALL: return RGBAFloat(_pixel.a, _pixel.a, _pixel.a);
430  }
431  return _output;
432  });
433  }
RenderBuffer buffer_
Definition: Calibration.h:113
static void bufferToImage(RenderBuffer const &_buffer, QImage &_image, OPERATION _f)
Definition: Calibration.cpp:315
void omni::proj::Calibration::getLower8bit ( QImage &  _image) const
private

Encode lower 8 bit of buffer into image.

386  {
387  _image = QImage(buffer_.width(), buffer_.height(), QImage::Format_ARGB32);
388 
389  int _pos = 0;
390  auto convLower = [](float _v)
391  {
392  int i = _v * (1 << 16);
393 
394  return i & 255;
395  };
396 
397  for (int y = 0; y < _image.height(); ++y)
398  {
399  uchar *_line = _image.scanLine(y);
400 
401  for (int x = 0; x < _image.width() * 4; x += 4)
402  {
403  RGBAFloat _pixel = buffer_.data()[_pos + x / 4];
404 
405  _line[x + 2] = convLower(_pixel.r);
406  _line[x + 1] = convLower(_pixel.g);
407  _line[x + 0] = convLower(_pixel.b);
408  _line[x + 3] = 255;
409  }
410  _pos += _image.width();
411  }
412  }
data_type const & data() const
Return const reference to data.
Definition: Buffer.h:143
int height() const
Return height of the buffer.
Definition: Buffer.h:137
RenderBuffer buffer_
Definition: Calibration.h:113
int width() const
Return width of the buffer.
Definition: Buffer.h:131
void omni::proj::Calibration::getUpper8bit ( QImage &  _image) const
private

Encode upper 8 bit of buffer into image.

349  {
350  _image = QImage(buffer_.width(), buffer_.height(), QImage::Format_ARGB32);
351 
352  int _pos = 0;
353 
354  auto convUpper = [](float _v)
355  {
356  int i = _v * (1 << 8);
357 
358  return qBound(0, i, 255);
359  };
360 
361  for (int y = 0; y < _image.height(); ++y)
362  {
363  uchar *_line = _image.scanLine(y);
364 
365  for (int x = 0; x < _image.width() * 4; x += 4)
366  {
367  RGBAFloat _pixel = buffer_.data()[_pos + x / 4];
368 
369  if ((_pixel.r == 0.0) && (_pixel.g == 0.0) && (_pixel.b == 0.0)) {
370  _line[x + 2] = 128;
371  _line[x + 1] = 128;
372  _line[x + 0] = 128;
373  _line[x + 3] = 255;
374  continue;
375  }
376  _line[x + 2] = convUpper(_pixel.r);
377  _line[x + 1] = convUpper(_pixel.g);
378  _line[x + 0] = convUpper(_pixel.b);
379  _line[x + 3] = 255;
380  }
381  _pos += _image.width();
382  }
383  }
data_type const & data() const
Return const reference to data.
Definition: Buffer.h:143
int height() const
Return height of the buffer.
Definition: Buffer.h:137
RenderBuffer buffer_
Definition: Calibration.h:113
int width() const
Return width of the buffer.
Definition: Buffer.h:131
CalibrationMode omni::proj::Calibration::mode ( ) const

Return output type.

282  {
283  return mode_;
284  }
CalibrationMode mode_
Definition: Calibration.h:111
void omni::proj::Calibration::render ( Tuning const &  _tuning)

Render calibration from tuning.

168  {
169  ContextBoundPtr<visual::Framebuffer32F> _framebuffer;
170 
171  render(_tuning,_framebuffer);
172  withCurrentContext([&](QOpenGLFunctions& _) {
173  _framebuffer->bind();
174  _.glViewport(0, 0, _framebuffer->width(), _framebuffer->height());
175  // Read merged output to calibration data buffer
176  _.glReadPixels(0, 0, buffer_.width(), buffer_.height(), GL_RGBA, GL_FLOAT, buffer_.ptr());
177  _framebuffer->release();
178  });
179 
180  primaryContextSwitch([&](QOpenGLFunctions& _) {
181  _framebuffer.reset();
182  });
183  }
void render(Tuning const &)
Render calibration from tuning.
Definition: Calibration.cpp:168
int height() const
Return height of the buffer.
Definition: Buffer.h:137
RenderBuffer buffer_
Definition: Calibration.h:113
void withCurrentContext(ContextFunctor f)
Do OpenGL operations with current context, if it exists.
Definition: ContextSwitch.cpp:45
void primaryContextSwitch(ContextFunctor f)
Switch to primary context to create OpenGL objects like textures etc.
Definition: ContextSwitch.cpp:40
void * ptr()
Return void pointer to data.
Definition: Buffer.h:197
int width() const
Return width of the buffer.
Definition: Buffer.h:131
void omni::proj::Calibration::render ( Tuning const &  _tuning,
CalibrationMode  _mode 
)

Render calibration from tuning and set calibration mode.

185  {
186  mode_ = _mode;
187  render(_tuning);
188  }
void render(Tuning const &)
Render calibration from tuning.
Definition: Calibration.cpp:168
CalibrationMode mode_
Definition: Calibration.h:111
void omni::proj::Calibration::render ( Tuning const &  _tuning,
ContextBoundPtr< visual::Framebuffer32F > &  _framebuffer 
)

Render to framebuffer object.

Update visualizers

Initialize shaders

Initialize framebuffers

Init framebuffer only if it does not exist yet or if size has changed

1st Step: Render projectors view to framebuffer texture

39  {
40  using namespace visual;
41 
42  int _w = buffer_.width() <= 0 ? _tuning.width() : buffer_.width();
43  int _h = buffer_.height() <= 0 ? _tuning.height() : buffer_.height();
44  QSize _size(_w,_h);
45 
46  virtualScreen_ = !_tuning.screen(); // Screen is virtual when tuning has
47  // no screen
48  colorCorrection_ = _tuning.colorCorrection();
49  screenGeometry_ = _tuning.screenGeometry();
50  contentGeometry_ = _tuning.contentGeometry();
51  buffer_.resize(_w, _h);
52 
53  visual::Session *_sessionViz =
54  const_cast<omni::Session&>(_tuning.session()).makeVisualizer();
55  visual::Tuning *_tuningViz = const_cast<proj::Tuning&>(_tuning).makeVisualizer();
56 
57  static ContextBoundPtr<Framebuffer32F> _warpBuffer;
58  static ContextBoundPtr<Framebuffer32F> _blendBuffer;
59 
60  static ContextBoundPtr<QOpenGLShaderProgram> _mergeShader;
61  static ContextBoundPtr<QOpenGLShaderProgram> _shader;
62 
63  primaryContextSwitch([&](QOpenGLFunctions& _) {
64 
65  /// Update visualizers
66  _sessionViz->update();
67  _tuningViz->update();
68  _tuningViz->updateWarpBuffer(_sessionViz);
69  _tuningViz->updateBlendTexture();
70  _.glFlush();
71 
72  /// Initialize shaders
73  visual::initShader(_shader, "texture");
74  visual::initShader(_mergeShader, "merge");
75 
76  /// Initialize framebuffers
77 
78  /// Init framebuffer only if it does not exist yet or if size has changed
79  auto _initFramebuffer = [&](ContextBoundPtr<Framebuffer32F>& _fb) {
80  bool _reset = _fb ? _fb->size() != _size : true;
81  if (_reset) {
82  _fb.reset(new Framebuffer32F(_size));
83  }
84  };
85  _initFramebuffer(_warpBuffer);
86  _initFramebuffer(_blendBuffer);
87  _initFramebuffer(_framebuffer);
88 
89  _.glFlush();
90  });
91 
92 
93  /// 1st Step: Render projectors view to framebuffer texture
94  draw_on_framebuffer(_framebuffer.get(), [&](QOpenGLFunctions& _) {
95  // Projection operation
96  glMultMatrixf(_tuning.projector().projectionMatrix().constData());
97  }, [&](QOpenGLFunctions& _) {
98  // Model view operation
99  _.glClearColor(0.0,0.0,1.0,1.0);
100  _.glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
101  _.glEnable(GL_BLEND);
102  _.glEnable(GL_DEPTH_TEST);
103  _sessionViz->drawCanvas(_tuning.session().exportSettings().
104  mappingOutputMode());
105  _.glClearColor(0.0,0.0,0.0,0.0);
106  _.glFlush();
107  });
108 
109 
110  // 3th Step: Render blend mask
111  draw_on_framebuffer(_blendBuffer.get(), [&](
112  QOpenGLFunctions& _) {
113  // Projection operation
114  QMatrix4x4 _m;
115  _m.ortho(-0.5, 0.5, -0.5, 0.5, -1.0, 1.0);
116  glMultMatrixf(_m.constData()); }, [&](QOpenGLFunctions& _) {
117  _.glEnable(GL_BLEND);
118  _.glDisable(GL_DEPTH_TEST);
119  _.glClear(
120  GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
121  // Model view operation
122  _tuningViz->drawOutput();
123  _.glFlush();
124  });
125 
126  // 4rd step: Render warp grid
127  draw_on_framebuffer(_warpBuffer.get(), [&](
128  QOpenGLFunctions& _) {
129  // Projection operation
130  QMatrix4x4 _m;
131  _m.ortho(-0.5, 0.5, -0.5, 0.5, -1.0, 1.0);
132  glMultMatrixf(_m.constData());
133  }, [&](QOpenGLFunctions& _) {
134  _.glEnable(GL_BLEND);
135  _.glDisable(GL_DEPTH_TEST);
136  _.glClear(
137  GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
138  // Model view operation
139  useShader(*_shader, [&](visual::UniformHandler& _h) {
140  _h.texUniform("tex", _framebuffer->texture());
141  _tuningViz->drawWarpPatch();
142  });
143  _.glFlush();
144  });
145 
146  // 5th step: Merge blend and warp buffer
147  draw_on_framebuffer(_framebuffer.get(),[&](QOpenGLFunctions& _) {
148  // Projection operation
149  QMatrix4x4 _m;
150  _m.ortho(-0.5, 0.5, -0.5, 0.5, -1.0, 1.0);
151  glMultMatrixf(_m.constData());
152 
153  }, [&](QOpenGLFunctions& _) {
154  _.glEnable(GL_BLEND);
155  _.glDisable(GL_DEPTH_TEST);
156  _.glClear(
157  GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
158  // Model view operation
159  useShader(*_mergeShader, [&](visual::UniformHandler& _h) {
160  _h.texUniform("warp", _warpBuffer->texture());
161  _h.texUniform("blend", _blendBuffer->texture());
163  });
164  _.glFlush();
165  });
166  }
void draw_on_framebuffer(FRAMEBUFFER *_f, PROJECTION _p, MODELVIEW _m)
Draw into QOpenGLFramebufferObject with given projection and model.
Definition: util.h:103
A session consists of a canvas, a mapping, a list of tunings and one or several inputs.
Definition: Session.h:41
QRect screenGeometry_
Definition: Calibration.h:109
int height() const
Return height of the buffer.
Definition: Buffer.h:137
void initShader(QOpenGLShaderProgram &_s, const char *_filename)
Initialize shader: load from file and compile.
Definition: Shader.cpp:27
QRect contentGeometry_
Definition: Calibration.h:110
RenderBuffer buffer_
Definition: Calibration.h:113
bool virtualScreen_
Definition: Calibration.h:108
static void draw(float _left=-0.5, float _right=0.5, float _top=0.5, float _bottom=-0.5)
Draw rectangle from border coordinates.
Definition: Rectangle.cpp:28
void useShader(QOpenGLShaderProgram &_s, std::function< void(UniformHandler &)>f)
Use shader with and do uniform assignment and drawing inside functor.
Definition: Shader.cpp:59
void resize(int _width, int _height)
Resize buffer to given width and height.
Definition: Buffer.h:172
ColorCorrection colorCorrection_
Definition: Calibration.h:112
void primaryContextSwitch(ContextFunctor f)
Switch to primary context to create OpenGL objects like textures etc.
Definition: ContextSwitch.cpp:40
int width() const
Return width of the buffer.
Definition: Buffer.h:131
QSize omni::proj::Calibration::renderSize ( ) const

Return actual size of rendered output.

298  {
299  return QSize(buffer_.width(), buffer_.height());
300  }
int height() const
Return height of the buffer.
Definition: Buffer.h:137
RenderBuffer buffer_
Definition: Calibration.h:113
int width() const
Return width of the buffer.
Definition: Buffer.h:131
QRect const & omni::proj::Calibration::screenGeometry ( ) const

Return screen geometry rectangle.

290  {
291  return screenGeometry_;
292  }
QRect screenGeometry_
Definition: Calibration.h:109
void omni::proj::Calibration::setRenderSize ( QSize const &  _size)

Set new size for renderer output. Resets calibration.

302  {
303  buffer_.resize(_size.width(), _size.height());
304  }
RenderBuffer buffer_
Definition: Calibration.h:113
void resize(int _width, int _height)
Resize buffer to given width and height.
Definition: Buffer.h:172
QImage omni::proj::Calibration::toImage ( ) const

Render to image.

191  {
192  int _w = buffer_.width();
193  int _h = buffer_.height();
194 
195  if (!_w || !_h) return QImage();
196 
198  {
199  QImage _image(_w, _h, QImage::Format_RGB32);
200  bufferToImage(buffer_, _image,
201  [&](RGBAFloat const& _input, RGBAFloat const& _pixel)
202  {
203  return _pixel;
204  });
205  return _image;
206  }
207  else
208  {
209  QImage _upper8bit(_w, _h, QImage::Format_ARGB32);
210  getUpper8bit(_upper8bit);
211  QImage _lower8bit(_w, _h, QImage::Format_ARGB32);
212  getLower8bit(_lower8bit);
213 
214  // Encode color correction information into the green channel
215 
217  qDebug() << "CalibrationMode::TEXCOORDS";
218  getAlphaMask(_upper8bit, Channel::BLUE);
219  QImage _image(_w, _h * 2, QImage::Format_RGB32);
221  QPainter _p(&_image);
222  _p.drawImage(QPoint(0, 0), _upper8bit);
223  _p.drawImage(QPoint(0, _h), _lower8bit);
224  _p.end();
225  return _image;
226  }
227 
228  if (mode_ == CalibrationMode::UVW) {
229  qDebug() << "CalibrationMode::UVW";
230  QImage _blendMask(_w, _h, QImage::Format_ARGB32);
231  getAlphaMask(_blendMask);
232  QImage _image(_w, _h * 3, QImage::Format_RGB32);
234  QPainter _p(&_image);
235  _p.drawImage(QPoint(0, 0), _upper8bit);
236  _p.drawImage(QPoint(0, _h), _lower8bit);
237  _p.drawImage(QPoint(0, 2 * _h), _blendMask);
238  _p.end();
239  return _image;
240  }
241  }
242  return QImage();
243  }
void getUpper8bit(QImage &_image) const
Encode upper 8 bit of buffer into image.
Definition: Calibration.cpp:348
int height() const
Return height of the buffer.
Definition: Buffer.h:137
CalibrationMode mode_
Definition: Calibration.h:111
void encodeColorCorrection(QImage &, Channel) const
Encode color correction into selected image channel.
Definition: Calibration.cpp:435
RenderBuffer buffer_
Definition: Calibration.h:113
void getAlphaMask(QImage &_image, Channel=Channel::ALL) const
Encode alpha mask into selected channel.
Definition: Calibration.cpp:414
static void bufferToImage(RenderBuffer const &_buffer, QImage &_image, OPERATION _f)
Definition: Calibration.cpp:315
int width() const
Return width of the buffer.
Definition: Buffer.h:131
void getLower8bit(QImage &_image) const
Encode lower 8 bit of buffer into image.
Definition: Calibration.cpp:385
QImage omni::proj::Calibration::toPreviewImage ( ) const

Render to preview image.

245  {
246  int _w = buffer_.width();
247  int _h = buffer_.height();
248 
249  if (!_w || !_h) return QImage();
250 
252  {
253  QImage _image(_w, _h, QImage::Format_RGB32);
254  bufferToImage(buffer_, _image,
255  [&](RGBAFloat const& _input, RGBAFloat const& _pixel)
256  {
257  return _pixel;
258  });
259  return _image;
260  }
261  else
262  {
263  QImage _upper8bit(_w, _h, QImage::Format_ARGB32);
264  getUpper8bit(_upper8bit);
265 
266  // Encode color correction information into the green channel
267 
270  qDebug() << "CalibrationMode::TEXCOORDS";
271  getAlphaMask(_upper8bit, Channel::BLUE);
272  QImage _image(_w, _h, QImage::Format_RGB32);
273  QPainter _p(&_image);
274  _p.drawImage(QPoint(0, 0), _upper8bit);
275  _p.end();
276  return _upper8bit;
277  }
278  }
279  return QImage();
280  }
void getUpper8bit(QImage &_image) const
Encode upper 8 bit of buffer into image.
Definition: Calibration.cpp:348
int height() const
Return height of the buffer.
Definition: Buffer.h:137
CalibrationMode mode_
Definition: Calibration.h:111
RenderBuffer buffer_
Definition: Calibration.h:113
void getAlphaMask(QImage &_image, Channel=Channel::ALL) const
Encode alpha mask into selected channel.
Definition: Calibration.cpp:414
static void bufferToImage(RenderBuffer const &_buffer, QImage &_image, OPERATION _f)
Definition: Calibration.cpp:315
int width() const
Return width of the buffer.
Definition: Buffer.h:131
bool omni::proj::Calibration::virtualScreen ( ) const

Return true if screen is virtual.

310  {
311  return virtualScreen_;
312  }
bool virtualScreen_
Definition: Calibration.h:108

Friends And Related Function Documentation

friend class CalibrationRenderer
friend

Field Documentation

RenderBuffer omni::proj::Calibration::buffer_
private
ColorCorrection omni::proj::Calibration::colorCorrection_
private
QRect omni::proj::Calibration::contentGeometry_
private
CalibrationMode omni::proj::Calibration::mode_
private
QRect omni::proj::Calibration::screenGeometry_
private
bool omni::proj::Calibration::virtualScreen_ = true
private

The documentation for this class was generated from the following files: