コード例 #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
ファイル: image_io.cpp プロジェクト: autosquid/openMVG
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;
  };
}