I am writing a program to do some image processing. I am working with raw binary files and I need to write the data from the raw file to a 16 bit buffer. I have almost got it but I am not quite sure how to make the conversion. Here is my code thus far:
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.
}
Any help would be appreciated!
1 Answer