You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: Brush.m
    path of file: ./repos/ImageM/ImageM/+imagem/+tools
    
    the code of the file until where you have to start completion: classdef Brush < imagem.gui.Tool
% Draw on current image using current brush and 'color'.
%
%   output = BrushTool(input)
%
%   Example
%   BrushTool
%
%   See also
%

% ------
% Author: David Legland
% e-mail: david.legland@inrae.fr
% Created: 2011-11-21,    using Matlab 7.9.0.529 (R2009b)
% Copyright 2011 INRAE - Cepia Software Platform.

%% Properties
properties
    ButtonPressed = false;

    PreviousPoint;
end

%% Constructor
methods
    function obj = Brush(parent, varargin)
        % Creates a new tool using parent gui and a name
         obj = obj@imagem.gui.Tool(parent, 'brush');
    end % constructor 

end % construction function

%% Gener
    
function drawBrushLine(obj, coord1, coord2, iz, ic, it)
       [x, y] = imagem.tools.Brush.intline(coord1(1), coord1(2), coord2(1), coord2(2));
       
       % iterate on current line
       for i = 1 : length(x)
           drawBrush(obj, [x(i) y(i)], iz, ic, it);
       end
   end
   
   function drawColorBrushLine(obj, coord1, coord2, iz, it)
       [x, y] = imagem.tools.Brush.intline(coord1(1), coord1(2), coord2(1), coord2(2));
       
       % iterate on current line
       for i = 1 : length(x)
           drawColorBrush(obj, [x(i) y(i)], iz, it);
       end
   end
   
   function drawBrush(obj, coord, iz, ic, it)
       doc  = obj.Viewer.Doc;
       
       % brush size in each direction
       bs = obj.Viewer.Gui.App.BrushSize;
       bs1 = floor((bs-1) / 2);
       bs2 = ceil((bs-1) / 2);
       
       % compute bounds
       dim = size(doc.Image);
       x1 = max(coord(1)-bs1, 1);
       y1 = max(coord(2)-bs1, 1);
       x2 = min(coord(1)+bs2, dim(1));
       y2 = min(coord(2)+bs2, dim(2));
       
       % iterate on brush pixels
       for ix = x1:x2
           for iy = y1:y2
               doc.Image.Data(ix, iy, iz, ic, it) = obj.Viewer.Gui.App.BrushValue;
           end