Initial Folder Structure
authorGokul Kartha <everyourgokul@gmail.com>
Tue, 16 Nov 2010 19:16:59 +0000 (21:16 +0200)
committerGokul Kartha <everyourgokul@gmail.com>
Tue, 16 Nov 2010 19:16:59 +0000 (21:16 +0200)
Basic Application Files

17 files changed:
bin/photoenhancer [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
src/appwindow.cpp [new file with mode: 0644]
src/appwindow.h [new file with mode: 0644]
src/filterinterface.h [new file with mode: 0644]
src/filtermanager.cpp [new file with mode: 0644]
src/filtermanager.h [new file with mode: 0644]
src/main.cpp [new file with mode: 0644]
src/mainwindow.cpp [new file with mode: 0644]
src/mainwindow.h [new file with mode: 0644]
src/photoenahnacer.pro.user [new file with mode: 0644]
src/sepiafilter.cpp [new file with mode: 0644]
src/sepiafilter.h [new file with mode: 0644]
src/welcome [new file with mode: 0644]
src/workspace.cpp [new file with mode: 0644]
src/workspace.h [new file with mode: 0644]
welcome [deleted file]

diff --git a/bin/photoenhancer b/bin/photoenhancer
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/appwindow.cpp b/src/appwindow.cpp
new file mode 100644 (file)
index 0000000..aa2718b
--- /dev/null
@@ -0,0 +1,14 @@
+#include "appwindow.h"
+#include "workspace.h"
+#include <QDockWidget>
+AppWindow::AppWindow()
+{
+    QDockWidget *dockWidget = new QDockWidget(tr("Workspace"), this);
+        dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea |
+                                    Qt::RightDockWidgetArea);
+
+        addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
+    mWorkspace=new Workspace();
+     dockWidget->setWidget(mWorkspace);
+}
+
diff --git a/src/appwindow.h b/src/appwindow.h
new file mode 100644 (file)
index 0000000..eac97f8
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef APPWINDOW_H
+#define APPWINDOW_H
+#include <QMainWindow>
+class Workspace;
+class AppWindow:public QMainWindow
+{
+public:
+    AppWindow();
+
+private:
+    Workspace *mWorkspace;
+};
+
+#endif // APPWINDOW_H
diff --git a/src/filterinterface.h b/src/filterinterface.h
new file mode 100644 (file)
index 0000000..59d25ce
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef FILTERINTERFACE_H
+#define FILTERINTERFACE_H
+#include <QObject>
+#include <QImage>
+
+class FilterInterface:public QObject
+{
+public:
+    FilterInterface()
+    {
+
+    }
+    virtual void applyFilter(QImage &image)=0;
+    virtual void displayFilterConfig(){}
+};
+
+#endif // FILTERINTERFACE_H
diff --git a/src/filtermanager.cpp b/src/filtermanager.cpp
new file mode 100644 (file)
index 0000000..d290b4b
--- /dev/null
@@ -0,0 +1,5 @@
+#include "filtermanager.h"
+
+FilterManager::FilterManager()
+{
+}
diff --git a/src/filtermanager.h b/src/filtermanager.h
new file mode 100644 (file)
index 0000000..1809e55
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef FILTERMANAGER_H
+#define FILTERMANAGER_H
+
+#include "filterinterface.h"
+#include <QObject>
+#include <QMap>
+
+class FilterManager:public QObject
+{
+public:
+    FilterManager();
+    void loadFilters();
+private:
+    QMap<QString,FilterInterface*> mFilters;
+};
+
+#endif // FILTERMANAGER_H
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644 (file)
index 0000000..2edf9a0
--- /dev/null
@@ -0,0 +1,11 @@
+#include <QtGui/QApplication>
+#include "appwindow.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    AppWindow w;
+    w.show();
+
+    return a.exec();
+}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
new file mode 100644 (file)
index 0000000..49d64fc
--- /dev/null
@@ -0,0 +1,14 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
diff --git a/src/mainwindow.h b/src/mainwindow.h
new file mode 100644 (file)
index 0000000..c9fd6a9
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+namespace Ui {
+    class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+private:
+    Ui::MainWindow *ui;
+};
+
+#endif // MAINWINDOW_H
diff --git a/src/photoenahnacer.pro.user b/src/photoenahnacer.pro.user
new file mode 100644 (file)
index 0000000..266d04e
--- /dev/null
@@ -0,0 +1,113 @@
+<!DOCTYPE QtCreatorProject>
+<qtcreator>
+ <data>
+  <variable>ProjectExplorer.Project.ActiveTarget</variable>
+  <value type="int">0</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.EditorSettings</variable>
+  <valuemap type="QVariantMap">
+   <value key="EditorConfiguration.Codec" type="QByteArray">System</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value>
+   <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
+   <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
+   <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
+   <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+     <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+    </valuemap>
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+     <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+     <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+     <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+    </valuemap>
+    <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
+    <valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+     <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+     <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+      <value type="QString">clean</value>
+     </valuelist>
+     <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+    </valuemap>
+    <value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
+    <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+    <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/shakir/workspace/photoenahnacer-build-desktop</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+   </valuemap>
+   <valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+     <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+    </valuemap>
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+     <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+     <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+     <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+    </valuemap>
+    <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
+    <valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+     <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+     <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+      <value type="QString">clean</value>
+     </valuelist>
+     <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+    </valuemap>
+    <value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
+    <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+    <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Release</value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/shakir/workspace/photoenahnacer-build-desktop</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+   </valuemap>
+   <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value>
+   <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">photoenahnacer</value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
+    <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">photoenahnacer.pro</value>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
+    <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
+   </valuemap>
+   <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.TargetCount</variable>
+  <value type="int">1</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+  <value type="int">4</value>
+ </data>
+</qtcreator>
diff --git a/src/sepiafilter.cpp b/src/sepiafilter.cpp
new file mode 100644 (file)
index 0000000..ce240e4
--- /dev/null
@@ -0,0 +1,30 @@
+#include "sepiafilter.h"
+#include <QImage>
+#include <QColor>
+#include <QDebug>
+SepiaFilter::SepiaFilter()
+{
+}
+void SepiaFilter::applyFilter(QImage &image)
+{
+    int inputRed,inputGreen,inputBlue;
+    int outputRed,outputGreen,outputBlue;
+
+    for(int i=0;i<image.width();i++)
+        for(int j=0;j<image.height();j++)
+        {
+            QColor inPixel(image.pixel(i,j));
+            inputRed=inPixel.red();
+            inputBlue=inPixel.blue();
+            inputGreen=inPixel.green();
+            outputRed = (inputRed * .393) + (inputGreen *.769) + (inputBlue * .189);
+            outputGreen = (inputRed * .349) + (inputGreen *.686) + (inputBlue * .168);
+            outputBlue = (inputRed * .272) + (inputGreen *.534) + (inputBlue * .131);
+            if(outputBlue>255) outputBlue=255;
+            if(outputGreen>255) outputGreen=255;
+            if(outputRed>255) outputRed=255;
+            QColor outPixel(outputRed,outputGreen,outputBlue);
+            image.setPixel(i,j,outPixel.rgb());
+    }
+
+}
diff --git a/src/sepiafilter.h b/src/sepiafilter.h
new file mode 100644 (file)
index 0000000..05ca6e8
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef SEPIAFILTER_H
+#define SEPIAFILTER_H
+
+#include "filterinterface.h"
+class SepiaFilter:public FilterInterface
+{
+public:
+    SepiaFilter();
+    void applyFilter(QImage &image);
+
+};
+
+#endif // SEPIAFILTER_H
diff --git a/src/welcome b/src/welcome
new file mode 100644 (file)
index 0000000..ba4c514
--- /dev/null
@@ -0,0 +1 @@
+Welcome
diff --git a/src/workspace.cpp b/src/workspace.cpp
new file mode 100644 (file)
index 0000000..8901609
--- /dev/null
@@ -0,0 +1,33 @@
+#include "workspace.h"
+#include <QPainter>
+#include "sepiafilter.h"
+Workspace::Workspace(QWidget *parent) :
+    QWidget(parent)
+{
+    loadImage("/home/shakir/Desktop/Test/test1.jpg");
+}
+void  Workspace::loadImage(QString fileName)
+{
+    mImage=QImage(fileName);
+    SepiaFilter *filter=new SepiaFilter();
+    filter->applyFilter(mImage);
+
+}
+void  Workspace::zoomIn()
+{
+    mImage=mImage.scaledToHeight(mImage.height()*1.5);
+    mImage=mImage.scaledToWidth(mImage.width()*1.5);
+    update();
+}
+void  Workspace::zoomOut()
+{
+    mImage=mImage.scaledToHeight(mImage.height()*0.5);
+    mImage=mImage.scaledToWidth(mImage.width()*0.5);
+    update();
+}
+
+void  Workspace::paintEvent(QPaintEvent *p)
+{
+    QPainter painter(this);
+    painter.drawImage(mImage.rect(),mImage);
+}
diff --git a/src/workspace.h b/src/workspace.h
new file mode 100644 (file)
index 0000000..4fcb21f
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef WORKSPACE_H
+#define WORKSPACE_H
+
+#include <QWidget>
+
+class Workspace : public QWidget
+{
+    Q_OBJECT
+public:
+    explicit Workspace(QWidget *parent = 0);
+    void loadImage(QString fileName);
+    virtual void paintEvent(QPaintEvent *);
+signals:
+
+
+public slots:
+    void zoomIn();
+    void zoomOut();
+
+private:
+    QImage mImage;
+
+};
+
+#endif // WORKSPACE_H
diff --git a/welcome b/welcome
deleted file mode 100644 (file)
index ba4c514..0000000
--- a/welcome
+++ /dev/null
@@ -1 +0,0 @@
-Welcome