Provides a websocket API and a vuejs frontend to access texture-synthesis software.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hugo Trentesaux 3d6a632cbf initial commit 3 years ago
app initial commit 3 years ago
src initial commit 3 years ago
.gitignore initial commit 3 years ago
Cargo.lock initial commit 3 years ago
Cargo.toml initial commit 3 years ago initial commit 3 years ago
screenshot.png initial commit 3 years ago

Texture synthesis web interface

The purpose of this interface is to make this tool easier to use by anybody who does not necessarily knows how to use a command line interface. It consists in a simple websocket interface and web app.


screenshot of the current look of the web app

How to use it

Build the release binary (debug is way too slow)

cargo build --release

Run the binary with


It should display

listening on port 3012

Then open app/front.html in your browser.

Basic functioning

Rust defines several messages that can be send and encodes it in CBOR format before sending it in the websocket channel.

#[derive(Debug, Serialize, Deserialize)]
enum Response {

JavaScript decodes the CBOR encoded messages and displays the content to the user.

this.socket = new WebSocket("ws://");
this.socket.binaryType = "arraybuffer";

this.socket.onmessage = function (event) {
    var message = CBOR.decode(;
    var message_type = Object.keys(message)[0]; // there must be only one key (enum)
    switch (message_type) {
        case "Message":
            // ...

        case "Image":
            // ...

        case "ProgressStatus":
            // ...

            console.log("invalide message");


This is only a very basic (but working) prototype. A lot of things remain to be done

  • give access to parameters (image size, subcommands...)
  • write basic css for the layout
  • look at the TODOs in the code