Record Class RenderSettings

java.lang.Object
java.lang.Record
ke.ric.renderer.api.RenderSettings
Record Components:
version - contract version; v1 requires 1
profile - stable quality intent that must be advertised by capabilities
width - output width in pixels
height - output height in pixels
attachments - requested optional per-pixel attachments
nativeMemoryLimitBytes - caller ceiling for native memory used by this job
workers - requested bounded native worker count
timeout - end-to-end render deadline starting at task creation

public record RenderSettings(int version, RenderSettings.Profile profile, int width, int height, Set<Attachment> attachments, long nativeMemoryLimitBytes, int workers, Duration timeout) extends Record
Immutable output, quality, attachment, memory, worker, and deadline settings for a render.
  • Field Details

    • DEFAULT_MEMORY_LIMIT

      public static final long DEFAULT_MEMORY_LIMIT
      Default per-job native-memory ceiling: 512 MiB.
      See Also:
  • Constructor Details

    • RenderSettings

      public RenderSettings(int version, RenderSettings.Profile profile, int width, int height, Set<Attachment> attachments, long nativeMemoryLimitBytes, int workers, Duration timeout)
      Creates an instance of a RenderSettings record class.
      Parameters:
      version - the value for the version record component
      profile - the value for the profile record component
      width - the value for the width record component
      height - the value for the height record component
      attachments - the value for the attachments record component
      nativeMemoryLimitBytes - the value for the nativeMemoryLimitBytes record component
      workers - the value for the workers record component
      timeout - the value for the timeout record component
  • Method Details

    • defaultWorkers

      public static int defaultWorkers()
      Returns a conservative worker count based on the current runtime.
    • defaults

      public static RenderSettings defaults()
      Creates Classic settings at 128 by 128 pixels, suitable for one Minecraft map. Uses no optional attachments, a 512 MiB memory ceiling, defaultWorkers() workers and a two-minute timeout. Provider limits still apply.
      Returns:
      immutable defaults; use withResolution(int, int) for another size
    • classic

      public static RenderSettings classic(int width, int height)
      Creates v1 Classic settings with no optional attachments, a 512 MiB memory ceiling, defaultWorkers() workers and a two-minute render timeout.
      Parameters:
      width - positive output width in pixels
      height - positive output height in pixels
      Returns:
      immutable settings; use capabilities to check the provider's supported output
    • withResolution

      public RenderSettings withResolution(int width, int height)
      Returns a copy changing only the output dimensions. Does not resize an already captured scene. Set the resolution before capture, and check the provider's supported dimensions.
      Parameters:
      width - positive output width in pixels
      height - positive output height in pixels
      Returns:
      immutable settings preserving quality, attachments and resource limits
      Throws:
      IllegalArgumentException - if either dimension is not positive
    • withAttachments

      public RenderSettings withAttachments(Set<Attachment> attachments)
      Returns a copy replacing optional attachments. RGBA8 is always included.
      Parameters:
      attachments - requested outputs advertised by provider capabilities; null means none
      Returns:
      immutable settings with a defensive attachment-set copy
    • withAttachments

      public RenderSettings withAttachments(Attachment first, Attachment... additional)
      Returns a copy replacing optional attachments without constructing a set. For example, withAttachments(Attachment.OBJECT_ID, Attachment.DEPTH). Duplicate attachments are included only once; RGBA8 is always included. Use withAttachments(Set) with an empty set to request none.
      Parameters:
      first - first requested output advertised by provider capabilities
      additional - any further requested outputs; copied, not retained
      Returns:
      immutable settings with exactly these optional attachments
      Throws:
      NullPointerException - if any attachment or the additional array is null
    • withProfile

      public RenderSettings withProfile(RenderSettings.Profile profile)
      Returns a copy with a different quality intent.
      Parameters:
      profile - non-null stable profile advertised by the provider
      Returns:
      copied settings with the new profile
    • withWorkers

      public RenderSettings withWorkers(int workers)
      Returns a copy requesting a bounded native worker count.
      Parameters:
      workers - positive worker count, not exceeding the provider's configured limit
      Returns:
      copied settings with the new worker request
    • withMemoryLimit

      public RenderSettings withMemoryLimit(long memoryLimitBytes)
      Returns a copy with a per-request memory ceiling; the provider's lower limit wins.
      Parameters:
      memoryLimitBytes - positive native-memory ceiling in bytes (not MiB)
      Returns:
      copied settings with the new memory ceiling
    • withTimeout

      public RenderSettings withTimeout(Duration timeout)
      Returns a copy with a positive timeout that fits in nanoseconds; null restores two minutes. Low-level tasks start this deadline at submission; RendererSession shares it across capture and render.
      Parameters:
      timeout - positive duration representable in nanoseconds, or null for two minutes
      Returns:
      copied settings with the new deadline duration
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • version

      public int version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • profile

      public RenderSettings.Profile profile()
      Returns the value of the profile record component.
      Returns:
      the value of the profile record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • attachments

      public Set<Attachment> attachments()
      Returns the value of the attachments record component.
      Returns:
      the value of the attachments record component
    • nativeMemoryLimitBytes

      public long nativeMemoryLimitBytes()
      Returns the value of the nativeMemoryLimitBytes record component.
      Returns:
      the value of the nativeMemoryLimitBytes record component
    • workers

      public int workers()
      Returns the value of the workers record component.
      Returns:
      the value of the workers record component
    • timeout

      public Duration timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component