summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/ImageWrite.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2020-12-16 15:34:50 +0100
committerLéo Lam <leo@leolam.fr>2020-12-16 16:04:19 +0100
commit0ad2f3da454feca1fc9ba9c3f8592e104028b936 (patch)
treecd52ccbc1db6a5718f2986a3d4f9ef3cec5a51f6 /Source/Core/VideoCommon/ImageWrite.cpp
parenteafe0056721d828636be540cddf3c1226f88f334 (diff)
Core: Remove ImageWrite and get rid of -Wmissing-declarations warnings
Diffstat (limited to 'Source/Core/VideoCommon/ImageWrite.cpp')
-rw-r--r--Source/Core/VideoCommon/ImageWrite.cpp57
1 files changed, 0 insertions, 57 deletions
diff --git a/Source/Core/VideoCommon/ImageWrite.cpp b/Source/Core/VideoCommon/ImageWrite.cpp
deleted file mode 100644
index d2dcbc9dc5..0000000000
--- a/Source/Core/VideoCommon/ImageWrite.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2008 Dolphin Emulator Project
-// Licensed under GPLv2+
-// Refer to the license.txt file included.
-
-#include <list>
-#include <string>
-#include <vector>
-
-#include "Common/CommonTypes.h"
-#include "Common/File.h"
-#include "Common/FileUtil.h"
-#include "Common/Image.h"
-
-bool SaveData(const std::string& filename, const std::string& data)
-{
- std::ofstream f;
- File::OpenFStream(f, filename, std::ios::binary);
- f << data;
-
- return true;
-}
-
-/*
-TextureToPng
-
-Inputs:
-data : This is an array of RGBA with 8 bits per channel. 4 bytes for each pixel.
-row_stride: Determines the amount of bytes per row of pixels.
-*/
-bool TextureToPng(const u8* data, int row_stride, const std::string& filename, int width,
- int height, bool save_alpha)
-{
- if (!data)
- return false;
-
- if (save_alpha)
- {
- return Common::SavePNG(filename, data, Common::ImageByteFormat::RGBA, width, height,
- row_stride);
- }
-
- std::vector<u8> buffer;
- buffer.reserve(width * height * 3);
-
- for (int y = 0; y < height; ++y)
- {
- const u8* pos = data + y * row_stride;
- for (int x = 0; x < width; ++x)
- {
- buffer.push_back(pos[x * 4]);
- buffer.push_back(pos[x * 4 + 1]);
- buffer.push_back(pos[x * 4 + 2]);
- }
- }
-
- return Common::SavePNG(filename, buffer.data(), Common::ImageByteFormat::RGB, width, height);
-}