Hi Leute,
Ich habe folgende Funktion unter verwendung von libJPEG zum laden von Jpegs geschrieben:
//Läd eine JPEG Datei
bool LoadJPG(FILE* JPGFile,USHORT **Data,int* Breite,int* Hoehe)
{
if(!JPGFile)
return 0;
//Structuren
COLORREF Color;
int i;
UCHAR *Data24;
UCHAR *ScanLine;
struct jpeg_decompress_struct cinfo;
struct jpeg_error_mgr jerr;
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
jpeg_stdio_src(&cinfo, JPGFile);
jpeg_read_header(&cinfo, TRUE);
cinfo.out_color_space=JCS_RGB;
jpeg_start_decompress(&cinfo);
(*Breite)=cinfo.output_width;
(*Hoehe)=cinfo.output_height;
(*Data)=new USHORT[(*Hoehe)*(*Breite)];
int j=0;
char r,g,b;
ScanLine=new UCHAR[(*Breite)*3];//ScanLine erstellen
while (cinfo.output_scanline