GCC Code Coverage Report


Directory: libimgdoc2/
File: libimgdoc2/src/doc/documentRead2d.h
Date: 2025-02-03 12:41:04
Exec Total Coverage
Lines: 2 2 100.0%
Functions: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 // SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH
2 //
3 // SPDX-License-Identifier: MIT
4
5 #pragma once
6
7 #include <utility>
8 #include <memory>
9 #include <map>
10 #include <vector>
11 #include <imgdoc2.h>
12 #include "document.h"
13 #include "documentReadBase.h"
14 #include "ITileCoordinate.h"
15
16 class DocumentRead2d : public DocumentReadBase, public imgdoc2::IDocRead2d
17 {
18 public:
19 80 explicit DocumentRead2d(std::shared_ptr<Document> document) : DocumentReadBase(std::move(document))
20 80 {}
21
22 // interface IDocQuery2d
23 void ReadTileInfo(imgdoc2::dbIndex idx, imgdoc2::ITileCoordinateMutate* coordinate, imgdoc2::LogicalPositionInfo* info, imgdoc2::TileBlobInfo* tile_blob_info) override;
24 void Query(const imgdoc2::IDimCoordinateQueryClause* coordinate_clause, const imgdoc2::ITileInfoQueryClause* tileinfo_clause, const std::function<bool(imgdoc2::dbIndex)>& func) override;
25 void GetTilesIntersectingRect(const imgdoc2::RectangleD& rect, const imgdoc2::IDimCoordinateQueryClause* coordinate_clause, const imgdoc2::ITileInfoQueryClause* tileinfo_clause, const std::function<bool(imgdoc2::dbIndex)>& func) override;
26 void ReadTileData(imgdoc2::dbIndex idx, imgdoc2::IBlobOutput* data) override;
27
28 // interface IDocInfo
29 void GetTileDimensions(imgdoc2::Dimension* dimensions, std::uint32_t& count) override;
30 std::map<imgdoc2::Dimension, imgdoc2::Int32Interval> GetMinMaxForTileDimension(const std::vector<imgdoc2::Dimension>& dimensions_to_query_for) override;
31 std::uint64_t GetTotalTileCount() override;
32 std::map<int, std::uint64_t> GetTileCountPerLayer() override;
33
34 // interface IDocInfo2d
35 void GetTilesBoundingBox(imgdoc2::DoubleInterval* bounds_x, imgdoc2::DoubleInterval* bounds_y) override;
36 private:
37 std::shared_ptr<IDbStatement> GetReadTileInfo_Statement(bool include_tile_coordinates, bool include_logical_position_info, bool include_tile_blob_info);
38 std::shared_ptr<IDbStatement> CreateQueryStatement(const imgdoc2::IDimCoordinateQueryClause* coordinate_clause, const imgdoc2::ITileInfoQueryClause* tileinfo_clause);
39 std::shared_ptr<IDbStatement> GetTilesIntersectingRectQueryWithSpatialIndex(const imgdoc2::RectangleD& rect);
40 std::shared_ptr<IDbStatement> GetTilesIntersectingRectQuery(const imgdoc2::RectangleD& rect);
41 std::shared_ptr<IDbStatement> GetTilesIntersectingRectQueryAndCoordinateAndInfoQueryClauseWithSpatialIndex(const imgdoc2::RectangleD& rect, const imgdoc2::IDimCoordinateQueryClause* coordinate_clause, const imgdoc2::ITileInfoQueryClause* tileinfo_clause);
42 std::shared_ptr<IDbStatement> GetTilesIntersectingRectQueryAndCoordinateAndInfoQueryClause(const imgdoc2::RectangleD& rect, const imgdoc2::IDimCoordinateQueryClause* coordinate_clause, const imgdoc2::ITileInfoQueryClause* tileinfo_clause);
43 std::shared_ptr<IDbStatement> GetReadDataQueryStatement(imgdoc2::dbIndex idx);
44
45 std::shared_ptr<IDbStatement> CreateQueryMinMaxStatement(const std::vector<imgdoc2::Dimension>& dimensions);
46
47 std::shared_ptr<IDbStatement> CreateQueryTilesBoundingBoxStatement(bool include_x, bool include_y) const;
48 };
49