1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
//#include "ITextureSaver.h"
//
//#include <cstring>
//
//namespace nCine
//{
// ///////////////////////////////////////////////////////////
// // CONSTRUCTORS and DESTRUCTOR
// ///////////////////////////////////////////////////////////
//
// ITextureSaver::~ITextureSaver() = default;
//
// ///////////////////////////////////////////////////////////
// // PUBLIC FUNCTIONS
// ///////////////////////////////////////////////////////////
//
// unsigned int ITextureSaver::bpp(const ITextureSaver::Format format)
// {
// switch (format) {
// case ITextureSaver::Format::RGB8:
// return 3;
// default:
// case ITextureSaver::Format::RGBA8:
// return 4;
// case ITextureSaver::Format::RGB_FLOAT:
// return 12;
// }
// }
//
// unsigned int ITextureSaver::dataSize(const Properties& properties)
// {
// return (properties.width * properties.height * bpp(properties.format));
// }
//
// void ITextureSaver::flipPixels(const Properties& properties, unsigned char* dest)
// {
// const unsigned int pitch = bpp(properties.format) * properties.width;
// const unsigned char* src = reinterpret_cast<unsigned char*>(properties.pixels);
//
// for (int i = 0; i < properties.height; i++) {
// const unsigned char* srcRow = src + i * pitch;
// unsigned char* destRow = dest + (properties.height - i - 1) * pitch;
// memcpy(destRow, srcRow, pitch);
// }
// }
//
//}
|