Module: byteink-kit. Conventions. Signatures and defaults follow the current source.
ViveBrushes
ViveBrushes
Families: marker, dashed-line, highlighter, pressure-pen, calligraphy-v1-p0 through p5. Unknown IDs render as pressure-pen; original metadata is preserved.
public object ViveBrushes
Source
ViveBrushes.MARKER
public const val MARKER: String = "marker"
Source
ViveBrushes.DASHED_LINE
public const val DASHED_LINE: String = "dashed-line"
Source
ViveBrushes.HIGHLIGHTER
public const val HIGHLIGHTER: String = "highlighter"
Source
ViveBrushes.PRESSURE_PEN
public const val PRESSURE_PEN: String = "pressure-pen"
Source
ViveBrushes.MAX_CALLIGRAPHY_PRESSURE
public const val MAX_CALLIGRAPHY_PRESSURE: Int = 5
Source
ViveBrushes.DEFAULT_CALLIGRAPHY_PRESSURE
public const val DEFAULT_CALLIGRAPHY_PRESSURE: Int = 3
Source
ViveBrushes.MAX_STABILIZATION
public const val MAX_STABILIZATION: Int = 5
Source
ViveBrushes.BRUSH_VERSION
public const val BRUSH_VERSION: Int = 1
Source
ViveBrushes.EPSILON
public const val EPSILON: Float = 0.25f
Source
ViveBrushes.calligraphy
public fun calligraphy(pressure: Int): String
| Parameter |
Type |
Default |
Meaning |
pressure |
Int |
Required |
Measured finite pressure in [0, 1], or null when unavailable; Int brush levels use 0–5. |
Source
ViveBrushes.penFamilyId
public fun penFamilyId(solidLine: Boolean, fountain: Boolean, pressure: Int): String
| Parameter |
Type |
Default |
Meaning |
solidLine |
Boolean |
Required |
False selects the dashed family. |
fountain |
Boolean |
Required |
True selects marker for a solid pen; false selects calligraphy. |
pressure |
Int |
Required |
Measured finite pressure in [0, 1], or null when unavailable; Int brush levels use 0–5. |
Source
public fun inputModelFor(stabilization: Int): BrushFamily.InputModel
| Parameter |
Type |
Default |
Meaning |
stabilization |
Int |
Required |
Input-model level 0–5; tool constructors validate, catalog lookup clamps. |
Source
ViveBrushes.family
public fun family(id: String, stabilization: Int): BrushFamily
| Parameter |
Type |
Default |
Meaning |
id |
String |
Required |
Stored brush family ID; unknown IDs fall back to pressure-pen. |
stabilization |
Int |
Required |
Input-model level 0–5; tool constructors validate, catalog lookup clamps. |
Source
ViveBrushes.brush
public fun brush(familyId: String, stabilization: Int, colorArgb: Int, size: Float): Brush
| Parameter |
Type |
Default |
Meaning |
familyId |
String |
Required |
Brush family ID; use ViveBrushes constants or calligraphy(level). |
stabilization |
Int |
Required |
Input-model level 0–5; tool constructors validate, catalog lookup clamps. |
colorArgb |
Int |
Required |
32-bit ARGB including alpha; nullable drawing overrides use the brush color when null. |
size |
Float |
Required |
Finite positive brush width in page/stroke units, at least epsilon. |
Source
ViveBrushes.highlighter
public fun highlighter(colorArgb: Int, size: Float): Brush
| Parameter |
Type |
Default |
Meaning |
colorArgb |
Int |
Required |
32-bit ARGB including alpha; nullable drawing overrides use the brush color when null. |
size |
Float |
Required |
Finite positive brush width in page/stroke units, at least epsilon. |
Source
ViveBrushes.eraseMask
public fun eraseMask(inputs: StrokeInputBatch, sizeDp: Float): Stroke
| Parameter |
Type |
Default |
Meaning |
inputs |
StrokeInputBatch |
Required |
Native input batch in page/stroke units, with ordered relative timestamps. |
sizeDp |
Float |
Required |
Finite positive brush width or eraser diameter in page dp, at least epsilon. |
Source
AuthoredViveStroke
canonicalStroke lazily rebuilds row through the codec; use that geometry for a save/reload-consistent preview.
public data class AuthoredViveStroke(public val stroke: Stroke, public val row: StoredInkStroke)
| Parameter |
Type |
Default |
Meaning |
stroke |
Stroke |
Required |
Native finished or live stroke, as specified by the type. |
row |
StoredInkStroke |
Required |
Original stored row; nullable decoders return null for unsupported or damaged data. |
Source
AuthoredViveStroke.canonicalStroke
public val canonicalStroke: Stroke
Lazy native rebuild of the authored stored row, matching save/reload geometry.
Source
Authoring rejects unknown families and levels outside 0–5. Highlighter requires stabilization = 0 and colorFollowsTheme = false. complete requires the captured brush.
public class ViveInkTool( public val familyId: String = ViveBrushes.MARKER, public val stabilization: Int = 0, public val colorArgb: Int = 0xff202020.toInt(), public val sizeDp: Float = 3f, public val colorFollowsTheme: Boolean? = false, )
| Parameter |
Type |
Default |
Meaning |
familyId |
String |
ViveBrushes.MARKER |
Brush family ID; use ViveBrushes constants or calligraphy(level). |
stabilization |
Int |
0 |
Input-model level 0–5; tool constructors validate, catalog lookup clamps. |
colorArgb |
Int |
0xff202020.toInt() |
32-bit ARGB including alpha; nullable drawing overrides use the brush color when null. |
sizeDp |
Float |
3f |
Finite positive brush width or eraser diameter in page dp, at least epsilon. |
colorFollowsTheme |
Boolean? |
false |
true follows automatic ink; false fixes color; null enables legacy black/white detection. |
Source
Source
public fun complete( stroke: Stroke, id: String, pageId: String, seq: Int, createdAt: Long, groupId: String? = null, ): AuthoredViveStroke
| Parameter |
Type |
Default |
Meaning |
stroke |
Stroke |
Required |
Native finished or live stroke, as specified by the type. |
id |
String |
Required |
Caller-supplied unique row identifier. |
pageId |
String |
Required |
Identifier of the page owning all supplied rows/targets. |
seq |
Int |
Required |
Caller-allocated stroke draw-order sequence; loading sorts by seq then ID. |
createdAt |
Long |
Required |
Creation clock in the application's stored timestamp units, normally epoch milliseconds. |
groupId |
String? |
null |
Optional logical group ID; grouped ink selects together. |
Source
InkColors
AUTOMATIC_LIGHT
public const val AUTOMATIC_LIGHT: Int = 0xFFFFFFFF.toInt()
Source
AUTOMATIC_DARK
public const val AUTOMATIC_DARK: Int = 0xFF000000.toInt()
Source
automaticInkFor
public fun automaticInkFor(isDark: Boolean): Int
| Parameter |
Type |
Default |
Meaning |
isDark |
Boolean |
Required |
True chooses white automatic ink; false chooses black. |
Source
automaticColorOr
public fun automaticColorOr(stored: Int, followsTheme: Boolean?, canvasInk: Int): Int
| Parameter |
Type |
Default |
Meaning |
stored |
Int |
Required |
Original stored ARGB color, or raw erase-mode name when the type is String. |
followsTheme |
Boolean? |
Required |
Stored theme flag: true automatic, false fixed, null legacy behavior. |
canvasInk |
Int |
Required |
Resolved automatic canvas ARGB, usually automaticInkFor(isDark). |
Source