'**SUMMARY**
Draw the blob, in the given color, to the appropriate layer
By default, this draws the entire blob filled in, with holes.  If you
provide a width, an outline of the exterior and interior contours is drawn.
**PARAMETERS**
* *color* -The color to render the blob as a color tuple.
* *alpha* - The alpha value of the rendered blob 0=transparent 255=opaque.
* *width* - The width of the drawn blob in pixels, if -1 then filled then the polygon is filled.
* *layer* - A source layer, if layer is not None, the blob is rendered to the layer versus the source image.
**RETURNS**
This method either works on the original source image, or on the drawing layer provided.
The method does not modify object itself.
**EXAMPLE**
>>> img = Image("lenna")
>>> blobs = img.findBlobs()
>>> blobs[-2].draw(color=Color.PUCE,width=-1,alpha=128)
>>> img.show()'

def draw(self, color=Color.GREEN, width=(-1), alpha=(-1), layer=None):

    if (not layer):
        layer = self.image.dl()
    if (width == (-1)):
        maskred = cv.CreateImage(cv.GetSize(self.mMask._getGrayscaleBitmap()), cv.IPL_DEPTH_8U, 1)
        maskgrn = cv.CreateImage(cv.GetSize(self.mMask._getGrayscaleBitmap()), cv.IPL_DEPTH_8U, 1)
        maskblu = cv.CreateImage(cv.GetSize(self.mMask._getGrayscaleBitmap()), cv.IPL_DEPTH_8U, 1)
        maskbit = cv.CreateImage(cv.GetSize(self.mMask._getGrayscaleBitmap()), cv.IPL_DEPTH_8U, 3)
        cv.ConvertScale(self.mMask._getGrayscaleBitmap(), maskred, (color[0] / 255.0))
        cv.ConvertScale(self.mMask._getGrayscaleBitmap(), maskgrn, (color[1] / 255.0))
        cv.ConvertScale(self.mMask._getGrayscaleBitmap(), maskblu, (color[2] / 255.0))
        cv.Merge(maskblu, maskgrn, maskred, None, maskbit)
        masksurface = Image(maskbit).getPGSurface()
        masksurface.set_colorkey(Color.BLACK)
        if (alpha != (-1)):
            masksurface.set_alpha(alpha)
        layer._mSurface.blit(masksurface, self.topLeftCorner())
    else:
        self.drawOutline(color, alpha, width, layer)
        self.drawHoles(color, alpha, width, layer)
