org.apache.xmlgraphics.image.loader.impl

## Class AbstractImageConverter

- java.lang.Object
- - org.apache.xmlgraphics.image.loader.impl.AbstractImageConverter

- All Implemented Interfaces:
    ImageConverter
  Direct Known Subclasses:
    ImageConverterBitmap2G2D, ImageConverterBuffered2Rendered, ImageConverterG2D2Bitmap, ImageConverterRendered2PNG

      public abstract class AbstractImageConverter
      extends java.lang.Object
      implements ImageConverter

  Abstract base class for ImageConverter implementations.

- - ### Field Summary

    - ### Fields inherited from interface org.apache.xmlgraphics.image.loader.spi.ImageConverter

      `MEDIUM_CONVERSION_PENALTY, MINIMAL_CONVERSION_PENALTY, NO_CONVERSION_PENALTY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractImageConverter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkSourceFlavor(Image img)` Checks if the source flavor of the given image is compatible with this ImageConverter.
    `int` | `getConversionPenalty()` Returns the conversion penalty for the conversion that this implementation supports.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.xmlgraphics.image.loader.spi.ImageConverter

      `convert, getSourceFlavor, getTargetFlavor`

- - ### Constructor Detail

    - #### AbstractImageConverter

          public AbstractImageConverter()

  - ### Method Detail

    - #### checkSourceFlavor

          protected void checkSourceFlavor(Image img)

      Checks if the source flavor of the given image is compatible with this ImageConverter.
      Parameters:
        `img` - the image to check

    - #### getConversionPenalty

          public int getConversionPenalty()

      Returns the conversion penalty for the conversion that this implementation supports.
      Specified by:
        `getConversionPenalty` in interface `ImageConverter`
      Returns:
        the conversion penalty (must be a non-negative integer)

Copyright 1999-2025 The Apache Software Foundation. All Rights Reserved.