variable crop

Codec for <Crop>.

Examples

Build a <Crop> element

import { assertStringIncludes } from "@std/assert";
import { crop } from "@hertzg/reolink-api/protocol/params";

const xml = crop.encode({
  channelId: 0,
  topLeftX: 0,
  topLeftY: 0,
  cropWidth: 1280,
  cropHeight: 720,
  mainWidth: 3840,
  mainHeight: 2160,
});

assertStringIncludes(xml, "<cropWidth>1280</cropWidth><cropHeight>720</cropHeight>");

Type

XmlParam<"Crop", Crop>

Usage

import { crop } from "protocol/params/mod.ts";