File: imageviewer.h

package info (click to toggle)
apitrace 11.1%2Brepack-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 13,648 kB
  • sloc: cpp: 183,110; python: 33,685; ansic: 25,073; sh: 143; makefile: 88
file content (42 lines) | stat: -rw-r--r-- 827 bytes parent folder | download | duplicates (3)
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
#pragma once

#include "ui_imageviewer.h"
#include <QDialog>

class PixelWidget;
class QLabel;

namespace image {
    class Image;
}

class ImageViewer : public QDialog, public Ui_ImageViewer
{
    Q_OBJECT
public:
    ImageViewer(QWidget *parent = 0, bool opaque = false, bool alpha = false);
    ~ImageViewer();

    void setData(const QByteArray &data);

    QSize sizeHint() const override;

protected:
    void resizeEvent(QResizeEvent *event) override;

private slots:
    void slotUpdate();
    void showPixel(int, int);
    void showGrid(const QRect &rect);
    void zoomChangedDirectly();
    void zoomChangedIndirectly(double zoom);
    void zoomToFitChanged(int state);

private:
    void zoomToFit();

    image::Image *m_image;
    QImage m_convertedImage;
    PixelWidget *m_pixelWidget;
    bool m_zoomtoFit;
};