function [bildnummer,totbright,totcont,redbright,redcont,greenbright,greencont,bluebright,bluecont,minb,maxb]=ppara(filename,filepath)
%   ppara


%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.                                                                      

if nargin<2
    filepath = [];
end

if nargin<1
    [filename,filepath]=uigetfile('*.*','Bilddatei auswählen:');
    cd(pwd);
end




file=[filepath filename];
[picmat]=imread(file);
[picmat]=double(picmat)/255;
minb=min(min(min(picmat)));
maxb=max(max(max(picmat)));
picgroesse=size(picmat);
picvec=zeros(picgroesse(1)*picgroesse(2)*picgroesse(3),1);

bildnummerind=findstr(filename,'.');
bildnummer=filename(bildnummerind-4:bildnummerind+1);


%totbright
totbright=mean(mean(mean(picmat)));
redbright=mean(mean(picmat(:,:,1)));
greenbright=mean(mean(picmat(:,:,2)));
bluebright=mean(mean(picmat(:,:,3)));

nofpspercolor=picgroesse(1)*picgroesse(2);
nofpspercolumn=picgroesse(1);
%totcont
for i=1:picgroesse(3)
    for j=1:picgroesse(2)
    picvec((-1+i)*nofpspercolor+(-1+j)*nofpspercolumn+1:(-1+i)*nofpspercolor+(-1+j)*nofpspercolumn+nofpspercolumn)=picmat(:,j,i);
end 
end
totcont=var(picvec);
redcont=var(picvec(1:picgroesse(1)*picgroesse(2)));
greencont=var(picvec(picgroesse(1)*picgroesse(2)+1:2*picgroesse(1)*picgroesse(2)));
bluecont=var(picvec(2*picgroesse(1)*picgroesse(2)+1:3*picgroesse(1)*picgroesse(2)));


if nargin<1
    totbright
    totcont
end

return