From 7d5ef586210c151c6fca6e1a691cae3818d43e87 Mon Sep 17 00:00:00 2001 From: emild Date: Sat, 9 Mar 2024 11:42:23 +0100 Subject: [PATCH] Remove debug logs and build wheels --- .../src/LayeredFile/LayerTypes/ImageLayer.cpp | 3 --- PhotoshopAPI/src/Util/Struct/ImageChannel.h | 17 ++--------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/PhotoshopAPI/src/LayeredFile/LayerTypes/ImageLayer.cpp b/PhotoshopAPI/src/LayeredFile/LayerTypes/ImageLayer.cpp index 19acd3cb..0996aa55 100644 --- a/PhotoshopAPI/src/LayeredFile/LayerTypes/ImageLayer.cpp +++ b/PhotoshopAPI/src/LayeredFile/LayerTypes/ImageLayer.cpp @@ -179,7 +179,6 @@ ImageLayer::ImageLayer(std::unordered_map>&& Layer::m_Width = layerParameters.width; Layer::m_Height = layerParameters.height; - std::cout << "Constructing image layer with data" << std::endl; // Construct a ChannelIDInfo for each of the channels and then an ImageLayer instance to hold the data for (auto& [key, value] : imageData) @@ -201,9 +200,7 @@ ImageLayer::ImageLayer(std::unordered_map>&& value.size(), static_cast(layerParameters.width) * layerParameters.height); } - std::cout << "Generating channel: " << info.index << std::endl; ImageChannel channel = ImageChannel(layerParameters.compression, std::move(value), info, layerParameters.width, layerParameters.height, layerParameters.posX, layerParameters.posY); - std::cout << "Generated channel: " << info.index << std::endl; m_ImageData[info] = std::move(channel); } diff --git a/PhotoshopAPI/src/Util/Struct/ImageChannel.h b/PhotoshopAPI/src/Util/Struct/ImageChannel.h index 3f601039..f2e8d8e2 100644 --- a/PhotoshopAPI/src/Util/Struct/ImageChannel.h +++ b/PhotoshopAPI/src/Util/Struct/ImageChannel.h @@ -92,7 +92,6 @@ struct ImageChannel : public BaseImageChannel { PSAPI_LOG_ERROR("ImageChannel", "provided imageData does not match the expected size of %" PRIu64 " but is instead %i", static_cast(width) * height, imageData.size()); } - std::cout << "Initializing image channel" << std::endl; PROFILE_FUNCTION(); m_OrigByteSize = static_cast(width) * height * sizeof(T); @@ -123,31 +122,22 @@ struct ImageChannel : public BaseImageChannel // Initialize our schunk m_Data = blosc2_schunk_new(&storage); - - std::cout << "Set up blosc schunk" << std::endl; uint64_t remainingSize = static_cast(width) * height * sizeof(T); for (int nchunk = 0; nchunk < numChunks; ++nchunk) { - std::cout << "Iterating chunk: " << nchunk << std::endl; - // Cast to uint8_t* to iterate by bytes, not by T void* ptr = reinterpret_cast(imageData.data()) + nchunk * m_ChunkSize; - std::cout << "Offset from start: " << nchunk * m_ChunkSize << std::endl; int64_t nchunks; if (remainingSize > m_ChunkSize) { - // C-blos2 returns the total number of chunks here - std::cout << "Preparing to append: " << m_ChunkSize << " bytes to buffer" << std::endl; + // C-blosc2 returns the total number of chunks here nchunks = blosc2_schunk_append_buffer(m_Data, ptr, m_ChunkSize); remainingSize -= m_ChunkSize; } else { // C-blos2 returns the total number of chunks here - std::cout << "Preparing to append: " << remainingSize << " bytes to buffer" << std::endl; - std::vector tmpVec(remainingSize, 0); - std::cout << "Generated temporary vector" << std::endl; - nchunks = blosc2_schunk_append_buffer(m_Data, tmpVec.data(), remainingSize); + nchunks = blosc2_schunk_append_buffer(m_Data, ptr, remainingSize); remainingSize = 0; } if (nchunks != nchunk + 1) [[unlikely]] @@ -156,9 +146,6 @@ struct ImageChannel : public BaseImageChannel } } - - std::cout << "Filled blosc2 schunk" << std::endl; - // Log the total compressed / uncompressed size to later determine our stats REGISTER_COMPRESSION_TRACK(static_cast(m_Data->cbytes), static_cast(m_Data->nbytes)); };