declare const _default: "\n var aeSourceTexture: texture_2d;\n var aeSourceTextureSampler: sampler;\n\n // the size of the source texture in texels\n uniform aeSourceSize: vec2f;\n\n // the log2 luminance at the start of the range of the histogram, and the reciprocal of its size\n uniform aeRange: vec2f;\n\n @fragment\n fn fragmentMain(input: FragmentInput) -> FragmentOutput {\n var output: FragmentOutput;\n\n // the block of source texels this texel of the meter covers\n let meterSize = vec2i({AE_METER_WIDTH}, {AE_METER_HEIGHT});\n let sourceSize = vec2i(uniform.aeSourceSize);\n let texel = vec2i(pcPosition.xy);\n let start = texel * sourceSize / meterSize;\n let end = max((texel + 1) * sourceSize / meterSize, start + 1);\n\n // sampled two by two texels, between the four, where the bilinear filter weights them\n // equally - or between two, or at one, at the edges of a block of an odd size\n var sum = vec3f(0.0);\n var count = 0.0;\n for (var y = start.y; y < end.y; y += 2) {\n let h = min(2, end.y - y);\n for (var x = start.x; x < end.x; x += 2) {\n let w = min(2, end.x - x);\n let uv = (vec2f(f32(x), f32(y)) + vec2f(f32(w), f32(h)) * 0.5) / uniform.aeSourceSize;\n let n = f32(w * h);\n sum += textureSampleLevel(aeSourceTexture, aeSourceTextureSampler, uv, 0.0).rgb * n;\n count += n;\n }\n }\n\n // the position in 16 bits, the high and the low byte in the red and the green channel\n let luminance = dot(sum / count, vec3f(0.2126, 0.7152, 0.0722));\n let position = clamp((log2(max(luminance, 1.0e-10)) - uniform.aeRange.x) * uniform.aeRange.y, 0.0, 1.0);\n let value = floor(position * 65535.0 + 0.5);\n let high = floor(value / 256.0);\n output.color = vec4f(high, value - high * 256.0, 0.0, 255.0) / 255.0;\n return output;\n }\n"; export default _default;