summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bimg/src/image_gnf.cpp
blob: 7d7f0aa190e639bb5786fac937e304c43bb4d8b4 (plain) (blame)
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
/*
 * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
 * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
 */

#include "bimg_p.h"

namespace bimg
{
	bool imageParseGnf(ImageContainer& _imageContainer, bx::ReaderSeekerI* _reader, bx::Error* _err)
	{
		BX_UNUSED(_imageContainer, _reader, _err);
		BX_ERROR_SET(_err, BIMG_ERROR, "GNF: not supported.");
		return false;
	}

	ImageContainer* imageParseGnf(bx::AllocatorI* _allocator, const void* _src, uint32_t _size, bx::Error* _err)
	{
		BX_UNUSED(_allocator);

		bx::MemoryReader reader(_src, _size);

		uint32_t magic;
		bx::read(&reader, magic, bx::ErrorIgnore{});

		ImageContainer imageContainer;
		if (BIMG_CHUNK_MAGIC_GNF != magic
		|| !imageParseGnf(imageContainer, &reader, _err) )
		{
			return NULL;
		}

		BX_ERROR_SET(_err, BIMG_ERROR, "GNF: not supported.");
		return NULL;
	}

} // namespace bimg