void ConvertPngToGba(char *inputPath, char *outputPath, int numTiles, int bitDepth) { struct Image image; image.bitDepth = bitDepth; ReadPng(inputPath, &image); WriteImage(outputPath, numTiles, bitDepth, &image, !image.hasPalette); FreeImage(&image); }
int ReadImage(const char *filename, std::vector<unsigned char> * ptr, int * w, int * h, int * depth){ const Format f = GetFormat(filename); switch (f) { case Pnm: return ReadPnm(filename, ptr, w, h, depth); case Png: return ReadPng(filename, ptr, w, h, depth); case Jpg: return ReadJpg(filename, ptr, w, h, depth); case Tiff: return ReadTiff(filename, ptr, w, h, depth); default: return 0; }; }