Barcode-Lib4J requires Java 11+

Enum Class «ImageFormat»

java.lang.Object
java.lang.Enum<ImageFormat>
de.vwsoft.barcodelib4j.image.ImageFormat
All Implemented Interfaces:
Serializable, Comparable<ImageFormat>, Constable

public enum ImageFormat extends Enum<ImageFormat>
Enumeration of supported image formats (PDF, EPS, SVG, PNG, BMP, JPG).

Each format has a unique integer ID which can be used for efficient storage in a file or database. The IDs are small positive integers (1-6) that can be safely cast to byte if needed. See getID() and valueOf(int id).

  • Enum Constant Details

    • PDF

      public static final ImageFormat PDF
      Portable Document Format (PDF)
    • EPS

      public static final ImageFormat EPS
      Encapsulated PostScript (EPS)
    • SVG

      public static final ImageFormat SVG
      Scalable Vector Graphics (SVG)
    • PNG

      public static final ImageFormat PNG
      Portable Network Graphics (PNG)
    • BMP

      public static final ImageFormat BMP
      Bitmap (BMP)
    • JPG

      public static final ImageFormat JPG
      JPEG/JPG
  • Method Details

    • values

      public static ImageFormat[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ImageFormat valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • valueOf

      public static ImageFormat valueOf(int id)
      Returns the enum constant of this class associated with the specified integer ID.
      Parameters:
      id - the ID of the enum constant to be returned
      Returns:
      the enum constant associated with the specified ID
      Throws:
      IllegalArgumentException - if this enum class has no constant associated with the specified ID
    • getID

      public int getID()
      Returns the integer ID associated with this image format.
      Returns:
      the integer ID associated with this image format
      See Also:
    • isRasterFormat

      public boolean isRasterFormat()
      Checks whether this image format is a raster format.
      Returns:
      true if this format is a raster format (PNG, BMP, or JPG), false if it is a vector format (PDF, EPS, or SVG)
    • supportsTransparency

      public boolean supportsTransparency()
      Checks whether this image format supports transparent backgrounds.
      Returns:
      true if this format supports transparent backgrounds (PDF, EPS, SVG, or PNG), false otherwise (BMP or JPG)
    • supportsCMYK

      public boolean supportsCMYK()
      Checks whether this image format supports CMYK color model.

      Note: RGB color model is supported by all included formats.

      Returns:
      true if this format supports CMYK (PDF or EPS), false otherwise (SVG, PNG, BMP, or JPG)