Image Editor: of Professor & Head, Department of IT, CBIT
Image Editor: of Professor & Head, Department of IT, CBIT
Image Editor: of Professor & Head, Department of IT, CBIT
BACHELOR OF ENGINEERING
IN
INFORMATION TECHNOLOGY
BY
KRISHNAVENI.T(0205-3006)
&
KANTHI.K.L.T(0205-3007)
CERTIFICATE
This is to certify that the project work entitled “ Image Editor” is a bonafide work
done and submitted by Krishnaveni.T(0205-3006) and Kanthi.K.L.T(0205-3007) , in
the partial fulfillment of the requirements for the award of Degree of Bachelor of
Engineering in Information Technology ,Chaitanya Bharathi Institute of
Technology, Affiliated to Osmania University,Hyderabad.
The results embodied in this report have not been submitted to any other
University or Institute for the award of any degree or diploma.
Project Guide
Dr.I.V.Ramana,
Professor & Head,
Dept of IT.,
CBIT,Hyderabad.
ACKNOWLEDGEMENTS
We would also like to express gratitude to Prof. Suresh Pabboju for his useful
inputs at every stage of our project.
There is definitely a need to thank our friends and parents, without whose
support project would have been deferred.
KRISHNAVENI.T(0205-3006)
KANTHI.K.L.T(0205-3007)
ABSTRACT
2.1.1 Purpose
Our application provides an editor to the user for viewing and performing
simple manipulations on images. It also provides some basic manipulations like
inverting the pixels in an image; transforming an image; zooming in and out for
detailed view; rotating and image; swapping the RGB components; performing fast
fourier transforms for a sharper and more accurate image and to fit the image to the
window size.
It lets the user accurately control the way images are scaled: user can zoom in and
out or automatically scale the image to fit the window. User can also rotate the
images by an angle of 90 degrees to the left or right.
Image manipulations
Our Image editor does not try to replace your favorite image editor, so it only
features the most simple image manipulations: rotation through mirroring and
inverting pixels. When working with JPEG files, it performs lossless
manipulations.
2.1.5 Constraints
The application is licensed under the GNU GPL. This is to ensure that the
users enjoy the freedom guaranteed by the GPL.
These freedoms apply to all the source code for all the modules your
software is based on. The freedoms also apply to any associated interface definition
files, and even include the scripts and control files used to control compilation and
installation of the executable; otherwise users could not exercise their rights.
The very minimum assumption made for this application is that the user
would be running this application on a system which has Qt 4.0. This assumption has
been made based on the fact that we require an X-server to successfully implement
graphics.
3. DESIGN USING UML
exit
transform
swapcolors
end user
invert
open
rotate
fit to window
zoom
request to open
an image
checks for
image
found?
displays file not
found
returns image
opens image for
image returned for viewing
further actions
zoom?
request to
zoom in or out
zoom out
rotate right
rotate left
request to
swap colors
image fitted to
window
colors
request to swapped
invert pixels
pixels inverted
request to
fast fourier
transform
transform applied
changed image
for viewing
void ImageViewer::createMenus()
{
fileMenu = new QMenu(tr("&File"), this);
fileMenu->addAction(openAct);
fileMenu->addAction(printAct);
fileMenu->addSeparator();
fileMenu->addAction(exitAct);
The QMenu class provides a menu widget for use in menu bars, context
menus, and other popup menus. The QMenuBar class provides a horizontal menu bar
that consists of a list of pull-down menu items. So at the end we put the menus in the
ImageViewer's menu bar which we retrieve with the QMainWindow::menuBar()
function.
scale the image displayed in the label. We also adjust the scroll bars to preserve the
focal point of the image.
At the end, if the scale factor is less than 33.3% or greater than 300%, we
disable the respective menu entry to prevent the image pixmap from becoming too
large, consuming too many resources in the window system.
You can connect as many signals as you want to a single slot, and a signal can be
connected to as many slots as you need. It is even possible to connect a signal directly
to another signal. Together, signals and slots make up a powerful component
programming mechanism.
Object Model:
The standard C++ object model provides very efficient runtime support for the object
paradigm. But its static nature is inflexible in certain problem domains. Graphical
user interface programming is a domain that requires both runtime efficiency and a
high level of flexibility. Qt provides this, by combining the speed of C++ with the
flexibility of the Qt Object Model.
Qt adds these features to C++:
--a very powerful mechanism for seamless object communication called signals and
slots
--query able and designable object properties
--powerful events and event filters
--contextual string translation for internationalization
--sophisticated interval driven timers that make it possible to elegantly integrate many
tasks in an event-driven GUI
--hierarchical and query able object trees that organize object ownership in a natural
way
guarded pointers (QPointer) that are automatically set to 0 when the referenced object
is destroyed, unlike normal C++ pointers which become dangling pointers when their
objects are destroyed
--a dynamic cast that works across library boundaries.
Layout Management:
The Qt layout system provides a simple and powerful way of specifying the layout of
child widgets. By specifying the logical layout once, we can do the following:
--Position the child widgets.
--Assign sensible default and minimum sizes for windows.
--Handle window resizing.
--Provide automatic update when contents change:
--Font size, text or other contents of child widgets.
--Hiding or showing a child widget.
--Removal of child widgets.
Layouts can be implemented in horizontal, vertical and grid formats. The above
mentioned features can be implemented using hand-written code.
Horizontal, Vertical, and Grid Layouts
The easiest way to give you widgets a good layout is to use the built-in layout
managers: QHBoxLayout, QVBoxLayout, and QGridLayout. These classes inherit
from QLayout, which in turn derives from QObject (not QWidget). They take care of
geometry management for a set of widgets. To create more complex layouts, you can
nest layout managers inside each other.
A QHBoxLayout lays out widgets in a horizontal row, from left to right (or right to
left for right-to-left languages).
When you use a layout, you don't need to pass a parent when constructing the child
widgets. The layout will automatically reparent the widgets (using
QWidget::setParent ()) so that they are children of the widget on which the layout is
installed.
Widgets in a layout are children of the widget on which the layout is installed, not of
the layout itself. Widgets can only have other widgets as parent, not layouts.
Plugin system:
qmake is a tool from Trolltech that helps simplify the build process for
created by the developer, and are usually simple, but more sophisticated project files
can be created for complex projects. qmake contains additional features to support
development with Qt, automatically including build rules for moc and uic. qmake can
also generate projects for Microsoft Visual studio without requiring the developer to
change the project file.