我正在编写一个程序来进行一些图像处理。我正在处理原始二进制文件,我需要将原始文件中的数据写入 16 位缓冲区。我几乎得到了它,但我不太确定如何进行转换。到目前为止,这是我的代码:
Int16[] pixelBuffer;
String inFile;
String outFile;
/// Constructor. Allocates space for 3032x2016 16-bit values.
/// <param name="inputFile">Name of the binary input file to be read.</param>
/// <param name="outputFile">Name of the binary output file to be written.</param>
public ColorCorrector(String inputFile, String outputFile)
{
this.inFile = inputFile;
this.outFile = outputFile;
this.pixelBuffer = new Int16[6112512];
//I need to open the binary file 'inputFile' and store 16-bit values in pixelBuffer.
}
任何帮助,将不胜感激!