function varargout = Applicazione(varargin)
% APPLICAZIONE M-file for Applicazione.fig
% APPLICAZIONE, by itself, creates a new APPLICAZIONE or raises the existing
% singleton*.
%
% H = APPLICAZIONE returns the handle to a new APPLICAZIONE or the handle to
% the existing singleton*.
%
% APPLICAZIONE('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in APPLICAZIONE.M with the given input arguments.
%
% APPLICAZIONE('Property','Value',...) creates a new APPLICAZIONE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Applicazione_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Applicazione_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help Applicazione
% Last Modified by GUIDE v2.5 04-Jan-2007 18:09:14
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Applicazione_OpeningFcn, ...
'gui_OutputFcn', @Applicazione_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before Applicazione is made visible.
function Applicazione_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Applicazione (see VARARGIN)
% Choose default command line output for Applicazione
handles.output = hObject;
handles.ImmagineCorrente=0;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Applicazione wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Applicazione_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --------------------------------------------------------------------
function MenuFileApri_Callback(hObject, eventdata, handles)
% hObject handle to MenuFileApri (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[NomeFileImmagine PercorsoFileImmagine]=uigetfile({
'*.jpeg;*.jpg', 'Immagine JPEG (*.jpg, *.jpeg)';
'*.bmp', 'Immagine BMP (*.bmp)'},'MultiSelect','off');
if ~isequal(PercorsoFileImmagine,0) && ~isequal(NomeFileImmagine,0)
PathCompletoImmagine=strcat(PercorsoFileImmagine,NomeFileImmagine);
Immagine=imread(PathCompletoImmagine);
handles.ImmagineCorrente=Immagine;
guidata(hObject,handles);
imtool(Immagine);
end
% --------------------------------------------------------------------
function MenuFileEsci_Callback(hObject, eventdata, handles)
% hObject handle to MenuFileEsci (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Risposta = ConfermaUscita();
switch lower(Risposta)
case 'no'
case 'si'
delete(handles.figure1)
end
% --------------------------------------------------------------------
function MenuEditInterpola_Callback(hObject, eventdata, handles)
% hObject handle to MenuEditInterpola (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function MenuEditInterpolaReplicazione_Callback(hObject, eventdata, handles)
% hObject handle to MenuEditInterpolaReplicazione (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
tic;
Replicazione=ControlloCentrale(handles.ImmagineCorrente,handles.Zoom,'Replicazione');
Tempo=toc;
imtool(Replicazione);
set(handles.TempoReplicazione,'String',['Replicazione: ' num2str(Tempo) 's']);
guidata(hObject,handles);
% --------------------------------------------------------------------
function MenuEditInterpolaBilineare_Callback(hObject, eventdata, handles)
% hObject handle to MenuEditInterpolaBilineare (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
tic;
Bilineare=ControlloCentrale(handles.ImmagineCorrente,handles.Zoom,'Bilineare');
Tempo=toc;
imtool(Bilineare);
set(handles.TempoBilineare,'String',['Bilineare: ' num2str(Tempo) 's']);
guidata(hObject,handles);
% --------------------------------------------------------------------
function MenuEditInterpolaBicubica_Callback(hObject, eventdata, handles)
% hObject handle to MenuEditInterpolaBicubica (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
tic;
Bicubica=ControlloCentrale(handles.ImmagineCorrente,handles.Zoom,'Bicubica');
Tempo=toc;
imtool(Bicubica);
set(handles.TempoBicubica,'String',['Bicubica: ' num2str(Tempo) 's']);
guidata(hObject,handles);
% --------------------------------------------------------------------
function MenuHelpAbout_Callback(hObject, eventdata, handles)
% hObject handle to MenuHelpAbout (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
msgbox('Programma creato dallo studente Salvo Danilo Giuffrida, B05/000145, per il seminario di Analisi Numerica, A.A. 2006/2007, relativo all''interpolazione per lo zooming di immagini digitali','Informazioni','Help','createMode')
% --------------------------------------------------------------------
function MenuFile_Callback(hObject, eventdata, handles)
% hObject handle to MenuFile (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function MenuEdit_Callback(hObject, eventdata, handles)
% hObject handle to MenuEdit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if handles.ImmagineCorrente==0
set(handles.MenuEditInterpola,'Enable','off');
else
set(handles.MenuEditInterpola,'Enable','on');
end
guidata(hObject, handles);
% --------------------------------------------------------------------
function MenuHelp_Callback(hObject, eventdata, handles)
% hObject handle to MenuHelp (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes during object creation, after setting all properties.
function SliderZoom_CreateFcn(h