syntax = "proto3";

message AllDocumentPositionData {

  repeated DocumentPositionData documentPositionData = 1;
}

message DocumentPositionData {
  // Identifier of the text block.
  int64 id = 1;

  // For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
  // This is required due to the text and position coordinates not being equal.
  repeated int32 stringIdxToPositionIdx = 2;

  // The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
  // The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
  // In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
  repeated Position positions = 3;

  // Definition of a BoundingBox that contains x, y, width, and height.
  message Position {
    repeated float value = 1;
  }
}
