coordsToOffset() {
        const funcName = 'coordsToOffset';
        return {
            coordsToOffset: new glsl_definitions_1.GlslLibRoutine(`
      int ${funcName}(vec2 coords, int width, int height) {
        float s = coords.s * float(width);
        float t = coords.t * float(height);
        int offset = int(t) * width + int(s);
        return offset;
      }
      `)
        };
    }
/**
     * Produces a function that can map from
     * 2D normalzied coordinates (s,t) to a flat offset
     */
Produces a function that can map from
2D normalzied coordinates (s,t) to a flat offset
Produces a function that can map from 2D normalzied coordinates ( s t ) to a flat offset
coordsToOffset() {
        const funcName = 'coordsToOffset';
        return {
            coordsToOffset: new glsl_definitions_1.GlslLibRoutine(`
      int ${funcName}(vec2 coords, int width, int height) {
        float s = coords.s * float(width);
        float t = coords.t * float(height);
        int offset = int(t) * width + int(s);
        return offset;
      }
      `)
        };
    }
coordsToOffset ( ) { const funcName = 'coordsToOffset' ; return { coordsToOffset : new glsl_definitions_1 . GlslLibRoutine ( ` ${ funcName } ` ) } ; }
Produces a function that can map from
 2D normalzied coordinates (s,t) to a flat offset
Produces a function that can map from 2D normalzied coordinates ( s t ) to a flat offset