Class FileNode
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
File Storage Node class
public class FileNode : CvObject, IDisposable, IEnumerable<FileNode>, IEnumerable
- Inheritance
-
FileNode
- Implements
- Inherited Members
Constructors
- FileNode()
The default constructor
- FileNode(nint)
Initializes from cv::FileNode*
Properties
- Empty
Returns true if the node is empty
- IsInt
Returns true if the node is an integer
- IsMap
Returns true if the node is a mapping
- IsNamed
Returns true if the node has a name
- IsNone
Returns true if the node is a "none" object
- IsReal
Returns true if the node is a floating-point number
- IsSeq
Returns true if the node is a sequence
- IsString
Returns true if the node is a text string
- this[int]
Returns the element of a sequence node at the given index, or null if the index is out of range (or the element is explicitly stored as a "none" value).
- this[string]
Returns the element of a mapping node with the given key, or null if the key is not present (or is explicitly stored as a "none" value).
- Keys
Returns the keys of a mapping node.
- Name
Returns the node name or an empty string if the node is nameless
- RawSize
Returns the raw size of the node in bytes.
- Size
Returns the number of elements in the node, if it is a sequence or mapping, or 1 otherwise.
- Type
Returns type of the node.
Methods
- Begin()
returns iterator pointing to the first node element
- End()
returns iterator pointing to the element following the last node element
- GetEnumerator()
Get FileNode iterator
- GetPath(object[])
Navigates a chain of mapping keys (string) and/or sequence indices (int), disposing every intermediate FileNode along the way. Equivalent to repeated indexer chaining (e.g.
node["a"][2]["b"]), except that the indexer chain leaves every intermediate node unreferenced - each one is still a real native allocation that would otherwise sit around until the GC finalizes it.
- ReadDMatch()
Reads the node element as DMatch
- ReadDMatches()
Reads the node element as DMatch[]
- ReadDouble(double)
Reads the node element as Double
- ReadFloat(float)
Reads the node element as Single (float)
- ReadInt(int)
Reads the node element as Int32 (int)
- ReadInt64(long)
Reads the node element as Int64 (long)
- ReadKeyPoint()
Reads the node element as KeyPoint
- ReadKeyPoints()
Reads the node element as KeyPoint[]
- ReadMat(Mat?)
Reads the node element as Mat
- ReadPoint()
Reads the node element as Point
- ReadPoint2d()
Reads the node element as Point2d
- ReadPoint2f()
Reads the node element as Point2f
- ReadPoint3d()
Reads the node element as Point3d
- ReadPoint3f()
Reads the node element as Point3f
- ReadPoint3i()
Reads the node element as Point3i
- ReadRange()
Reads the node element as Range
- ReadRaw(string, Span<byte>)
Reads node elements to the buffer with the specified format
- ReadRect()
Reads the node element as Rect
- ReadRect2d()
Reads the node element as Rect2d
- ReadRect2f()
Reads the node element as Rect2f
- ReadScalar()
Reads the node element as Scalar
- ReadSize()
Reads the node element as Size
- ReadSize2d()
Reads the node element as Size2d
- ReadSize2f()
Reads the node element as Size2f
- ReadSparseMat(SparseMat?)
Reads the node element as SparseMat
- ReadString(string?)
Reads the node element as String
- ReadVec2b()
Reads the node element as Vector
- ReadVec2d()
Reads the node element as Vector
- ReadVec2f()
Reads the node element as Vector
- ReadVec2i()
Reads the node element as Vector
- ReadVec2s()
Reads the node element as Vector
- ReadVec2w()
Reads the node element as Vector
- ReadVec3d()
Reads the node element as Vector
- ReadVec3f()
Reads the node element as Vector
- ReadVec3i()
Reads the node element as Vector
- ReadVec3s()
Reads the node element as Vector
- ReadVec3w()
Reads the node element as Vector
- ReadVec4b()
Reads the node element as Vector
- ReadVec4d()
Reads the node element as Vector
- ReadVec4f()
Reads the node element as Vector
- ReadVec4i()
Reads the node element as Vector
- ReadVec4s()
Reads the node element as Vector
- ReadVec4w()
Reads the node element as Vector
- ReadVec6b()
Reads the node element as Vector
- ReadVec6d()
Reads the node element as Vector
- ReadVec6f()
Reads the node element as Vector
- ReadVec6i()
Reads the node element as Vector
- ReadVec6s()
Reads the node element as Vector
- ReadVec6w()
Reads the node element as Vector
- ToDouble()
Returns the node content as double
- ToInt32()
Returns the node content as an integer. If the node stores floating-point number, it is rounded.
- ToInt64()
Returns the node content as a signed 64-bit integer. If the node stores a floating-point number, it is rounded.
- ToJsonNode()
Converts this node (and, recursively, its children) into a JsonNode tree, regardless of whether the underlying FileStorage was opened as XML, YAML or JSON. This is a generic structural conversion (scalars, sequences, mappings) - it does not give special treatment to OpenCV-specific encodings such as
Mat/KeyPoint/DMatch, which come through as their raw mapping/sequence shape (e.g. a Mat becomes a JSON object with "rows"/"cols"/"dt"/"data" members, not an Mat). The result can be fed to JsonSerializer or queried directly.
- ToMat()
Returns the node content as OpenCV Mat
- ToSingle()
Returns the node content as System.Single
- ToString()
Returns the node content as text string
Operators
- explicit operator Mat(FileNode)
Returns the node content as OpenCV Mat
- explicit operator double(FileNode)
Returns the node content as double
- explicit operator int(FileNode)
Returns the node content as an integer. If the node stores floating-point number, it is rounded.
- explicit operator long(FileNode)
Returns the node content as a signed 64-bit integer. If the node stores a floating-point number, it is rounded.
- explicit operator float(FileNode)
Returns the node content as float
- explicit operator string(FileNode)
Returns the node content as text string