Package ke.ric.renderer.api
Record Class RenderSettings
java.lang.Object
java.lang.Record
ke.ric.renderer.api.RenderSettings
- Record Components:
version- contract version; v1 requires1profile- stable quality intent that must be advertised by capabilitieswidth- output width in pixelsheight- output height in pixelsattachments- requested optional per-pixel attachmentsnativeMemoryLimitBytes- caller ceiling for native memory used by this jobworkers- requested bounded native worker counttimeout- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumStable consumer-facing quality intents; implementations may choose their internal settings. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault per-job native-memory ceiling: 512 MiB. -
Constructor Summary
ConstructorsConstructorDescriptionRenderSettings(int version, RenderSettings.Profile profile, int width, int height, Set<Attachment> attachments, long nativeMemoryLimitBytes, int workers, Duration timeout) Creates an instance of aRenderSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattachmentsrecord component.static RenderSettingsclassic(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.static RenderSettingsdefaults()Creates Classic settings at 128 by 128 pixels, suitable for one Minecraft map.static intReturns a conservative worker count based on the current runtime.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.longReturns the value of thenativeMemoryLimitBytesrecord component.profile()Returns the value of theprofilerecord component.timeout()Returns the value of thetimeoutrecord component.final StringtoString()Returns a string representation of this record class.intversion()Returns the value of theversionrecord component.intwidth()Returns the value of thewidthrecord component.withAttachments(Set<Attachment> attachments) Returns a copy replacing optional attachments.withAttachments(Attachment first, Attachment... additional) Returns a copy replacing optional attachments without constructing a set.withMemoryLimit(long memoryLimitBytes) Returns a copy with a per-request memory ceiling; the provider's lower limit wins.withProfile(RenderSettings.Profile profile) Returns a copy with a different quality intent.withResolution(int width, int height) Returns a copy changing only the output dimensions.withTimeout(Duration timeout) Returns a copy with a positive timeout that fits in nanoseconds; null restores two minutes.withWorkers(int workers) Returns a copy requesting a bounded native worker count.intworkers()Returns the value of theworkersrecord component.
-
Field Details
-
DEFAULT_MEMORY_LIMIT
public static final long DEFAULT_MEMORY_LIMITDefault 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 aRenderSettingsrecord class.- Parameters:
version- the value for theversionrecord componentprofile- the value for theprofilerecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord componentattachments- the value for theattachmentsrecord componentnativeMemoryLimitBytes- the value for thenativeMemoryLimitBytesrecord componentworkers- the value for theworkersrecord componenttimeout- the value for thetimeoutrecord component
-
-
Method Details
-
defaultWorkers
public static int defaultWorkers()Returns a conservative worker count based on the current runtime. -
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
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 pixelsheight- positive output height in pixels- Returns:
- immutable settings; use capabilities to check the provider's supported output
-
withResolution
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 pixelsheight- positive output height in pixels- Returns:
- immutable settings preserving quality, attachments and resource limits
- Throws:
IllegalArgumentException- if either dimension is not positive
-
withAttachments
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
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. UsewithAttachments(Set)with an empty set to request none.- Parameters:
first- first requested output advertised by provider capabilitiesadditional- 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
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
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
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
Returns a copy with a positive timeout that fits in nanoseconds; null restores two minutes. Low-level tasks start this deadline at submission;RendererSessionshares 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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
version
public int version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
profile
Returns the value of theprofilerecord component.- Returns:
- the value of the
profilerecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
attachments
Returns the value of theattachmentsrecord component.- Returns:
- the value of the
attachmentsrecord component
-
nativeMemoryLimitBytes
public long nativeMemoryLimitBytes()Returns the value of thenativeMemoryLimitBytesrecord component.- Returns:
- the value of the
nativeMemoryLimitBytesrecord component
-
workers
public int workers()Returns the value of theworkersrecord component.- Returns:
- the value of the
workersrecord component
-
timeout
Returns the value of thetimeoutrecord component.- Returns:
- the value of the
timeoutrecord component
-