// This Source Code Form is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/
import { estimateObjectSize } from "@foxglove/studio-base/players/messageMemoryEstimation.js";
import { parseMessage } from "../../utils.js";
export function deserializeColorFrame({ topic, message, callback }) {
    const { receiveTime, encoding, step, width, height, stride, planeStride } = parseMessage(message);
    const foxgloveMessage = {
        timestamp: receiveTime,
        frame_id: `color-${topic}-frame`,
        width,
        height,
        encoding,
        step: width * step,
        data: message.data,
        stride,
        planeStride
    };
    callback({
        topic,
        receiveTime,
        message: foxgloveMessage,
        sizeInBytes: estimateObjectSize(foxgloveMessage),
        schemaName: "foxglove.RawImage"
    });
}
//# sourceMappingURL=color.js.map