Table of Contents

Method WriteStruct

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

WriteStruct(string, Types, string?)

Starts writing a nested structure (sequence or mapping) and returns a disposable scope that calls EndWriteStruct() automatically, so the structure can be written inside a using block instead of manually pairing StartWriteStruct(string, Types, string?)/EndWriteStruct() calls.

public FileStorage.StructScope WriteStruct(string name, FileNode.Types flags, string? typeName = null)

Parameters

name string

name of the structure. When writing to sequences (a.k.a. "arrays"), pass an empty string.

flags FileNode.Types

structure type, one of Map/Seq, optionally combined with Flow for a compact YAML representation.

typeName string

optional name of an object class this structure stores.

Returns

FileStorage.StructScope

Examples

using (fs.WriteStruct("camera", FileNode.Types.Map))
{
    fs.Write("fx", 800.0);
    fs.Write("fy", 800.0);
}