📄 imageenio.pas
字号:
fEXIF_GPSDestLongitudeRef:string;
fEXIF_GPSDestLongitudeDegrees:double;
fEXIF_GPSDestLongitudeMinutes:double;
fEXIF_GPSDestLongitudeSeconds:double;
fEXIF_GPSDestBearingRef:string;
fEXIF_GPSDestBearing:double;
fEXIF_GPSDestDistanceRef:string;
fEXIF_GPSDestDistance:double;
fEXIF_GPSDateStamp:string;
fAVI_FrameCount: integer;
fAVI_FrameDelayTime: integer;
{$ifdef IEINCLUDEDIRECTSHOW}
fMEDIAFILE_FrameCount: integer;
fMEDIAFILE_FrameDelayTime: integer;
{$endif}
fPS_PaperWidth: integer;
fPS_PaperHeight: integer;
fPS_Compression: TIOPSCompression;
fPS_Title: string;
fPDF_PaperWidth: integer; // in Adobe PDF points (1 point=1/72 of inch).
fPDF_PaperHeight: integer; // in Adobe PDF points (1 point=1/72 of inch).
fPDF_Compression: TIOPDFCompression;
fPDF_Title: string;
fPDF_Author: string;
fPDF_Subject: string;
fPDF_Keywords: string;
fPDF_Creator: string;
fPDF_Producer: string;
{$ifdef IEINCLUDERAWFORMATS}
fRAW_HalfSize:boolean;
fRAW_Gamma:double;
fRAW_Bright:double;
fRAW_RedScale:double;
fRAW_BlueScale:double;
fRAW_QuickInterpolate:boolean;
fRAW_UseAutoWB:boolean;
fRAW_UseCameraWB:boolean;
fRAW_FourColorRGB:boolean;
fRAW_Camera:string;
fRAW_GetExifThumbnail:boolean;
fRAW_AutoAdjustColors:boolean;
{$endif}
fBMPRAW_ChannelOrder:TIOBMPRAWChannelOrder;
fBMPRAW_Planes:TIOBMPRAWPlanes;
fBMPRAW_RowAlign:integer;
fBMPRAW_HeaderSize:integer;
fPSD_LoadLayers:boolean;
fPSD_ReplaceLayers:boolean;
fXMP_Info:string;
function GetFileTypeStr: string;
procedure SetEXIF_WhitePoint(index: integer; v: double);
function GetEXIF_WhitePoint(index: integer): double;
procedure SetEXIF_PrimaryChromaticities(index: integer; v: double);
function GetEXIF_PrimaryChromaticities(index: integer): double;
procedure SetEXIF_YCbCrCoefficients(index: integer; v: double);
function GetEXIF_YCbCrCoefficients(index: integer): double;
procedure SetEXIF_ReferenceBlackWhite(index: integer; v: double);
function GetEXIF_ReferenceBlackWhite(index: integer): double;
procedure SetEXIF_ISOSpeedRatings(index: integer; v: integer);
function GetEXIF_ISOSpeedRatings(index: integer): integer;
procedure SetDpi(Value: integer);
procedure SetDpiX(Value: integer);
procedure SetDpiY(Value: integer);
procedure SetTIFF_Orientation(Value: integer);
procedure SetEXIF_Orientation(Value: integer);
procedure SetEXIF_XResolution(Value: double);
procedure SetEXIF_YResolution(Value: double);
function GetInputICC:TIEICC;
function GetOutputICC:TIEICC;
function GetDefaultICC:TIEICC;
function GetImagingAnnot:TIEImagingAnnot;
procedure SetImageIndex(value:integer);
procedure SetImageCount(value:integer);
procedure SetGetThumbnail(value:boolean);
procedure SetJPEG_GetExifThumbnail(value:boolean);
{$ifdef IEINCLUDERAWFORMATS}
procedure SetRAW_GetExifThumbnail(value:boolean);
{$endif}
public
//
IsNativePixelFormat: boolean;
// Read-Only fields
fColorMap: PRGBROW;
fColorMapCount: integer;
// ICO (they are not properties)
{!!
<FS>TIOParamsVals.ICO_Sizes
<FM>Declaration<FC>
ICO_Sizes:<A TIOICOSizes>;
<FM>Description<FN>
ICO_Sizes is an array of TSize structures. It contains the input/output sizes of the images contained in an ICO file.
The last size must contain size 0.
<FM>Example<FC>
// save the current image in 'output.ico', It will contain three images with 64x64 32bit (24bit +alphachannel), 32x32 256 colors and 32x32 16 colors
// 64x64 x32bit
ImageEnView.IO.Params.ICO.BitCount[0]:=32;
ImageEnView.IO.Params.ICO.Sizes[0].cx:=64;
ImageEnView.IO.Params.ICO.Sizes[0].cy:=64;
// 32x32 x8bit
ImageEnView.IO.Params.ICO.BitCount[0]:=8;
ImageEnView.IO.Params.ICO.Sizes[0].cx:=32;
ImageEnView.IO.Params.ICO.Sizes[0].cy:=32;
// 32x32 x4bit
ImageEnView.IO.Params.ICO.BitCount[0]:=4;
ImageEnView.IO.Params.ICO.Sizes[0].cx:=32;
ImageEnView.IO.Params.ICO.Sizes[0].cy:=32;
// I don't want other images
ImageEnView.IO.Params.ICO.BitCount[0]:=0;
ImageEnView.IO.Params.ICO.Sizes[0].cx:=0;
ImageEnView.IO.Params.ICO.Sizes[0].cy:=0;
// save
ImageEnView.IO.SaveToFile('output.ico');
!!}
ICO_Sizes: TIOICOSizes;
{!!
<FS>TIOParamsVals.ICO_BitCount
<FM>Declaration<FC>
ICO_BitCount:<A TIOICOBitCount>;
<FM>Description<FN>
ICO_BitCount is an array of integers. It contains the input/output bitcount of the images contained in an ICO file.
The last bitcount must contain 0.
<FM>Example<FC>
// save the current image in 'output.ico', It will contain three images with 64x64 32bit (24bit +alphachannel), 32x32 256 colors and 32x32 16 colors
// 64x64 x32bit
ImageEnView.IO.Params.ICO.BitCount[0]:=32;
ImageEnView.IO.Params.ICO.Sizes[0].cx:=64;
ImageEnView.IO.Params.ICO.Sizes[0].cy:=64;
// 32x32 x8bit
ImageEnView.IO.Params.ICO.BitCount[0]:=8;
ImageEnView.IO.Params.ICO.Sizes[0].cx:=32;
ImageEnView.IO.Params.ICO.Sizes[0].cy:=32;
// 32x32 x4bit
ImageEnView.IO.Params.ICO.BitCount[0]:=4;
ImageEnView.IO.Params.ICO.Sizes[0].cx:=32;
ImageEnView.IO.Params.ICO.Sizes[0].cy:=32;
// I don't want other images
ImageEnView.IO.Params.ICO.BitCount[0]:=0;
ImageEnView.IO.Params.ICO.Sizes[0].cx:=0;
ImageEnView.IO.Params.ICO.Sizes[0].cy:=0;
// save
ImageEnView.IO.SaveToFile('output.ico');
!!}
ICO_BitCount: TIOICOBitCount;
//
fInputICC: TIEICC;
fOutputICC: TIEICC;
fDefaultICC: TIEICC;
// GENERIC
{!!
<FS>TIOParamsVals.FileName
<FM>Declaration<FC>
property FileName: string;
<FM>Description<FN>
Filename of the last loaded or saved image.
Read-only
!!}
property FileName: string read fFileName write fFileName;
property FileTypeStr: string read GetFileTypeStr;
{!!
<FS>TIOParamsVals.FileType
<FM>Declaration<FC>
property FileType:<A TIOFileType>;
<FM>Description<FN>
FileType is the last loaded/saved file type. For example, after a call to LoadFromFileGIF, this property will have the ioGIF value.
<FM>Example<FC>
if OpenImageEnDialog1.Execute then begin
ImageEnView1.IO.LoadFromFile(OpenImageEnDialog1.FileName);
case ImageEnView1.IO.Params.FileType of
ioTIFF: ShowMessage('You have loaded a TIFF file');
ioGIF: ShowMessage('You have loaded a GIF file');
......
end;
end;
!!}
property FileType: TIOFileType read fFileType write fFileType;
{!!
<FS>TIOParamsVals.BitsPerSample
<FM>Declaration<FC>
property BitsPerSample: integer;
<FM>Description<FN>
Depth, in bits, for each sample.
Allowed values:
1 for black & white
2..7 for color mapped bitmap (from 4 to 128 colors)
8 for color mapped (256 colors) or true color
<FM>Example<FC>
// saves 256 colormapped bitmap
ImageEnView1.IO.Params.BitsPerSample:=8;
ImageEnView1.IO.Params.SamplesPerPixel:=1;
ImageEnView1.IO.Params.SaveToFile('alfa.bmp');
!!}
property BitsPerSample: integer read fBitsPerSample write fBitsPerSample;
{!!
<FS>TIOParamsVals.SamplesPerPixel
<FM>Declaration<FC>
property SamplesPerPixel: integer;
<FM>Description<FN>
Samples for each pixel. This property can be only 1 for color mapped images or 3 for true color image.
!!}
property SamplesPerPixel: integer read fSamplesPerPixel write fSamplesPerPixel;
{!!
<FS>TIOParamsVals.Width
<FM>Declaration<FC>
property Width: integer;
<FM>Description<FN>
Width of the image in pixels.
!!}
property Width: integer read fWidth write fWidth;
{!!
<FS>TIOParamsVals.Height
<FM>Declaration<FC>
property Height: integer;
<FM>Description<FN>
Image height in pixels.
!!}
property Height: integer read fHeight write fHeight;
property DpiX: integer read fDpiX write SetDpiX;
property DpiY: integer read fDpiY write SetDpiY;
{!!
<FS>TIOParamsVals.Dpi
<FM>Declaration<FC>
property Dpi:integer;
<FM>Description<FN>
Dpi specifies the resolution (dots per inch) of the acquired image. If horizontal and vertical resolutions aren't equal, Dpi is the horizontal resolution (the same as DpiX).
!!}
property Dpi: integer read fDpiX write SetDpi;
{!!
<FS>TIOParamsVals.ColorMap
<FM>Declaration<FC>
property ColorMap: <A PRGBROW>;
<FM>Description<FN>
ColorMap gets the colormap of the last loaded image.
Read-only
<FM>Example<FC>
// shows the palette of the file "myfile.gif"
var
fPalDial:TImageEnPaletteDialog;
begin
ImageEnView1.IO.LoadFromFile('myfile.gif');
fPalDial:=TImageEnPaletteDialog.Create(self);
fPalDial.SetPalette(ImageEnView1.IO.Params.ColorMap^,ImageEnView1.IO.Params.ColorMapCount);
fPalDial.Execute;
fPalDial.free;
end;
!!}
property ColorMap: PRGBROW read fColorMap;
{!!
<FS>TIOParamsVals.ColorMapCount
<FM>Declaration<FC>
property ColorMapCount: integer;
<FM>Description<FN>
ColorMapCount is the number of entries in the ColorMap array.
Read-only
!!}
property ColorMapCount: integer read fColorMapcount;
{!!
<FS>TIOParamsVals.ImageIndex
<FM>Declaration<FC>
property ImageIndex:integer;
<FM>Description<FN>
ImageIndex specifies the index of next page to load. You have to specify this property just before methods like LoadFromFile.
This property is valid for all file formats (TIFF, GIF, DCX, etc..) and sets also other properties like TIFF_ImageIndex, GIF_ImageIndex, etc..
<FM>Example<FC>
ImageEnView1.IO.Params.ImageIndex:=1; // need second page
ImageEnView1.IO.LoadFromFile('input.tif');
!!}
property ImageIndex:integer read fImageIndex write SetImageIndex;
{!!
<FS>TIOParamsVals.ImageCount
<FM>Declaration<FC>
property ImageCount:integer
<FM>Description<FN>
ImageCount returns the number of page/images/frames founds inside the last loaded file. This property is valid for all file formats.
<FM>Example<FC>
ImageEnView1.IO.LoadFromFile('input.tif');
Pages:=ImageEnView1.IO.Params.ImageCount;
!!}
property ImageCount:integer read fImageCount write SetImageCount;
{!!
<FS>TIOParamsVals.GetThumbnail
<FM>Declaration<FC>
property GetThumbnail:boolean;
<FM>Description<FN>
You have to set this property just before load an image which could contain a thumbnail (like EXIF thumbnail). If you set True the thumbnail will be loaded. If no thumbnail is present the full image will be loaded.
<FM>Example<FC>
ImageEnView1.IO.Params.GetThumbnail:=true;
ImageEnView1.IO.LoadFromFile('input.jpg');
!!}
property GetThumbnail:boolean read fGetThumbnail write SetGetThumbnail;
// ICC
property InputICCProfile: TIEICC read GetInputICC;
property OutputICCProfile: TIEICC read GetOutputICC;
property DefaultICCProfile: TIEICC read GetDefaultICC;
// IPTC
{!!
<FS>TIOParamsVals.IPTC_Info
<FM>Declaration<FC>
property IPTC_Info: <A TIEIPTCInfoList>;
<FM>Description<FN>
IPTC_Info contains a list of IPTC information contained in a file.
IPTC records can contains text, objects and images. Applications can read/write information from IPTC_Info using string objects or a memory buffer.
Each IPTC_Info item has a record number and a dataset number. These values specify the type of data contained in the item, according to IPTC - NAA Information Interchange Model Version 4 (look at www.iptc.org).
ImageEn can read/write IPTC textual information of PhotoShop (File info menu).
For JPEG files ImageEn read/write IPTC fields from APP13 marker.
Click <L IPTC items compatible with Adobe PhotoShop>here</L> for a list of IPTC Photoshop items.
<A TIEIPTCInfoList> is the object that contains the list of IPTC information.
<FM>Examples<FC>
// read the image description (writed by PhotoShop) (caption:var, idx:integer)
ImageEnView1.IO.LoadFromFile('image.jpg');
Idx:=ImageEnView1.IO.Params.IPTC_Info.IndexOf(2,120);
Caption:=ImageEnView1.IO.Params.IPTC_Info.StringItem[idx];
// write the image description
ImageEnView1.IO.Params.IPTC_Info.StringItem[idx]:= 'This is the new caption';
ImageEnView1.IO.SaveToFile('image.jpg');
!!}
property IPTC_Info: TIEIPTCInfoList read fIPTC_Info;
// Imaging annotations
property ImagingAnnot: TIEImagingAnnot read GetImagingAnnot;
// TIFF
{!!
<FS>TIOParamsVals.TIFF_Compression
<FM>Declaration<FC>
property TIFF_Compression: <A TIOTIFFCompression>;
<FM>Description<FN>
Specifies the compression type for TIFF image format.
!!}
property TIFF_Compression: TIOTIFFCompression read fTIFF_Compression write fTIFF_Compression;
{!!
<FS>TIOParamsVals.TIFF_ImageIndex
<FM>Declaration<FC>
property TIFF_ImageIndex: integer;
<FM>Description<FN>
TIFF_ImageIndex is the index (from 0) of the image.
!!}
property TIFF_ImageIndex: integer read fTIFF_ImageIndex write SetImageIndex;
{!!
<FS>TIOParamsVals.TIFF_SubIndex
<FM>Declaration<FC>
property TIFF_SubIndex:integer;
<FM>Description<FN>
A TIFF can contains several pages. You can load image or paramters from a page using TIFF_ImageIndex (or just ImageIndex). Each page can contain sub images, like a tree, so you can load a specific sub page using TIFF_SubIndex.
This is useful for example to load an embedded Jpeg from a DNG (camera raw format), that is located at first page and second sub index.
<FM>Example<FC>
// loads the embeded jpeg from a DNG
ImageEnView1.IO.Params.TIFF_ImageIndex:=0;
ImageEnView1.IO.Params.TIFF_SubIndex:=1;
ImageEnView1.IO.LoadFromFileTIFF('DCSXXX.DNG');
!!}
property TIFF_SubIndex:integer read fTIFF_SubIndex write fTIFF_SubIndex;
{!!
<FS>TIOParamsVals.TIFF_ImageCount
<FM>Declaration<FC>
property TIFF_ImageCount:integer;
<FM>Description<FN>
TIFF_ImageCount specifies the image count of the last TIFF loaded.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -