Apollo  6.0
Open source self driving car software
fixedaspectratiowidget.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 
17 #pragma once
18 
19 #include <QtCore/QTimer>
20 #include <memory>
21 
23 
24 class FixedAspectRatioWidget : public QWidget {
25  Q_OBJECT
26 
27  public:
28  explicit FixedAspectRatioWidget(QWidget *parent = nullptr, int index = 0);
29 
30  bool is_init(void) const { return viewer_.is_init_; }
31  void SetupDynamicTexture(const std::shared_ptr<Texture> &textureObj);
32 
33  void set_index(int i) { index_ = i; }
34  int index(void) const { return index_; }
35 
36  void StartOrStopUpdate(bool b);
37  int innerHeight(void) { return viewer_.plane_.texHeight(); }
38 
39  signals:
41 
42  protected:
43  void mouseDoubleClickEvent(QMouseEvent *event) override;
44  void contextMenuEvent(QContextMenuEvent *) override;
45  void resizeEvent(QResizeEvent *) override;
46  void paintEvent(QPaintEvent *event) override;
47 
48  private:
49  int index_;
50  QTimer refresh_timer_;
51  VideoImgViewer viewer_;
52 };
Definition: video_image_viewer.h:28
void set_index(int i)
Definition: fixedaspectratiowidget.h:33
FixedAspectRatioWidget(QWidget *parent=nullptr, int index=0)
void SetupDynamicTexture(const std::shared_ptr< Texture > &textureObj)
bool is_init(void) const
Definition: fixedaspectratiowidget.h:30
void StartOrStopUpdate(bool b)
Definition: fixedaspectratiowidget.h:24
GLsizei texHeight(void) const
Definition: plane.h:48
void paintEvent(QPaintEvent *event) override
void mouseDoubleClickEvent(QMouseEvent *event) override
int innerHeight(void)
Definition: fixedaspectratiowidget.h:37
int index(void) const
Definition: fixedaspectratiowidget.h:34
void focusOnThis(FixedAspectRatioWidget *)
void resizeEvent(QResizeEvent *) override
void contextMenuEvent(QContextMenuEvent *) override