declare const _default: "\n uniform sampler2D aeSourceTexture;\n\n // the size of the source texture in texels\n uniform vec2 aeSourceSize;\n\n // the log2 luminance at the start of the range of the histogram, and the reciprocal of its size\n uniform vec2 aeRange;\n\n void main() {\n\n // the block of source texels this texel of the meter covers\n ivec2 meterSize = ivec2({AE_METER_WIDTH}, {AE_METER_HEIGHT});\n ivec2 sourceSize = ivec2(aeSourceSize);\n ivec2 texel = ivec2(gl_FragCoord.xy);\n ivec2 start = texel * sourceSize / meterSize;\n ivec2 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 vec3 sum = vec3(0.0);\n float count = 0.0;\n for (int y = start.y; y < end.y; y += 2) {\n int h = min(2, end.y - y);\n for (int x = start.x; x < end.x; x += 2) {\n int w = min(2, end.x - x);\n vec2 uv = (vec2(x, y) + vec2(w, h) * 0.5) / aeSourceSize;\n float n = float(w * h);\n sum += texture2DLod(aeSourceTexture, 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 float luminance = dot(sum / count, vec3(0.2126, 0.7152, 0.0722));\n float position = clamp((log2(max(luminance, 1.0e-10)) - aeRange.x) * aeRange.y, 0.0, 1.0);\n float value = floor(position * 65535.0 + 0.5);\n float high = floor(value / 256.0);\n gl_FragColor = vec4(high, value - high * 256.0, 0.0, 255.0) / 255.0;\n }\n"; export default _default;