• Tidak ada hasil yang ditemukan

LISTING PROGRAM FORM PERTAMA :

N/A
N/A
Protected

Academic year: 2019

Membagikan "LISTING PROGRAM FORM PERTAMA :"

Copied!
16
0
0

Teks penuh

(1)

LISTING PROGRAM

FORM PERTAMA :

function varargout = pertama(varargin) gui_Singleton = 1; 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 pertama is made visible.

function pertama_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 pertama (see VARARGIN)

% Choose default command line output for pertama

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes pertama wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = pertama_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; handles.output = hObject ;

handles.citra=imread('usu.jpg'); guidata(hObject, handles);

(2)

imshow(handles.citra); guidata(hObject, handles);

% --- Executes on button press in button_Proses.

function button_Proses_Callback(hObject, eventdata, handles) proses;

close pertama;

% hObject handle to button_Proses (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 axes1_CreateFcn(hObject, eventdata, handles)

% hObject handle to axes1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% Hint: place code in OpeningFcn to populate axes1

% --- Executes on button press in button_bantuan.

function button_bantuan_Callback(hObject, eventdata, handles) bantuan;

close pertama;

% hObject handle to button_bantuan (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in button_tentang.

function button_tentang_Callback(hObject, eventdata, handles)

% hObject handle to button_tentang (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

(3)

FORM PROSES :

function varargout = proses(varargin) gui_Singleton = 1; 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 proses is made visible.

function proses_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 proses (see VARARGIN)

% Choose default command line output for proses

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes proses wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = proses_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;

% --- Executes on button press in button_pilih.

function button_pilih_Callback(hObject, eventdata, handles)

% hObject handle to button_pilih (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

(4)

global NamaFile;

[filename,pathname] = uigetfile({'*.bmp;*.jpg','File Gambar (*.bmp,*.jpg)'},'Pilih File');

NamaFile = strcat(pathname,'\',filename); [gbrAwal,Map] = imread(NamaFile);

axes(handles.axes1);

info = imfinfo([pathname,filename]); filesize = info.FileSize / 1024;

Flag = isrgb(gbrAwal);

Ukuran = [int2str(k) 'x' int2str(b)]; imshow(gbrAwal,Map);

set(handles.nama_file,'String',filename); set(handles.uk_file_asli,'String',Ukuran); set(handles.size_asli,'String',filesize);

% --- Executes on button press in button_kompresi.

function button_kompresi_Callback(hObject, eventdata, handles) start=tic;

(5)

set(handles.uk_dimensi_kompresi,'String',Ukuran); set(handles.lama_kompresi,'String',finish);

set(handles.rasio,'String',rasio);

% --- Executes on button press in button_simpan_komp.

function button_simpan_komp_Callback(hObject, eventdata, handles)

% hObject handle to button_simpan_komp (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

[fileName, pathName] = uiputfile({'*.bmp','File Bitmap(*.bmp)', '*.jpg','File JPEG(*.jpg)'},'Save Image'); if isequal([fileName, pathName], [0, 0])

return else

result = getimage(handles.axes2);

imwrite(result, strcat(pathName, fileName));

info=imfinfo([pathName, fileName]); size_hasil = info.FileSize / 1024

size_asli = str2num(get(handles.size_asli,'String')) rasio= (100-(size_hasil/size_asli*100))

set(handles.size_hasil1,'String',size_hasil) set(handles.rasio,'String',rasio)

end

% --- Executes on button press in button_simpan_dekompresi.

function button_simpan_dekompresi_Callback(hObject, eventdata, handles)

% hObject handle to button_simpan_dekompresi (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

[fileName, pathName] = uiputfile({'*.bmp','File Bitmap(*.bmp)', '*.jpg','File JPEG(*.jpg)'},'Save Image');

if isequal([fileName, pathName], [0, 0]) return

else

result = getimage(handles.axes3);

imwrite(result, strcat(pathName, fileName)); info=imfinfo([pathName, fileName]);

size_hasil = info.FileSize / 1024;

set(handles.size_hasil2,'String',size_hasil) end

% --- Executes on button press in button_waktu_dekompresi.

function button_waktu_dekompresi_Callback(hObject, eventdata, handles)

% hObject handle to button_waktu_dekompresi (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

global runTimeDekomp;

(6)

% --- Executes on button press in button_waktu_kompresi.

function button_waktu_kompresi_Callback(hObject, eventdata, handles)

% hObject handle to button_waktu_kompresi (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in rasio_citra.

function rasio_citra_Callback(hObject, eventdata, handles)

% hObject handle to rasio_citra (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in button_dekompresi.

function button_dekompresi_Callback(hObject, eventdata, handles) start=tic;

Ukuran = [int2str(k) 'x' int2str(b)];

set(handles.uk_dimensi_file,'String',Ukuran); finish=toc(start);

set(handles.lama_dekompresi,'String',finish);

%runTimeDekomp = cputime-runTimeDekomp;

% --- Executes on button press in button_batal.

function button_batal_Callback(hObject, eventdata, handles)

% hObject handle to button_batal (see GCBO)

(7)

axes(handles.axes1); cla reset;

set(handles.axes1,'XTick',[]); set(handles.axes1,'YTick',[]);

% --- Executes on button press in button_Keluar.

function button_Keluar_Callback(hObject, eventdata, handles)

% hObject handle to button_Keluar (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

selection=questdlg(['Keluar Aplikasi ' get(handles.figure1,'Name')''],...

['Keluar Aplikasi ' get(handles.figure1,'Name')''],... 'Ya','Tidak','Ya');

if strcmp(selection,'Tidak') return;

end

delete(handles.figure1)

% --- Executes during object creation, after setting all properties.

function size_asli_CreateFcn(hObject, eventdata, handles)

% hObject handle to size_asli (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white'); end

function size_hasil1_Callback(hObject, eventdata, handles)

% hObject handle to size_hasil1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of size_hasil1 as text

% str2double(get(hObject,'String')) returns contents of size_hasil1 as a double

% --- Executes during object creation, after setting all properties.

function size_hasil1_CreateFcn(hObject, eventdata, handles)

% hObject handle to size_hasil1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

(8)

% See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white'); end

function size_hasil2_Callback(hObject, eventdata, handles)

% hObject handle to size_hasil2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of size_hasil2 as text

% str2double(get(hObject,'String')) returns contents of size_hasil2 as a double

% --- Executes during object creation, after setting all properties.

function size_hasil2_CreateFcn(hObject, eventdata, handles)

% hObject handle to size_hasil2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white'); end

% --- Executes on button press in button_pertama.

function button_pertama_Callback(hObject, eventdata, handles)

% hObject handle to button_pertama (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

pertama

close proses;

% --- Executes on button press in button_bantuan.

function button_bantuan_Callback(hObject, eventdata, handles)

% hObject handle to button_bantuan (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

bantuan

close proses;

function size_asli_Callback(hObject, eventdata, handles)

% hObject handle to size_asli (see GCBO)

(9)

% Hints: get(hObject,'String') returns contents of size_asli as text % str2double(get(hObject,'String')) returns contents of

size_asli as a double

% --- Executes on button press in button_tentang.

function button_tentang_Callback(hObject, eventdata, handles)

% hObject handle to button_tentang (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

tentang_aplikasi close proses;

% --- Executes on button press in MSE1.

function MSE1_Callback(hObject, eventdata, handles)

% hObject handle to MSE1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Baca Gambar Uji

global gbrAwal;

%Baca Citra Hasil

CitraHasil = getimage(handles.axes2); [mseval] = MSE(gbrAwal,CitraHasil); set(handles.nilai_MSE,'String',mseval);

% --- Executes on button press in MSE2.

function MSE2_Callback(hObject, eventdata, handles)

% hObject handle to MSE2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Baca Gambar Uji

global gbrAwal;

%Baca Citra Hasil

(10)

FORM BANTUAN :

function varargout = bantuan(varargin) gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @bantuan_OpeningFcn, ... 'gui_OutputFcn', @bantuan_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 bantuan is made visible.

function bantuan_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 bantuan (see VARARGIN)

(11)

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes bantuan wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = bantuan_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;

% --- Executes on selection change in listbox1.

function listbox1_Callback(hObject, eventdata, handles)

% hObject handle to listbox1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns listbox1 contents as cell array

% contents{get(hObject,'Value')} returns selected item from listbox1

% --- Executes during object creation, after setting all properties.

function listbox1_CreateFcn(hObject, eventdata, handles)

% hObject handle to listbox1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% Hint: listbox controls usually have a white background on Windows. % See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white'); end

% --- Executes on button press in pushbutton1.

function pushbutton1_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

selection=questdlg(['Keluar Aplikasi ' get(handles.figure1,'Name')''],...

['Keluar Aplikasi ' get(handles.figure1,'Name')''],... 'Ya','Tidak','Ya');

(12)

return; end

delete(handles.figure1)

% --- Executes on button press in pushbutton2.

function pushbutton2_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

pertama

close bantuan;

% --- Executes on button press in pushbutton3.

function pushbutton3_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton3 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

proses

close bantuan;

% --- Executes on button press in button_tentang.

function button_tentang_Callback(hObject, eventdata, handles)

% hObject handle to button_tentang (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

(13)

FORM TENTANG APLIKASI :

function varargout = tentang_aplikasi(varargin) gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @tentang_aplikasi_OpeningFcn, ...

'gui_OutputFcn', @tentang_aplikasi_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 tentang_aplikasi is made visible.

function tentang_aplikasi_OpeningFcn(hObject, eventdata, handles, varargin)

% This function has no output args, see OutputFcn. % hObject handle to figure

(14)

% Choose default command line output for tentang_aplikasi

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes tentang_aplikasi wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = tentang_aplikasi_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;

% --- Executes on button press in button_keluar.

function button_keluar_Callback(hObject, eventdata, handles)

% hObject handle to button_keluar (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in button_proses.

function button_proses_Callback(hObject, eventdata, handles)

% hObject handle to button_proses (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

proses

close tentang_aplikasi

% --- Executes on button press in button_pertama.

function button_pertama_Callback(hObject, eventdata, handles)

% hObject handle to button_pertama (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

pertama

close tentang_aplikasi;

% --- Executes on button press in button_bantuan.

function button_bantuan_Callback(hObject, eventdata, handles)

% hObject handle to button_bantuan (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

bantuan

(15)

CURRICULUM VITAE

Nama

: Winda Dian Luca Hsb

Tempat/Tanggal Lahir : Medan, 17 Juli 1991

Agama

: Islam

Alamat Sekarang

: Jl. Sei Mencirim gang. Ingat No.4c Kp.lalang 20352

Alamat Orang Tua

: Jl. Sei Mencirim gang. Ingat No.4c Kp.lalang 20352

Telp/ Hp

: 081375200208

Email

: [email protected]

Riwayat Pendidikan

2009 – 2013

: S1 Ilmu Komputer Universitas Sumatera Utara, Medan

2006 – 2009

: SMA Swasta Al-Azhar Medan

2003 – 2006

: SMP Negeri 1 Medan

1997 – 2003

: SD Swasta Kartika Jaya Medan

Pengalaman Organisasi dan Kegiatan Ilmiah

Anggota Departemen Hubungan Masyarakat Ikatan Mahasiswa S1 Ilmu

Komputer (IMILKOM), 2010-2011

(16)

Referensi

Dokumen terkait

% 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 Data2

% hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB.. % handles structure with handles and user data

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of

% 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 UjiLVQ

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA). % Hints: get(hObject,'String') returns contents

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% hObject handle to tombolKeluar (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB. % handles structure with handles and user data (see

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA).. set(handles.pushbutton14, 'enable' , 'off'