Class MatSerializer
java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<org.bytedeco.opencv.opencv_core.Mat>
io.github.jspinak.brobot.json.serializers.MatSerializer
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
public class MatSerializer
extends com.fasterxml.jackson.databind.JsonSerializer<org.bytedeco.opencv.opencv_core.Mat>
Custom Jackson serializer for OpenCV Mat objects.
Converts Mat to a JSON representation that includes matrix metadata and data. This prevents serialization errors when Mat objects are included in classes that need to be converted to JSON.
The serialized format includes: - rows: Number of rows - cols: Number of columns - type: OpenCV type constant - channels: Number of channels - depth: Bit depth - data: Base64-encoded matrix data
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
com.fasterxml.jackson.databind.JsonSerializer.None
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer
acceptJsonFormatVisitor, getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId
-
Constructor Details
-
MatSerializer
public MatSerializer()
-
-
Method Details
-
serialize
public void serialize(org.bytedeco.opencv.opencv_core.Mat mat, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException - Specified by:
serialize
in classcom.fasterxml.jackson.databind.JsonSerializer<org.bytedeco.opencv.opencv_core.Mat>
- Throws:
IOException
-
handledType
- Overrides:
handledType
in classcom.fasterxml.jackson.databind.JsonSerializer<org.bytedeco.opencv.opencv_core.Mat>
-