forked from algebrato/PenguinSBIG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowimg.h
88 lines (76 loc) · 1.92 KB
/
showimg.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/****************************************************************************
** $Id: qt/showimg.h 3.3.3 edited May 27 2003 $
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of an example program for Qt. This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
#ifndef SHOWIMG_H
#define SHOWIMG_H
#include "csbigimg.h"
#include <qwidget.h>
#include <qimage.h>
#include <QScrollArea>
class QLabel;
class QMenuBar;
class QPopupMenu;
class MyScroller;
class ImageViewer : public QWidget
{
Q_OBJECT
public:
ImageViewer( QWidget *parent=0, const char *name=0, int wFlags=0 );
~ImageViewer();
bool loadImage( const QString& , bool bAutoContrast = FALSE);
void setImage (CSBIGImg *pImg);
protected:
void resizeEvent( QResizeEvent * );
void mouseMoveEvent( QMouseEvent * );
private:
void scale();
bool convertEvent( QMouseEvent* e, int& x, int& y);
CSBIGImg *pSbigImg;
QString filename;
QImage image; // the loaded image
QPixmap pm; // the converted pixmap
MyScroller *msp;
QMenuBar *menubar;
QPopupMenu *file;
QPopupMenu *savepixmap;
QPopupMenu *edit;
QPopupMenu *zoom;
QWidget *helpmsg;
QLabel *status;
int sp, sc, zz, ac, iv, si, sii; // menu item ids
int pickx, picky;
int imgZoom;
bool videoInverted;
void updateStatus();
void setMenuItemFlags();
bool reconvertImage();
void updateImageBits();
void deltaZoom();
void getZoomFactors(int &num, int&den);
void createPalette();
private slots:
void hFlip();
void vFlip();
void rot180();
void showContrast();
void showImageInfo();
void zoom4To1();
void zoom2To1();
void zoom1To1();
void zoom1To2();
void zoom1To4();
void autoContrast();
void inverseVideo();
void newWindow();
void openFile();
void savePixmap(int);
void saveImage();
void giveHelp();
};
#endif // SHOWIMG_H