Skip to content

Jbl/chunked prereq cleanups#171

Merged
ptahmose merged 15 commits into
ZEISS:mainfrom
ptahmose:jbl/chunked_prereq_cleanups
Jun 25, 2026
Merged

Jbl/chunked prereq cleanups#171
ptahmose merged 15 commits into
ZEISS:mainfrom
ptahmose:jbl/chunked_prereq_cleanups

Conversation

@ptahmose

@ptahmose ptahmose commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

This PR contains preparatory changes and small API additions that are independent of the planned experimental chunked-compression work.

Summary of changes:

  • Add CreateBitmapFromSubBlockData, a low-level helper for creating a bitmap directly from compressed subblock payload data and the required bitmap metadata.
  • Refactor bitmap creation internals so decoding from an ISubBlock and decoding from raw subblock data can share the same implementation.
  • Add AttachmentStatistics and GetAttachmentStatistics() support for attachment repositories.
  • Improve unit-test registration for cross-compiling by using gtest_discover_tests() only when tests can be discovered by executing the test binary.
  • Fix the Codecov workflow flag variable casing from matrix.OS to matrix.os.
  • Switch CLI11 usage to the single-header include.
  • Bump libCZI version to 0.68.0 and update the version history.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • locally
  • CI/CD

Checklist:

  • I followed the Contributing Guidelines.
  • I did a self-review.
  • I commented my code, particularly in hard-to-understand areas.
  • I updated the documentation.
  • I updated the version of libCZI following Versioning of libCZI depending on the type of change
    • Bug fix -> PATCH
    • New feature -> MINOR
    • Breaking change -> MAJOR
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

ptahmose added 5 commits June 22, 2026 14:09
Refactor bitmap creation logic to modularize decoding from compressed data, introducing new internal helpers and a public API (CreateBitmapFromSubBlockData) for direct bitmap creation from raw data and metadata. Update unit test CMake integration to use gtest_discover_tests when not cross-compiling. Switch CLI11 include to single-header. Improves modularity, testability, and API flexibility.
Introduce AttachmentStatistics struct and GetAttachmentStatistics() method to IAttachmentRepository and its implementations. Provide attachment count retrieval in CCZIReader, CCziReaderWriter, and CCziAttachmentsDirectory. Update headers and source files to support querying attachment statistics.
Changed Codecov flags from ${{matrix.OS}} to ${{matrix.os}} to resolve a case-sensitivity issue with the matrix variable in the workflow configuration.
Bump project version to 0.68.0 in CMakeLists.txt. Add version_history.md entry for v0.68.0, highlighting improved CMake packaging, better downstream build integration, and minor API additions (see PR ZEISS#170).
@ptahmose ptahmose added the cla Contributor License Agreement sent to Admin label Jun 22, 2026
@ptahmose ptahmose requested a review from Copilot June 22, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a couple of preparatory API additions and internal refactors intended to support upcoming experimental chunked-compression work, while also improving build/test integration and CI workflow correctness.

Changes:

  • Added a low-level bitmap decode entry point (CreateBitmapFromSubBlockData) and refactored bitmap creation internals to share decoding logic.
  • Added an attachment statistics API (AttachmentStatistics / GetAttachmentStatistics()), with implementations in reader and reader-writer.
  • Improved CMake unit test registration for cross-compiling, updated Codecov flag casing, updated CLI11 usage/version, and bumped libCZI to 0.68.0.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Src/libCZIAPI_UnitTests/CMakeLists.txt Use gtest_discover_tests() when not cross-compiling.
Src/libCZI_UnitTests/CMakeLists.txt Use gtest_discover_tests() when not cross-compiling.
Src/libCZI/libCZI.h Add CreateBitmapFromSubBlockData, AttachmentStatistics, and GetAttachmentStatistics().
Src/libCZI/CreateBitmap.cpp Refactor decoding helpers; implement CreateBitmapFromSubBlockData().
Src/libCZI/CZIReader.h Declare GetAttachmentStatistics() override.
Src/libCZI/CZIReader.cpp Implement GetAttachmentStatistics() for the reader.
Src/libCZI/CziReaderWriter.h Declare GetAttachmentStatistics() override.
Src/libCZI/CziReaderWriter.cpp Implement GetAttachmentStatistics() for the reader-writer.
Src/libCZI/CziAttachmentsDirectory.h Add GetAttachmentCount() to attachment directory.
Src/libCZI/CziAttachmentsDirectory.cpp Implement GetAttachmentCount().
Src/CZICmd/cmdlineoptions.cpp Switch CLI11 includes to single-header CLI/CLI.hpp.
Src/CZICmd/CMakeLists.txt Bump CLI11 FetchContent tag to v2.6.2.
.github/workflows/cmake.yml Fix Codecov flag variable casing to matrix.os.
CMakeLists.txt Bump project version to 0.68.0.
docs/source/pages/version_history.md Add 0.68.0 version history entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Src/libCZI/CreateBitmap.cpp Outdated
Comment thread Src/libCZI/CreateBitmap.cpp Outdated
Comment thread Src/libCZI/CreateBitmap.cpp
Comment thread Src/libCZI/libCZI.h
Comment thread Src/libCZI/libCZI.h
Comment thread Src/libCZI/libCZI.h Outdated
ptahmose added 6 commits June 22, 2026 14:53
Refactored switch statement formatting for clarity. Added null checks for options pointer in JpgXr and Zstd0 cases, defaulting to true for mismatch handling if options is null.
Add preprocessor checks to select appropriate bitmap copy or conversion routines depending on host endianness and pixel type. Ensures correct pixel data handling on both big-endian and little-endian systems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Comment thread Src/libCZI/libCZI.h Outdated
Comment thread Src/libCZI/CZIReader.h Outdated
Comment thread Src/libCZI/CziReaderWriter.h Outdated
Comment thread Src/libCZI/CZIReader.cpp Outdated
Comment thread Src/libCZI/CziReaderWriter.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

Src/libCZI_UnitTests/test_reader.cpp:1611

  • CreateBitmapFromSubBlockData() now explicitly throws std::invalid_argument when pv == nullptr, but the new unit tests don’t cover this contract. Adding a small regression test would help ensure callers keep getting a clear exception instead of a potential codec-level crash if this guard changes later.
    for (int y = 1; y < 4; ++y)
    {
        bitmap_pointer = static_cast<const uint8_t*>(locked_bitmap.ptrDataRoi) + static_cast<size_t>(y) * locked_bitmap.stride;
        for (int x = y == 1 ? 2 : 0; x < 4; ++x)
        {
            EXPECT_EQ(bitmap_pointer[x], 0);
        }
    }
}

Comment thread Src/libCZI/CreateBitmap.cpp Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Comment thread Src/libCZI/CreateBitmap.cpp
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

The cmake.yml workflow was updated to set -DLIBCZI_BUILD_UNITTESTS=OFF, preventing unit tests from being built or run during the build process. This change may improve build speed or reflect that tests are not required in this environment.
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.63%. Comparing base (b85521a) to head (03e1821).

Files with missing lines Patch % Lines
Src/libCZI/CreateBitmap.cpp 93.47% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   66.47%   66.63%   +0.15%     
==========================================
  Files          96       96              
  Lines       12365    12402      +37     
==========================================
+ Hits         8220     8264      +44     
+ Misses       4145     4138       -7     
Flag Coverage Δ
windows-latest 66.63% <94.28%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptahmose ptahmose marked this pull request as ready for review June 23, 2026 21:21
@ptahmose ptahmose requested a review from a team June 25, 2026 07:53
Comment thread .github/workflows/cmake.yml
@ptahmose ptahmose merged commit 11cbdc2 into ZEISS:main Jun 25, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla Contributor License Agreement sent to Admin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants