Enum Class Orientation

java.lang.Object
java.lang.Enum<Orientation>
dev.despical.pixelpainter.core.Orientation
All Implemented Interfaces:
Serializable, Comparable<Orientation>, Constable

public enum Orientation extends Enum<Orientation>
Maps top-to-bottom image pixels into vertical walls or horizontal floor art.

The origin is the bottom-left image block. Columns extend along the selected right vector; source row zero lies at the far end of the image-up vector. Vertical names identify the outward-facing normal of a wall.

  • Enum Constant Details

    • NORTH

      public static final Orientation NORTH
      North-facing wall, with image right pointing east.
    • SOUTH

      public static final Orientation SOUTH
      South-facing wall, with image right pointing west.
    • EAST

      public static final Orientation EAST
      East-facing wall, with image right pointing south.
    • WEST

      public static final Orientation WEST
      West-facing wall, with image right pointing north.
    • FLAT_NORTHEAST

      public static final Orientation FLAT_NORTHEAST
      Horizontal art extending right eastward and up northward.
    • FLAT_SOUTHEAST

      public static final Orientation FLAT_SOUTHEAST
      Horizontal art extending right eastward and up southward.
    • FLAT_NORTHWEST

      public static final Orientation FLAT_NORTHWEST
      Horizontal art extending right westward and up northward.
    • FLAT_SOUTHWEST

      public static final Orientation FLAT_SOUTHWEST
      Horizontal art extending right westward and up southward.
  • Method Details

    • values

      public static Orientation[] 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 Orientation 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
    • position

      public Position position(Position origin, int column, int row, int height)
      Maps a source pixel to a block coordinate relative to the bottom-left origin.
      Parameters:
      origin - bottom-left block
      column - zero-based image column
      row - zero-based image row counted from the top
      height - total image rows
      Returns:
      mapped coordinate; callers validate indices and world bounds
    • parse

      public static Orientation parse(String name)
      Parses current and legacy names, ignoring case, underscores and hyphens.
      Parameters:
      name - orientation name, optionally prefixed with Up
      Returns:
      recognized orientation
      Throws:
      IllegalArgumentException - if the name is unsupported