ImageFill

class ImageFill(domainWarpFunction: String = "vec2 if_domainWarp(vec2 p) { return p; }") : ShadeStyle(source)

Provides shaded rendering using an image as the fill for a shape or geometry.

The ImageFill class enables customization of how an image is applied as a fill, providing properties to control image source, scaling, positioning, and orientation. This is achieved through shader-based rendering, with configurable parameters for precise control over the resulting visual representation.

Image behavior is determined by the following properties:

  • image: The image to be used as the fill, represented as a ColorBuffer.

  • flipV: A flag to vertically flip the image. This is useful when the vertical orientation of the original image needs correction.

  • position: A Vector2 specifying the offset positioning for the image within the bounds of the shape.

  • useScreenBounds: When enabled, adjusts the image mapping to use the screen space bounds rather than the shape's bounds.

The rendering logic dynamically adjusts the image's aspect ratio and alignment, maintaining proportional scaling between the image and target bounds. This ensures correct rendering for shapes of varying sizes or orientations.

Constructors

Link copied to clipboard
constructor(domainWarpFunction: String = "vec2 if_domainWarp(vec2 p) { return p; }")

Properties

Link copied to clipboard
var attributes: MutableList<VertexBuffer>
Link copied to clipboard
open override val bufferAccess: MutableMap<String, BufferAccess>
Link copied to clipboard
open override val bufferFlags: MutableMap<String, Set<BufferFlag>>
Link copied to clipboard
open override val buffers: MutableMap<String, String>
Link copied to clipboard
open override val bufferTypes: MutableMap<String, String>
Link copied to clipboard
open override var bufferValues: MutableMap<String, Any>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var if_fillTransform: Matrix44
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var if_image: ColorBuffer
Link copied to clipboard
var if_position: Vector2
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val imageAccess: MutableMap<String, ImageAccess>
Link copied to clipboard
open override val imageArrayLength: MutableMap<String, Int>
Link copied to clipboard
open override val imageBindings: MutableMap<String, Int>
Link copied to clipboard
open override val imageFlags: MutableMap<String, Set<ImageFlag>>
Link copied to clipboard
open override val imageTypes: MutableMap<String, String>
Link copied to clipboard
open override val imageValues: MutableMap<String, Array<out ImageBinding>>
Link copied to clipboard
var outputs: ObservableHashmap<String, ShadeStyleOutput>
Link copied to clipboard
open override var parameterTypes: ObservableHashmap<String, String>
Link copied to clipboard
open override var parameterValues: MutableMap<String, Any>
Link copied to clipboard
Link copied to clipboard
open override var textureBaseIndex: Int
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun attributes(attributesBuffer: VertexBuffer)
Link copied to clipboard
open fun buffer(name: String, buffer: AtomicCounterBuffer)
open fun buffer(name: String, buffer: ShaderStorageBuffer)
Link copied to clipboard
open fun image(name: String, values: Array<out ImageBinding>)
open fun image(name: String, value: ImageBinding)
open fun image(name: String, arrayTextures: Array<ArrayTexture>, levels: Array<Int>)
open fun image(name: String, colorBuffers: Array<ColorBuffer>, levels: Array<Int>)
open fun image(name: String, cubemaps: Array<Cubemap>, levels: Array<Int>)
open fun image(name: String, volumeTextures: Array<VolumeTexture>, levels: Array<Int>)
open fun image(name: String, arrayCubemap: ArrayCubemap, level: Int)
open fun image(name: String, arrayTexture: ArrayTexture, level: Int)
open fun image(name: String, colorBuffer: ColorBuffer, level: Int)
open fun image(name: String, cubemap: Cubemap, level: Int)
open fun image(name: String, volumeTexture: VolumeTexture, level: Int)
Link copied to clipboard
open fun imageBindingType(value: ImageBinding): String
Link copied to clipboard
fun output(name: String, output: ShadeStyleOutput)
Link copied to clipboard
open fun <R : Any> Parameter(customName: String?, initialValue: R?): Parameter<R>
Link copied to clipboard
open fun parameter(name: String, value: ImageBinding)
open fun parameter(name: String, value: Array<ColorRGBa>)
open fun parameter(name: String, value: Array<Matrix33>)
open fun parameter(name: String, value: Array<Matrix44>)
open fun parameter(name: String, value: Array<Vector2>)
open fun parameter(name: String, value: Array<Vector3>)
open fun parameter(name: String, value: Array<Vector4>)
open fun parameter(name: String, value: Boolean)
open fun parameter(name: String, value: Double)
open fun parameter(name: String, value: DoubleArray)
open fun parameter(name: String, value: Float)
open fun parameter(name: String, value: Int)
open fun parameter(name: String, value: IntArray)
open fun parameter(name: String, value: ColorRGBa)
open fun parameter(name: String, value: ArrayCubemap)
open fun parameter(name: String, value: ArrayTexture)
open fun parameter(name: String, value: BufferTexture)
open fun parameter(name: String, value: ColorBuffer)
open fun parameter(name: String, value: Cubemap)
open fun parameter(name: String, value: DepthBuffer)
open fun parameter(name: String, value: VolumeTexture)
open fun parameter(name: String, value: BooleanVector2)
open fun parameter(name: String, value: BooleanVector3)
open fun parameter(name: String, value: BooleanVector4)
open fun parameter(name: String, value: IntVector2)
open fun parameter(name: String, value: IntVector3)
open fun parameter(name: String, value: IntVector4)
open fun parameter(name: String, value: Matrix33)
open fun parameter(name: String, value: Matrix44)
open fun parameter(name: String, value: Vector2)
open fun parameter(name: String, value: Vector3)
open fun parameter(name: String, value: Vector4)
Link copied to clipboard
operator fun plus(other: ShadeStyle): ShadeStyle
Link copied to clipboard
open fun StyleImageBindings.registerImageBinding(name: String, access: ImageAccess, flags: Set<ImageFlag>, arrayLength: Int)