예제 #1
0
파일: main.c 프로젝트: jpmac26/pokeruby
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);
}
예제 #2
0
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;
  };
}