function [tranobr] = pocaslin(a, b, c, d, obrazek)
% funkce provede po castech linearni transformaci obrazku 'obrazek'. Po
% castech linearni transformace je zadana parametry a, b, c, d takto:
% 
% d                   /-------------------
%                    /
%                   /
%                  /
%                 /
% c--------------/
%     
% 
% 0------------------------------------------>jas_netransformovany
%                a     b

for i=1:length(obrazek(:,1))
    for j=1:length(obrazek(1,:))
        if obrazek(i,j) < a
            tranobr(i,j) = c;
        elseif obrazek(i,j) > b
            tranobr(i,j) = d;
        else 
            tranobr(i,j) = ((d-c)/(b-a))*(obrazek(i,j)-a)+c;
        end;
    end;
end;
        