+ jpeg loading support

git-svn-id: trunk@5445 -
This commit is contained in:
mazen 2004-05-06 16:25:23 +00:00
parent 82c27cc547
commit bb55cb9727
4 changed files with 62 additions and 0 deletions

1
.gitattributes vendored
View File

@ -1013,6 +1013,7 @@ lcl/include/inputdialog.inc svneol=native#text/pascal
lcl/include/interfacebase.inc svneol=native#text/pascal
lcl/include/intfbaselcl.inc svneol=native#text/pascal
lcl/include/intfbasewinapi.inc svneol=native#text/pascal
lcl/include/jpg.inc svneol=native#text/pascal
lcl/include/lclaction.inc svneol=native#text/pascal
lcl/include/lclintf.inc svneol=native#text/pascal
lcl/include/lclintfh.inc svneol=native#text/pascal

View File

@ -41,6 +41,7 @@ uses
SysUtils, Classes, Contnrs, FPCAdds,
{$IFNDEF DisableFPImage}
FPImage, FPReadPNG, FPWritePNG, FPReadBMP, FPWriteBMP, IntfGraphics,
FPReadJpeg,FPWriteJpeg,
{$ENDIF}
LCLStrConsts, vclGlobals, LMessages, LCLType, LCLProc, LCLIntf, LResources,
GraphType, GraphMath;
@ -367,6 +368,7 @@ type
TPixmap = class; // xpm
TIcon = class; // ico
TPortableNetworkGraphic = class; // png
TJpegImage = class; // jpg
{ TGraphicsObject }
@ -1107,6 +1109,18 @@ type
end;
{ TJpegImage }
TJpegImage = class(TFPImageBitmap)
public
class function GetFileExtensions: string; override;
{$IFNDEF DisableFPImage}
class function GetDefaultFPReader: TFPCustomImageReaderClass; override;
class function GetDefaultFPWriter: TFPCustomImageWriterClass; override;
{$ENDIF}
end;
{ TIcon }
{
TIcon reads and writes .ICO file format.
@ -1482,6 +1496,7 @@ end;
{$I canvas.inc}
{$I pixmap.inc}
{$I png.inc}
{$I jpg.inc}
{ TFPImageBitmap }
@ -1680,6 +1695,9 @@ end.
{ =============================================================================
$Log$
Revision 1.136 2004/05/06 16:25:22 mazen
+ jpeg loading support
Revision 1.135 2004/04/29 18:08:17 mattias
fixed 1.0.10 compilation

42
lcl/include/jpg.inc Normal file
View File

@ -0,0 +1,42 @@
{%MainUnit ../graphics.pp}
{******************************************************************************
TPortableNetworkGraphic
******************************************************************************
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.LCL, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
{ TPortableNetworkGraphic }
function TJpegImage.GetFileExtensions: string;
begin
Result:='jpg';
end;
{$IFNDEF DisableFPImage}
function TJpegImage.GetDefaultFPReader: TFPCustomImageReaderClass;
begin
Result:=TFPReaderJpeg;
end;
function TJpegImage.GetDefaultFPWriter: TFPCustomImageWriterClass;
begin
Result:=TFPWriterJpeg;
end;
{$ENDIF}
// included by graphics.pp

View File

@ -51,6 +51,7 @@ begin
Add('png', 'Portable Network Graphic', TPortableNetworkGraphic);
{$ENDIF}
Add('ico', 'Icon', TIcon);
Add('jpg', 'Joint Picture Expert Group',TJpegImage);
end;
procedure TPicFileFormatsList.Clear;