Kapto

Namespace

Kapto

Description:
  • Kapto

Source:

Methods

(static) frame(S)

Description:
  • Record a given frame. Should be used in event-driven scenarios (not using onFrame ticking)

Source:
Example
Kapto.frame({
    time: <myclock>, 
    x: <my_sample_xvalue>, 
    y: <my_sample_yvalue>
});
Parameters:
Name Type Description
S Object

State

(static) getHubServer() → {String}

Description:
  • Set Kapto server

Source:
Returns:

addr - Hub address

Type
String

(static) isRecording()

Description:
  • is Kapto recording

Source:

(static) setActorName(actor)

Description:
  • Set actor name

Source:
Parameters:
Name Type Description
actor String

friendly name for object we are currently tracking

(static) setDataChunkSize(size)

Description:
  • Set Datachunk size: how large is the packet sent to the Hub

Source:
Parameters:
Name Type Description
size Number

Number of frames per packet

(static) setGroupID(gid)

Description:
  • Set group ID

Source:
Parameters:
Name Type Description
gid String

group ID (e.g.: "experiment1", "scene3")

(static) setHubServer(addr)

Description:
  • Set Kapto server

Source:
Parameters:
Name Type Description
addr String

address (IP or domain)

(static) setOnDataChunk(of)

Description:
  • Set onDataChunk routine

Source:
Example
Kapto.setOnDataChunk((data)=>{
    console.log(data);
});
Parameters:
Name Type Description
of function

onDataChunk routine to execute when a datachunk is sent

(static) setOnFrame(of)

Description:
  • Set onFrame routine

Source:
Example
Kapto.setOnFrame(()=>{
    return {
        x: <my_sample_xvalue>,
        y: <my_sample_yvalue>
    }
});
Parameters:
Name Type Description
of function

onFrame routine producing a state (object) each tick

(static) setOnSessionID(of)

Description:
  • Set onSessionID routine

Source:
Example
Kapto.setOnSessionID((sesid)=>{
    console.log(sesid);
});
Parameters:
Name Type Description
of function

onSessionID routine to execute on ID assigned

(static) start(interval)

Description:
  • Start recording using ticking

Source:
Parameters:
Name Type Description
interval Number

Time interval (milliseconds)

(static) stop()

Description:
  • Stop current session

Source: