import { RedFormat, RGBAFormat, RGFormat } from "three";
import { GL_RGBFormat } from "./GL_RGBFormat.js";

/**
 *
 * @param {number} count
 * @return {number}
 */
export function channelCountToThreeTextureFormat(count) {
    switch (count) {
        case 1:
            return RedFormat;
        case 2:
            return RGFormat;
        case 3:
            return GL_RGBFormat;
        case 4:
            return RGBAFormat;
        default:
            throw new Error(`Unsupported channel count '${count}'`);
    }
}
