ContentAwareFillWatermarkOptions

Inheritance: java.lang.Object, com.aspose.imaging.watermark.options.WatermarkOptions

public class ContentAwareFillWatermarkOptions extends WatermarkOptions

Las opciones comunes del algoritmo Content Aware Fill.

Constructores

ConstructorDescripción
ContentAwareFillWatermarkOptions(Point[] mask)Inicializa una nueva instancia de la clase ContentAwareFillWatermarkOptions.
ContentAwareFillWatermarkOptions(GraphicsPath mask)Inicializa una nueva instancia de la clase ContentAwareFillWatermarkOptions.

Métodos

MétodoDescripción
getPatchSize()Obtiene el tamaño del parche (debe ser impar).
setPatchSize(byte value)Establece el tamaño del parche (debe ser impar).
getMaxPaintingAttempts()Obtiene el número máximo de intentos de pintado.
setMaxPaintingAttempts(int value)Establece el número máximo de intentos de pintado.
getInterestArea()Obtiene el área para tomar parches.
setInterestArea(Rectangle value)Establece el área para tomar parches.

Example: The example shows how to remove any object from the image using Graphics Path with Content Aware fill algorithm.

String imageFilePath = "ball.png"; 
try (Image image = Image.load(imageFilePath))
{
    PngImage pngImage = (PngImage)image;

    GraphicsPath mask = new GraphicsPath();
    Figure firstFigure = new Figure();
    firstFigure.addShape(new EllipseShape(new RectangleF(350, 170, 570 - 350, 400 - 170)));
    mask.addFigure(firstFigure);

    ContentAwareFillWatermarkOptions options = new ContentAwareFillWatermarkOptions(mask);
    options.setMaxPaintingAttempts(4);
    try (Image result = WatermarkRemover.paintOver(pngImage, options))
    {
        result.Save(outputPath);
    }
}

ContentAwareFillWatermarkOptions(Point[] mask)

public ContentAwareFillWatermarkOptions(Point[] mask)

Inicializa una nueva instancia de la clase ContentAwareFillWatermarkOptions.

Parameters:

ParámetroTipoDescripción
maskPoint[]La máscara para el área desconocida.

ContentAwareFillWatermarkOptions(GraphicsPath mask)

public ContentAwareFillWatermarkOptions(GraphicsPath mask)

Inicializa una nueva instancia de la clase ContentAwareFillWatermarkOptions.

Parameters:

ParámetroTipoDescripción
maskGraphicsPathLa máscara para el área desconocida.

getPatchSize()

public final byte getPatchSize()

Obtiene el tamaño del parche (debe ser impar).

Valor: El tamaño del parche.

Returns: byte - el tamaño del parche (debe ser impar).

setPatchSize(byte value)

public final void setPatchSize(byte value)

Establece el tamaño del parche (debe ser impar).

Valor: El tamaño del parche.

Parameters:

ParámetroTipoDescripción
valorbyteel tamaño del parche (debe ser impar).

getMaxPaintingAttempts()

public final int getMaxPaintingAttempts()

Obtiene el número máximo de intentos de pintado. El algoritmo elegirá la mejor variante.

Valor: El número máximo de intentos de pintura.

Returns: int - el número máximo de intentos de pintura.

Example: The example shows how to remove any object from the image using Graphics Path with Content Aware fill algorithm.

String imageFilePath = "ball.png"; 
try (Image image = Image.load(imageFilePath))
{
    PngImage pngImage = (PngImage)image;

    GraphicsPath mask = new GraphicsPath();
    Figure firstFigure = new Figure();
    firstFigure.addShape(new EllipseShape(new RectangleF(350, 170, 570 - 350, 400 - 170)));
    mask.addFigure(firstFigure);

    ContentAwareFillWatermarkOptions options = new ContentAwareFillWatermarkOptions(mask);
    options.setMaxPaintingAttempts(4);
    try (Image result = WatermarkRemover.paintOver(pngImage, options))
    {
        result.Save(outputPath);
    }
}

setMaxPaintingAttempts(int value)

public final void setMaxPaintingAttempts(int value)

Establece el número máximo de intentos de pintura. El algoritmo elegirá la mejor variante.

Valor: El número máximo de intentos de pintura.

Parameters:

ParámetroTipoDescripción
valorintel número máximo de intentos de pintura.

Example: The example shows how to remove any object from the image using Graphics Path with Content Aware fill algorithm.

String imageFilePath = "ball.png"; 
try (Image image = Image.load(imageFilePath))
{
    PngImage pngImage = (PngImage)image;

    GraphicsPath mask = new GraphicsPath();
    Figure firstFigure = new Figure();
    firstFigure.addShape(new EllipseShape(new RectangleF(350, 170, 570 - 350, 400 - 170)));
    mask.addFigure(firstFigure);

    ContentAwareFillWatermarkOptions options = new ContentAwareFillWatermarkOptions(mask);
    options.setMaxPaintingAttempts(4);
    try (Image result = WatermarkRemover.paintOver(pngImage, options))
    {
        result.Save(outputPath);
    }
}

getInterestArea()

public final Rectangle getInterestArea()

Obtiene el área para tomar parches.

Valor: El área de interés para tomar parches.

Returns: Rectangle - the area to take patches.

setInterestArea(Rectangle value)

public final void setInterestArea(Rectangle value)

Establece el área para tomar parches.

Valor: El área de interés para tomar parches.

Parameters:

ParámetroTipoDescripción
valueRectangleel área para tomar parches.