Skip to content

play-co/gcif-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GCIF Reader

Reader for GCIF version 1.0

See https://github.com/gameclosure/gcif for more information.

Instructions for use are in GCIFReader.h

Example integration:

#include "gcif-reader/GCIFReader.h"

unsigned char *load_image_from_memory(unsigned char *bits, long bits_length, int *width, int *height, int *channels) {
	// If is GCIF,
	if (!gcif_sig_cmp(bits, bits_length)) {
		GCIFImage image;
		int err;

		// Read it
		if ((err = gcif_read_memory(bits, bits_length, &image))) {
			LOG("{tex} Unable to read GCIF image: %s", gcif_read_errstr(err));
		}

		*width = image.width;
		*height = image.height;
		*channels = 4;
		return image.rgba;
	}

	...
}

...

gcif_free_image(rgba);

About

Game Closure Image Format Reader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published