Allink
v0.1
|
00001 #ifndef DREFFECT_H 00002 #define DREFFECT_H 00003 00004 #include <qapplication.h> 00005 #include <qwidget.h> 00006 #include <qtimer.h> 00007 #include <qpainter.h> 00008 #include <qpixmap.h> 00009 #include <qdatetime.h> 00010 #include <qslider.h> 00011 #include <qlabel.h> 00012 //#include <qvbox.h> 00013 #include <Q3VBox> 00014 #include <stdlib.h> 00015 #include <math.h> 00016 #include <qerrormessage.h> 00017 #include <qmessagebox.h> 00018 #include <qstatusbar.h> 00019 //#include <qpointarray.h> 00020 #include <Q3PointArray> 00021 #include <qimage.h> 00022 #include <qpixmap.h> 00023 #include <qevent.h> 00024 #include <qprinter.h> 00025 //#include <qpaintdevicemetrics.h> 00026 #include <Q3PaintDeviceMetrics> 00027 #include <Q3ButtonGroup> 00028 #include <QGLWidget> 00029 #include <QLineEdit> 00030 //#include <QMenuBar> 00031 #include "../include/Matematica.h" 00032 #include "../include/Draw.h" 00033 #include "../include/VarDatFile.h" 00034 00035 class DrEffect:public Draw{ 00036 private: 00037 public: 00038 DrEffect(); 00040 void EffectFilter(); 00042 void EffectMotion(); 00044 void EffectMC(); 00046 void EffectCoarseGrain(int Grana); 00048 void EffectIncrease(); 00050 void Run(); 00051 void Initialize(); 00052 void Histo(); 00053 void NablaPhi(); 00054 void BlackWhite(); 00055 void DReshape(int weight,int height); 00056 void DrEkeyboard(unsigned char key); 00057 void PrintIntensity(); 00058 int Contrast(); 00059 int Binary(int Mode); 00060 int Noise(unsigned char *Picture,unsigned char *OutPicture,int width,int height); 00061 int SwapBlocks(unsigned char *Picture,unsigned char *OutPicture,int width,int height,PERMUTE *Perm,int NGridw,int NGridh,int *Sequence1,int NPartition); 00062 int ShiftBlocks(unsigned char *Picture,unsigned char *OutPicture,int width,int height,int *Sequence,int NGridw,int NGridh,int *Sequence1,int NPartition); 00063 int Discretize(unsigned char *Picture,unsigned char *OutPicture,int ImWidth,int ImHeight,int WWidth,int WHeight,int Blockw,int Blokh); 00064 int Edges(unsigned char *Picture,unsigned char *OutPicture,int width,int height); 00065 int IncreaseResolution(unsigned char *Picture,unsigned char *OutPicture,int ImWidth,int ImHeight,int Times); 00066 int BuffSize(){return ImWidth*ImHeight;}; 00067 int NChar; 00068 Matematica *Mat; 00069 unsigned char Median[4]; 00070 unsigned char Quart1[4]; 00071 unsigned char Quart3[4]; 00072 double **Hist; 00073 double **Phi; 00074 int **Patch; 00075 }; 00076 class Animation : public QGLWidget 00077 { 00078 Q_OBJECT 00079 public slots: 00080 void setXRotation(int angle); 00081 void setYRotation(int angle); 00082 void setZRotation(int angle); 00083 void NomeFile(const QString &); 00084 void NomeFile(char *ExtName); 00085 void Open(); 00086 void Filter(); 00087 void Motion(); 00088 void Run(); 00089 void FilterMC(); 00090 void ImpGrana(int Grana); 00091 void FilterCoarseGrain(); 00092 void FilterIncrease(); 00093 void FilterContrast(); 00094 void Histo(); 00095 void NablaPhi(); 00096 void BlackWhite(); 00097 void Binary(); 00098 void Punta(); 00099 void IncrSlide(); 00100 signals: 00101 void xRotationChanged(int angle); 00102 void yRotationChanged(int angle); 00103 void zRotationChanged(int angle); 00104 void PuntaCoord(VarDatFile *v1); 00105 void PuntaCoord(double **,int,int,int); 00106 public: 00107 Animation(QWidget *parent); 00108 void InitConstant(); 00109 void Menu(); 00110 void Particle(); 00111 void keyboard(unsigned char key, int x, int y); 00112 VarDatFile *v1; 00113 double **st; 00114 private: 00115 void DrMessage(const char * s, ...); 00116 char *FileName; 00117 double ScaleUn; 00118 double Edge[3]; 00119 int xRot; 00120 int yRot; 00121 int zRot; 00122 int Grana; 00123 int Slide; 00124 int NMass; 00125 int NVar; 00126 int Valori; 00127 QPoint lastPos; 00128 int MainWindow; 00129 protected: 00130 virtual void initializeGL(); 00131 virtual void paintEvent(QPaintEvent (event)); 00132 virtual void paintGL(); 00133 virtual void resizeGL(int width,int height); 00134 void mousePressEvent(QMouseEvent *event); 00135 void mouseMoveEvent(QMouseEvent *event); 00136 }; 00137 00138 00139 00140 00141 #endif//DREFFECT