|
| 1 | +/* This file is part of YUView - The YUV player with advanced analytics toolset |
| 2 | + * <https://github.com/IENT/YUView> |
| 3 | + * Copyright (C) 2015 Institut für Nachrichtentechnik, RWTH Aachen University, GERMANY |
| 4 | + * |
| 5 | + * This program is free software; you can redistribute it and/or modify |
| 6 | + * it under the terms of the GNU General Public License as published by |
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
| 8 | + * (at your option) any later version. |
| 9 | + * |
| 10 | + * In addition, as a special exception, the copyright holders give |
| 11 | + * permission to link the code of portions of this program with the |
| 12 | + * OpenSSL library under certain conditions as described in each |
| 13 | + * individual source file, and distribute linked combinations including |
| 14 | + * the two. |
| 15 | + * |
| 16 | + * You must obey the GNU General Public License in all respects for all |
| 17 | + * of the code used other than OpenSSL. If you modify file(s) with this |
| 18 | + * exception, you may extend this exception to your version of the |
| 19 | + * file(s), but you are not obligated to do so. If you do not wish to do |
| 20 | + * so, delete this exception statement from your version. If you delete |
| 21 | + * this exception statement from all source files in the program, then |
| 22 | + * also delete it here. |
| 23 | + * |
| 24 | + * This program is distributed in the hope that it will be useful, |
| 25 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 26 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 27 | + * GNU General Public License for more details. |
| 28 | + * |
| 29 | + * You should have received a copy of the GNU General Public License |
| 30 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 31 | + */ |
| 32 | + |
| 33 | +#include "PixelFormatYUVHelper.h" |
| 34 | + |
| 35 | +namespace video::yuv::test |
| 36 | +{ |
| 37 | + |
| 38 | +std::vector<PixelFormatYUV> getAllPixelFormats() |
| 39 | +{ |
| 40 | + std::vector<PixelFormatYUV> allFormats; |
| 41 | + |
| 42 | + for (const auto subsampling : SubsamplingMapper.getValues()) |
| 43 | + { |
| 44 | + for (const auto bitsPerSample : BitDepthList) |
| 45 | + { |
| 46 | + const auto endianList = |
| 47 | + (bitsPerSample > 8) ? std::vector<bool>({false, true}) : std::vector<bool>({false}); |
| 48 | + |
| 49 | + // Planar |
| 50 | + for (const auto planeOrder : PlaneOrderMapper.getValues()) |
| 51 | + for (const auto bigEndian : endianList) |
| 52 | + allFormats.push_back(PixelFormatYUV(subsampling, bitsPerSample, planeOrder, bigEndian)); |
| 53 | + |
| 54 | + // Packet |
| 55 | + for (const auto packingOrder : getSupportedPackingFormats(subsampling)) |
| 56 | + for (const auto bytePacking : {false, true}) |
| 57 | + for (const auto bigEndian : endianList) |
| 58 | + allFormats.push_back( |
| 59 | + PixelFormatYUV(subsampling, bitsPerSample, packingOrder, bytePacking, bigEndian)); |
| 60 | + } |
| 61 | + } |
| 62 | + |
| 63 | + for (auto predefinedFormat : PredefinedPixelFormatMapper.getValues()) |
| 64 | + allFormats.push_back(PixelFormatYUV(predefinedFormat)); |
| 65 | + |
| 66 | + return allFormats; |
| 67 | +} |
| 68 | + |
| 69 | +} // namespace video::yuv::test |
0 commit comments