Skip to content

Commit

Permalink
dev: remove unused function.
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmin42 committed Sep 24, 2024
1 parent 0eb7d3c commit afd0fef
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 72 deletions.
2 changes: 0 additions & 2 deletions PB/include/pb/image/ImageFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class ImageFactory final {

std::shared_ptr<VirtualImage> createImage(Path path);
std::shared_ptr<VirtualImage> copyImage(std::shared_ptr<VirtualImage> image);
std::shared_ptr<VirtualImage>
mapImageToPaper(std::shared_ptr<VirtualImage> image, Path hashPath);

// TODO: Fix this if taking into account the platform info...
std::shared_ptr<VirtualImage> defaultRegularImage()
Expand Down
42 changes: 0 additions & 42 deletions PB/src/ImageFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,46 +99,4 @@ ImageFactory::copyImage(std::shared_ptr<VirtualImage> image)
}
}

std::shared_ptr<VirtualImage>
ImageFactory::mapImageToPaper(std::shared_ptr<VirtualImage> image,
Path hashPath)
{
auto maybeProject = mProjectManagementService->maybeLoadedProjectInfo();
PBDev::basicAssert(maybeProject != nullptr);
auto project = maybeProject->second;

auto imageData = ImageReader().read(
image->frontend().full, true,
{project.paperSettings.width, project.paperSettings.height});

std::shared_ptr<cv::Mat> singleColorImage = PB::Process::singleColorImage(
project.paperSettings.width, project.paperSettings.height,
{255, 255, 255})();

PBDev::basicAssert(imageData != nullptr);

PB::Process::overlap(imageData,
PB::Process::alignToCenter())(singleColorImage);
/*
auto [smallPath, mediumPath] = ThumbnailsProcessor::assembleOutputPaths(
mPlatformInfo->localStatePath, 0, hashPath.stem().string(),
boost::uuids::to_string(maybeProject->first));
Process::writeImageOnDisk(singleColorImage, hashPath);
Process::imageWriteThumbnail(project.paperSettings.width,
project.paperSettings.height, singleColorImage,
mediumPath, smallPath);
ImageResources imageResources = {hashPath, mediumPath, smallPath,
(unsigned)singleColorImage->cols,
(unsigned)singleColorImage->rows};
auto newImage = std::make_shared<RegularImage>(imageResources, hashPath);
return newImage;
*/
return nullptr;
}

} // namespace PB
26 changes: 0 additions & 26 deletions windows/PhotobookRuntimeComponent/PhotobookWin.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,6 @@ class PhotobookListener final : public PB::PhotobookListener {
};

struct PhotobookWin : PhotobookWinT<PhotobookWin> {
PhotobookRuntimeComponent::VirtualImagePtr
mapImageToSPL(PhotobookRuntimeComponent::VirtualImagePtr image)
{
auto nativeImagePtr =
winrt::get_self<
winrt::PhotobookRuntimeComponent::implementation::VirtualImagePtr>(
image)
->Unwrap();
std::string newImageName =
boost::uuids::to_string(boost::uuids::random_generator()()) + ".png";

auto projectManagementService = mPhotobook->projectManagementService();
auto maybeLoadedProjectInfo =
projectManagementService->maybeLoadedProjectInfo();

PBDev::basicAssert(maybeLoadedProjectInfo != nullptr);

auto projectThumbnailsRoot =
mPhotobook->platformInfo()->projectSupportFolder(
maybeLoadedProjectInfo->first);

return winrt::make<VirtualImagePtr>(
mPhotobook->imageFactory()->mapImageToPaper(
nativeImagePtr, projectThumbnailsRoot / newImageName));
}

static PhotobookRuntimeComponent::PaperSettings
GetDefaultSettings(PhotobookRuntimeComponent::PaperType paperType)
{
Expand Down
2 changes: 0 additions & 2 deletions windows/PhotobookRuntimeComponent/PhotobookWin.idl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ runtimeclass PhotobookWin
IVector<CollageTemplateInfo> CollageTemplatesThumbnailsList();
void MakeCollage(IVector<UInt32> images, UInt32 collageName);

VirtualImagePtr mapImageToSPL(VirtualImagePtr image);

void mapImagesToSPL(IMap<Guid, VirtualImagePtr> images);

static PaperSettings GetDefaultSettings(PaperType paperType);
Expand Down

0 comments on commit afd0fef

Please sign in to comment.