# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2024 Raritan Inc. All rights reserved.
#
# This file was generated by IdlC from Webcam.idl.

use strict;

package Raritan::RPC::webcam::Image;

use Raritan::RPC::webcam::Format;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'format'} = Raritan::RPC::webcam::Format::encode($in->{'format'});
    $encoded->{'timestamp'} = 1 * $in->{'timestamp'};
    $encoded->{'encoding'} = "$in->{'encoding'}";
    $encoded->{'data'} = "$in->{'data'}";
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'format'} = Raritan::RPC::webcam::Format::decode($agent, $in->{'format'});
    $decoded->{'timestamp'} = $in->{'timestamp'};
    $decoded->{'encoding'} = $in->{'encoding'};
    $decoded->{'data'} = $in->{'data'};
    return $decoded;
}

1;
