File: ITextureSaver.cpp

package info (click to toggle)
jazz2-native 3.5.0-1
  • links: PTS, VCS
  • area: contrib
  • in suites:
  • size: 16,836 kB
  • sloc: cpp: 172,557; xml: 113; python: 36; makefile: 5; sh: 2
file content (47 lines) | stat: -rw-r--r-- 1,381 bytes parent folder | download | duplicates (3)
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);
//		}
//	}
//
//}