📄 pgx2pgm.c
字号:
/*****************************************************************************/
/* Copyright 1999, Sharp Labs. of America. */
/* All rights reserved */
/* File: "pgx2pgm.c" */
/* Description: convert pgx (bitdepth<=8) format to pgm format */
/* Author: Wenjun Zeng */
/* Affiliation: Sharp Labs. of America., zengw@sharplabs.com */
/* Version: VM6.0 */
/* Last Revised: 4 Jan, 2000 */
/*****************************************************************************/
#include <stdio.h>
#include "palette.h"
main( int argc, char **argv)
{
FILE *ptin;
unsigned int rows, cols;
int *buff;
/* CheckUsage */
if (argc!=3)
{
fprintf(stderr,"usage: pgx2pgm input(.pgx) output(.pgm) \n");
exit(-1);
}
/* open original pgx image */
ptin =read_pgx_header (argv[1],&rows,&cols);
buff=(unsigned int *)alloc_int1(rows*cols);
read_int_1D_raw(ptin,buff,rows*cols);
/*write as pgm file */
write_int_1D_pgm(argv[2],buff,rows,cols);
free_int1(buff);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -