From 9135c59601ccd294c89cdc7119679b58416b46a7 Mon Sep 17 00:00:00 2001 From: ptahmose Date: Wed, 11 Dec 2024 04:19:16 +0100 Subject: [PATCH] Refactor and cleanup in SingleChannelTileAccessor Modified the constructor in SingleChannelTileAccessor.cpp to make roi_raw_sub_block_cs a const IntRect, ensuring immutability. Removed a commented-out Get method declaration in SingleChannelTileAccessor.h for improved readability. --- Src/libCZI/SingleChannelTileAccessor.cpp | 3 +-- Src/libCZI/SingleChannelTileAccessor.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Src/libCZI/SingleChannelTileAccessor.cpp b/Src/libCZI/SingleChannelTileAccessor.cpp index b03359d0..443d7c7d 100644 --- a/Src/libCZI/SingleChannelTileAccessor.cpp +++ b/Src/libCZI/SingleChannelTileAccessor.cpp @@ -32,8 +32,7 @@ CSingleChannelTileAccessor::CSingleChannelTileAccessor(const std::shared_ptr CSingleChannelTileAccessor::Get(libCZI::PixelType pixeltype, const libCZI::IntRectAndFrameOfReference& roi, const IDimCoordinate* planeCoordinate, const Options* pOptions) { - //IntRect roi_raw_sub_block_cs = Utils::ConvertToFrameOfReference(roi, this->sbBlkRepository.get(), CZIFrameOfReference::RawSubBlockCoordinateSystem); - IntRect roi_raw_sub_block_cs = this->sbBlkRepository->TransformRectangle(roi, CZIFrameOfReference::RawSubBlockCoordinateSystem).rectangle; + const IntRect roi_raw_sub_block_cs = this->sbBlkRepository->TransformRectangle(roi, CZIFrameOfReference::RawSubBlockCoordinateSystem).rectangle; auto bmDest = GetSite()->CreateBitmap(pixeltype, roi_raw_sub_block_cs.w, roi_raw_sub_block_cs.h); this->InternalGet(roi_raw_sub_block_cs.x, roi_raw_sub_block_cs.y, bmDest.get(), planeCoordinate, pOptions); return bmDest; diff --git a/Src/libCZI/SingleChannelTileAccessor.h b/Src/libCZI/SingleChannelTileAccessor.h index f37824f3..e58da6ce 100644 --- a/Src/libCZI/SingleChannelTileAccessor.h +++ b/Src/libCZI/SingleChannelTileAccessor.h @@ -17,7 +17,6 @@ class CSingleChannelTileAccessor : public CSingleChannelAccessorBase, public lib public: // interface ISingleChannelTileAccessor std::shared_ptr Get(const libCZI::IntRectAndFrameOfReference& roi, const libCZI::IDimCoordinate* planeCoordinate, const libCZI::ISingleChannelTileAccessor::Options* pOptions) override; - //std::shared_ptr Get(libCZI::PixelType pixeltype, const libCZI::IntRect& roi, const libCZI::IDimCoordinate* planeCoordinate, const Options* pOptions) override; std::shared_ptr Get(libCZI::PixelType pixeltype, const libCZI::IntRectAndFrameOfReference& roi, const libCZI::IDimCoordinate* planeCoordinate, const Options* pOptions) override; void Get(libCZI::IBitmapData* pDest, int xPos, int yPos, const libCZI::IDimCoordinate* planeCoordinate, const Options* pOptions) override; private: