Skip to content

Commit

Permalink
add serialization support to chip_details (#3026)
Browse files Browse the repository at this point in the history
  • Loading branch information
arrufat authored Oct 5, 2024
1 parent 4e53f83 commit fa5d37a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dlib/image_transforms/interpolation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,28 @@ namespace dlib
}
};

inline void serialize(const chip_details& item, std::ostream& out)
{
int version = 1;
serialize(version, out);
serialize(item.rect, out);
serialize(item.angle, out);
serialize(item.rows, out);
serialize(item.cols, out);
}

inline void deserialize(chip_details& item, std::istream& in)
{
int version = 0;
deserialize(version, in);
if (version != 1)
throw serialization_error("Unexpected version found while deserializing dlib::chip_details");
deserialize(item.rect, in);
deserialize(item.angle, in);
deserialize(item.rows, in);
deserialize(item.cols, in);
}

// ----------------------------------------------------------------------------------------

inline point_transform_affine get_mapping_to_chip (
Expand Down

0 comments on commit fa5d37a

Please sign in to comment.