projects
/
LazOpenGLCore.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eec4c82
)
* load JPEG direct over TLazIntfImage and TReadJPEG instead of TJPEGImage
author
Bergmann89
<bergmann89@muo-game.de>
Sun, 9 Feb 2014 12:30:58 +0000
(13:30 +0100)
committer
Bergmann89
<bergmann89@muo-game.de>
Sun, 9 Feb 2014 12:30:58 +0000
(13:30 +0100)
glBitmap.pas
patch
|
blob
|
history
diff --git
a/glBitmap.pas
b/glBitmap.pas
index
ea47607
..
fdeaae1
100644
(file)
--- a/
glBitmap.pas
+++ b/
glBitmap.pas
@@
-1230,7
+1230,8
@@
implementation
uses
Math, syncobjs, typinfo
uses
Math, syncobjs, typinfo
- {$IFDEF GLB_DELPHI}, Types{$ENDIF};
+ {$IFDEF GLB_DELPHI}, Types{$ENDIF}
+ {$IF DEFINED(GLB_SUPPORT_JPEG_READ) AND DEFINED(GLB_LAZ_JPEG)}, FPReadJPEG{$IFEND};
type
{$IFNDEF fpc}
type
{$IFNDEF fpc}
@@
-6348,6
+6349,7
@@
const
var
jpeg: TJPEGImage;
intf: TLazIntfImage;
var
jpeg: TJPEGImage;
intf: TLazIntfImage;
+ reader: TFPReaderJPEG;
StreamPos: Int64;
magic: String[MAGIC_LEN];
begin
StreamPos: Int64;
magic: String[MAGIC_LEN];
begin
@@
-6362,28
+6364,20
@@
begin
exit;
end;
exit;
end;
- jpeg := TJPEGImage.Create;
+ reader := TFPReaderJPEG.Create;
+ intf := TLazIntfImage.Create(0, 0);
try try
try try
- jpeg.LoadFromStream(aStream);
- intf := TLazIntfImage.Create(0, 0);
- try try
- intf.LoadFromBitmap(jpeg.BitmapHandle, jpeg.MaskHandle);
- AssignFromLazIntfImage(intf);
- except
- result := false;
- aStream.Position := StreamPos;
- exit;
- end;
- finally
- intf.Free;
- end;
+ intf.DataDescription := GetDescriptionFromDevice(0, 0, 0);
+ reader.ImageRead(aStream, intf);
+ AssignFromLazIntfImage(intf);
except
result := false;
aStream.Position := StreamPos;
exit;
end;
finally
except
result := false;
aStream.Position := StreamPos;
exit;
end;
finally
- jpeg.Free;
+ reader.Free;
+ intf.Free;
end;
end;
end;
end;