Skip to content

Small-time scanline VM #6

@p0nce

Description

@p0nce

Rationale

There is a lot of potential conversions, adaptation with colors.

Make tiny programs and opcodes in a "scanline VM" (that will process pixels identically as a row)
in order to be able to find some optimizations on the bytecode.

The individual opcodes are on the order of:

  • convert rgba8 to float
  • greyscale / luma
  • exponentiation / sRGB mapping
    This will allow to support any input format to any output format, with a little runtime cost but smaller code in the end I think.
    The problem is all the scanlines functions we already have in Gamut.

Preliminary design

VM opcode design:

  • 4 input ports, size of a scanline
  • 4 output ports, size of a scanline
  • 8 temporaries registers, size of a scanline
  • can we avoid relocation with input/output pointers and length being passed as arguments? => yes, similar to shaders or GPGPU, input and output pointer are arguments, also item count. "Registers" are whole scanline allocated next to each other.
  • math opcodes

A VM program is always about one scanline, possibly having 2 inputs or 2 outputs.

Ability to navigate: CIE XYZ, various RGB, various HSL spaces, power-laws, but also do any kind of blending.
Very fast startup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions