panosizeselector.hpp 1.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
// Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm

#pragma once

#include "libvideostitch-gui/utils/panoutilities.hpp"

#include <QWidget>

namespace Ui {
class PanoSizeSelector;
}

class VS_GUI_EXPORT PanoSizeSelector : public QWidget {
  Q_OBJECT

 public:
  enum class PanoramaSizePreset { Cinema4K, UltraHD, TwoK, HD, Unknown };
  static QString getPanoPresetName(PanoramaSizePreset preset);
  static QSize getPanoPresetSize(PanoramaSizePreset preset);
  static PanoramaSizePreset getPresetFromSize(int width, int height);

 public:
  explicit PanoSizeSelector(QWidget* parent = nullptr);
  ~PanoSizeSelector();

  void setSize(int width, int height);
  int getWidth() const;
  int getHeight() const;

 signals:
  void sizeChanged();

 private:
  void addPresetToComboBox(PanoramaSizePreset preset);
  void updateSizeSpinBoxes(VideoStitch::Util::PanoSize size);

 private slots:
  void updateSize();
  void onWidthChanged();
  void onHeightChanged();

 private:
  QScopedPointer<Ui::PanoSizeSelector> ui;
};