Skip to content

Commit

Permalink
add some debug logging to imagelayer as well
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilDohne committed Mar 8, 2024
1 parent d2cb5f3 commit a5ab533
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions PhotoshopAPI/src/LayeredFile/LayerTypes/ImageLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <vector>
#include <unordered_map>
#include <optional>
#include <iostream>

#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
Expand Down Expand Up @@ -178,6 +179,8 @@ ImageLayer<T>::ImageLayer(std::unordered_map<Enum::ChannelID, std::vector<T>>&&
Layer<T>::m_Width = layerParameters.width;
Layer<T>::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)
{
Expand All @@ -198,9 +201,9 @@ ImageLayer<T>::ImageLayer(std::unordered_map<Enum::ChannelID, std::vector<T>>&&
value.size(),
static_cast<uint64_t>(layerParameters.width) * layerParameters.height);
}

ImageChannel<T> channel = ImageChannel<T>(layerParameters.compression, std::move(value), info, layerParameters.width, layerParameters.height, layerParameters.posX, layerParameters.posY);
m_ImageData[info] = std::move(channel);
std::cout << "Generating channel: " << info.index << std::endl;
ImageChannel<T> channel = ImageChannel<T>(layerParameters.compression, std::move(value), info, layerParameters.width, layerParameters.height, layerParameters.posX, layerParameters.posY);
m_ImageData[info] = std::move(channel);
}

// Check that the required keys are actually present. e.g. for an RGB colorMode the channels R, G and B must be present
Expand Down
2 changes: 1 addition & 1 deletion python/src/DeclareImageLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ std::shared_ptr<ImageLayer<T>> createImageLayerFromNpArray(
params.compression = compression;
params.colorMode = color_mode;
std::cout << "Preparing to generate image layer" << std::endl;
return std::make_shared<ImageLayer<T>>(img_data_cpp, params);
return std::make_shared<ImageLayer<T>>(std::move(img_data_cpp), params);
}


Expand Down

0 comments on commit a5ab533

Please sign in to comment.