/* * Copyright 2016 - 2019 gtalent2@gmail.com * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include #include #include #include namespace nostalgia { template [[nodiscard]] ox::ValErr> toBuffer(T *data, std::size_t buffSize = ox::units::MB) { std::vector buff(buffSize); std::size_t sz = 0; oxReturnError(ox::writeMC(buff.data(), buff.size(), data, &sz)); if (sz > buffSize) { return OxError(1); } buff.resize(sz); return buff; } [[nodiscard]] std::unique_ptr imgToNg(QString argInPath, int argTiles, int argBpp = -1); }