import { EndianType } from "../../../../core/binary/EndianType.js";
import { BinaryDataType } from "../../../../core/binary/type/BinaryDataType.js";
import { RowFirstTableSpec } from "../../../../core/collection/table/RowFirstTableSpec.js";

export const ribbon_attributes_spec = new RowFirstTableSpec([
    // age
    BinaryDataType.Float32,

    // position
    BinaryDataType.Float32,
    BinaryDataType.Float32,
    BinaryDataType.Float32,

    // UV (uv is recorded as a single coordinate)
    BinaryDataType.Float32,

    // alpha
    BinaryDataType.Float32,

    // color
    BinaryDataType.Uint8,
    BinaryDataType.Uint8,
    BinaryDataType.Uint8,

    // Offset attribute
    BinaryDataType.Uint8,

    // Previous point
    BinaryDataType.Float32,
    BinaryDataType.Float32,
    BinaryDataType.Float32,

    // Next point
    BinaryDataType.Float32,
    BinaryDataType.Float32,
    BinaryDataType.Float32,

    // thickness
    BinaryDataType.Float32,

], EndianType.LittleEndian);


export const RIBBON_ATTRIBUTE_ADDRESS_POSITION = 1;
export const RIBBON_ATTRIBUTE_ADDRESS_POSITION_PREVIOUS = 10;
export const RIBBON_ATTRIBUTE_ADDRESS_POSITION_NEXT = 13;
export const RIBBON_ATTRIBUTE_ADDRESS_ALPHA = 5;
export const RIBBON_ATTRIBUTE_ADDRESS_COLOR = 6;
export const RIBBON_ATTRIBUTE_ADDRESS_OFFSET = 9;
export const RIBBON_ATTRIBUTE_ADDRESS_AGE = 0;
export const RIBBON_ATTRIBUTE_ADDRESS_UV_OFFSET = 4;
export const RIBBON_ATTRIBUTE_ADDRESS_THICKNESS = 16;
