Barcode-Lib4J requires Java 11+

Enum Class «ImageTransform»

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

public enum ImageTransform extends Enum<ImageTransform>
Enumeration of supported image transformation types (rotations and mirroring).

Each transformation type has a unique integer ID which can be used for efficient storage in a file or database. The IDs are small non-negative integers (0-7) that can be safely cast to byte if needed. See getID() and valueOf(int id).

  • Enum Constant Details

    • ROTATE_0

      public static final ImageTransform ROTATE_0
      No rotation
    • ROTATE_90

      public static final ImageTransform ROTATE_90
      90 degrees clockwise rotation
    • ROTATE_180

      public static final ImageTransform ROTATE_180
      180 degrees rotation
    • ROTATE_270

      public static final ImageTransform ROTATE_270
      270 degrees clockwise rotation
    • ROTATE_0_FLIP

      public static final ImageTransform ROTATE_0_FLIP
      Horizontal flip (no rotation)
    • ROTATE_90_FLIP

      public static final ImageTransform ROTATE_90_FLIP
      90 degrees clockwise rotation with horizontal flip
    • ROTATE_180_FLIP

      public static final ImageTransform ROTATE_180_FLIP
      180 degrees rotation with horizontal flip
    • ROTATE_270_FLIP

      public static final ImageTransform ROTATE_270_FLIP
      270 degrees clockwise rotation with horizontal flip
  • Method Details

    • values

      public static ImageTransform[] 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 ImageTransform 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 ImageTransform 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 transform.
      Returns:
      the integer ID associated with this image transform
      See Also:
    • isFlat

      public boolean isFlat()
      Checks whether this transformation type represents a flat rotation (0° or 180°).

      This is a convenience method that can be used to determine whether the horizontal or vertical resolution of the output medium is relevant in a particular case.

      For 1D barcodes, which mainly consist of vertical bars, only one of the two resolutions is relevant. For example, when creating a 1D barcode at a 90° or 270° angle, the vertical resolution is crucial as the bar widths must be adjusted to it. Similarly, at a 0° or 180° angle, the horizontal resolution is important.

      (However, for 2D codes, if the output medium has differing horizontal and vertical resolutions, regardless of the transformation used, always use the smaller resolution. For example, in a setting of 300x600 DPI, use 300 DPI as the relevant resolution.)

      Returns:
      true if this transformation type represents a 0° or 180° rotation (ROTATE_0, ROTATE_180, ROTATE_0_FLIP, or ROTATE_180_FLIP), false otherwise (90° or 270° rotations)
    • hasFlip

      public boolean hasFlip()
      Checks whether this transformation type includes a horizontal flip (mirroring).
      Returns:
      true if this transformation includes a flip (ROTATE_0_FLIP, ROTATE_90_FLIP, ROTATE_180_FLIP, or ROTATE_270_FLIP), false otherwise