Skip to content

Commit

Permalink
use ZEISS-libCZI
Browse files Browse the repository at this point in the history
  • Loading branch information
ptahmose committed Mar 25, 2023
1 parent 633c7a3 commit 2d661b0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
10 changes: 2 additions & 8 deletions modules/libCZI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ include(FetchContent)

FetchContent_Declare(
libCZI
GIT_REPOSITORY https://github.com/ptahmose/libCZI.git
GIT_TAG origin/master # use the latest in this branch
# this version is "known-to-work"
#GIT_TAG 9aa6b6e411de217a9f2aa91909107def843fe1ec
#CMAKE_ARGS "-DLIBCZI_BUILD_CZICMD=OFF -DLIBCZI_BUILD_DYNLIB=OFF"
# ^ or like this - sometimes it's better because FetchContent won't look
# into remote to see if branch head was updated or not - good for stable
# tags like 'vX.X' corresponding to releases
GIT_REPOSITORY https://github.com/ZEISS/libczi
GIT_TAG origin/main # use the latest in this branch
)

if(NOT libCZI_POPULATED)
Expand Down
2 changes: 1 addition & 1 deletion modules/rapidJSON.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ExternalProject_Add(
rapidjson
PREFIX "vendor/rapidjson"
GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git"
GIT_TAG f54b0e47a08782a6131cc3d60f94d038fa6e0a51
GIT_TAG v1.1.0
TIMEOUT 10
CMAKE_ARGS
-DRAPIDJSON_BUILD_TESTS=OFF
Expand Down
6 changes: 3 additions & 3 deletions wllczi/src/CziUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ bool ChannelDisplaySettingsValidity::Get(Property prop) const
return this->flags.test(static_cast<size_t>(prop) - 1);
}

/*static*/std::vector<std::shared_ptr<libCZI::IBitmapData>> CziUtilities::GetBitmapsFromSpecifiedChannels(libCZI::ICZIReader* reader, const libCZI::CDimCoordinate& planeCoordinate, const libCZI::IntRect& roi, float zoom, std::function<bool(int index, int& channelNo)> getChannelNo, libCZI::IntSize* ptrPixelSize)
/*static*/std::vector<std::shared_ptr<libCZI::IBitmapData>> CziUtilities::GetBitmapsFromSpecifiedChannels(libCZI::ICZIReader* reader, const libCZI::IDimCoordinate* planeCoordinate, const libCZI::IntRect& roi, float zoom, std::function<bool(int index, int& channelNo)> getChannelNo, libCZI::IntSize* ptrPixelSize)
{
std::vector<std::shared_ptr<IBitmapData>> chBitmaps;
libCZI::CDimCoordinate coordinate = planeCoordinate;
libCZI::CDimCoordinate coordinate{ planeCoordinate };

const auto subBlockStatistics = reader->GetStatistics();

libCZI::ISingleChannelScalingTileAccessor::Options sctaOptions;
sctaOptions.Clear();
sctaOptions.backGroundColor = RgbFloatColor{ 0,0,0 };

auto accessor = reader->CreateSingleChannelScalingTileAccessor();
const auto accessor = reader->CreateSingleChannelScalingTileAccessor();

for (int i = 0;; ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion wllczi/src/CziUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct ChannelDisplaySettingsInfo
class CziUtilities
{
public:
static std::vector<std::shared_ptr<libCZI::IBitmapData>> GetBitmapsFromSpecifiedChannels(libCZI::ICZIReader* reader, const libCZI::CDimCoordinate& planeCoordinate, const libCZI::IntRect& roi, float zoom, std::function<bool(int index, int& channelNo)> getChannelNo, libCZI::IntSize* ptrPixelSize);
static std::vector<std::shared_ptr<libCZI::IBitmapData>> GetBitmapsFromSpecifiedChannels(libCZI::ICZIReader* reader, const libCZI::IDimCoordinate* planeCoordinate, const libCZI::IntRect& roi, float zoom, std::function<bool(int index, int& channelNo)> getChannelNo, libCZI::IntSize* ptrPixelSize);

static ChannelDisplaySettingsInfo ParseDisplaySettings(const char* sz);

Expand Down
4 changes: 2 additions & 2 deletions wllczi/src/MImageHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ using namespace libCZI;
uint8_t* ptrLine = ((uint8_t*)ptr) + y * (size_t)stride;
for (decltype(w) x = 0; x < w; ++x)
{
uint8_t t = ptrLine[0];
const uint8_t t = ptrLine[0];
ptrLine[0] = ptrLine[2];
ptrLine[2] = t;
ptrLine += 3;
Expand All @@ -170,7 +170,7 @@ using namespace libCZI;
uint16_t* ptrLine = ((uint16_t*)ptr) + y * (size_t)stride;
for (decltype(w) x = 0; x < w; ++x)
{
uint16_t t = ptrLine[0];
const uint16_t t = ptrLine[0];
ptrLine[0] = ptrLine[2];
ptrLine[2] = t;
ptrLine += 3;
Expand Down

0 comments on commit 2d661b0

Please sign in to comment.