📄 freeimage.pas
字号:
FID_BAYER8x8 = FREE_IMAGE_DITHER(2); // Bayer ordered dispersed dot dithering (order 3 dithering matrix)
FID_CLUSTER6x6 = FREE_IMAGE_DITHER(3); // Ordered clustered dot dithering (order 3 - 6x6 matrix)
FID_CLUSTER8x8 = FREE_IMAGE_DITHER(4); // Ordered clustered dot dithering (order 4 - 8x8 matrix)
FID_CLUSTER16x16 = FREE_IMAGE_DITHER(5); // Ordered clustered dot dithering (order 8 - 16x16 matrix)
// Lossless JPEG transformations Constants used in FreeImage_JPEGTransform
FIJPEG_OP_NONE = FREE_IMAGE_JPEG_OPERATION(0); // no transformation
FIJPEG_OP_FLIP_H = FREE_IMAGE_JPEG_OPERATION(1); // horizontal flip
FIJPEG_OP_FLIP_V = FREE_IMAGE_JPEG_OPERATION(2); // vertical flip
FIJPEG_OP_TRANSPOSE = FREE_IMAGE_JPEG_OPERATION(3); // transpose across UL-to-LR axis
FIJPEG_OP_TRANSVERSE = FREE_IMAGE_JPEG_OPERATION(4); // transpose across UR-to-LL axis
FIJPEG_OP_ROTATE_90 = FREE_IMAGE_JPEG_OPERATION(5); // 90-degree clockwise rotation
FIJPEG_OP_ROTATE_180 = FREE_IMAGE_JPEG_OPERATION(6); // 180-degree rotation
FIJPEG_OP_ROTATE_270 = FREE_IMAGE_JPEG_OPERATION(7); // 270-degree clockwise (or 90 ccw)
// Tone mapping operators. Constants used in FreeImage_ToneMapping.
FITMO_DRAGO03 = FREE_IMAGE_TMO(0); // Adaptive logarithmic mapping (F. Drago, 2003)
FITMO_REINHARD05 = FREE_IMAGE_TMO(1); // Dynamic range reduction inspired by photoreceptor physiology (E. Reinhard, 2005)
// Upsampling / downsampling filters. Constants used in FreeImage_Rescale.
FILTER_BOX = FREE_IMAGE_FILTER(0); // Box, pulse, Fourier window, 1st order (constant) b-spline
FILTER_BICUBIC = FREE_IMAGE_FILTER(1); // Mitchell & Netravali's two-param cubic filter
FILTER_BILINEAR = FREE_IMAGE_FILTER(2); // Bilinear filter
FILTER_BSPLINE = FREE_IMAGE_FILTER(3); // 4th order (cubic) b-spline
FILTER_CATMULLROM = FREE_IMAGE_FILTER(4); // Catmull-Rom spline, Overhauser spline
FILTER_LANCZOS3 = FREE_IMAGE_FILTER(5); // Lanczos3 filter
// Color channels. Constants used in color manipulation routines.
FICC_RGB = FREE_IMAGE_COLOR_CHANNEL(0); // Use red, green and blue channels
FICC_RED = FREE_IMAGE_COLOR_CHANNEL(1); // Use red channel
FICC_GREEN = FREE_IMAGE_COLOR_CHANNEL(2); // Use green channel
FICC_BLUE = FREE_IMAGE_COLOR_CHANNEL(3); // Use blue channel
FICC_ALPHA = FREE_IMAGE_COLOR_CHANNEL(4); // Use alpha channel
FICC_BLACK = FREE_IMAGE_COLOR_CHANNEL(5); // Use black channel
FICC_REAL = FREE_IMAGE_COLOR_CHANNEL(6); // Complex images: use real part
FICC_IMAG = FREE_IMAGE_COLOR_CHANNEL(7); // Complex images: use imaginary part
FICC_MAG = FREE_IMAGE_COLOR_CHANNEL(8); // Complex images: use magnitude
FICC_PHASE = FREE_IMAGE_COLOR_CHANNEL(9); // Complex images: use phase
// Tag data type information (based on TIFF specifications)
FIDT_NOTYPE = FREE_IMAGE_MDTYPE(0); // placeholder
FIDT_BYTE = FREE_IMAGE_MDTYPE(1); // 8-bit unsigned integer
FIDT_ASCII = FREE_IMAGE_MDTYPE(2); // 8-bit bytes w/ last byte null
FIDT_SHORT = FREE_IMAGE_MDTYPE(3); // 16-bit unsigned integer
FIDT_LONG = FREE_IMAGE_MDTYPE(4); // 32-bit unsigned integer
FIDT_RATIONAL = FREE_IMAGE_MDTYPE(5); // 64-bit unsigned fraction
FIDT_SBYTE = FREE_IMAGE_MDTYPE(6); // 8-bit signed integer
FIDT_UNDEFINED = FREE_IMAGE_MDTYPE(7); // 8-bit untyped data
FIDT_SSHORT = FREE_IMAGE_MDTYPE(8); // 16-bit signed integer
FIDT_SLONG = FREE_IMAGE_MDTYPE(9); // 32-bit signed integer
FIDT_SRATIONAL = FREE_IMAGE_MDTYPE(10); // 64-bit signed fraction
FIDT_FLOAT = FREE_IMAGE_MDTYPE(11); // 32-bit IEEE floating point
FIDT_DOUBLE = FREE_IMAGE_MDTYPE(12); // 64-bit IEEE floating point
FIDT_IFD = FREE_IMAGE_MDTYPE(13); // 32-bit unsigned integer (offset)
FIDT_PALETTE = FREE_IMAGE_MDTYPE(14); // 32-bit RGBQUAD
// Metadata models supported by FreeImage
FIMD_NODATA = FREE_IMAGE_MDMODEL(-1);
FIMD_COMMENTS = FREE_IMAGE_MDMODEL(0); // single comment or keywords
FIMD_EXIF_MAIN = FREE_IMAGE_MDMODEL(1); // Exif-TIFF metadata
FIMD_EXIF_EXIF = FREE_IMAGE_MDMODEL(2); // Exif-specific metadata
FIMD_EXIF_GPS = FREE_IMAGE_MDMODEL(3); // Exif GPS metadata
FIMD_EXIF_MAKERNOTE = FREE_IMAGE_MDMODEL(4); // Exif maker note metadata
FIMD_EXIF_INTEROP = FREE_IMAGE_MDMODEL(5); // Exif interoperability metadata
FIMD_IPTC = FREE_IMAGE_MDMODEL(6); // IPTC/NAA metadata
FIMD_XMP = FREE_IMAGE_MDMODEL(7); // Abobe XMP metadata
FIMD_GEOTIFF = FREE_IMAGE_MDMODEL(8); // GeoTIFF metadata (to be implemented)
FIMD_ANIMATION = FREE_IMAGE_MDMODEL(9); // Animation metadata
FIMD_CUSTOM = FREE_IMAGE_MDMODEL(10); // Used to attach other metadata types to a dib
//{$endif}
type
// Handle to a metadata model
FIMETADATA = record
data: Pointer;
end;
PFIMETADATA = ^FIMETADATA;
// Handle to a metadata tag
FITAG = record
data: Pointer;
end;
PFITAG = ^FITAG;
// --------------------------------------------------------------------------
// File IO routines ---------------------------------------------------------
// --------------------------------------------------------------------------
type
FI_Handle = Pointer;
PCardinal = ^Cardinal;
PInt = ^Integer;
FI_ReadProc = function(buffer : pointer; size : Cardinal; count : Cardinal; handle : fi_handle) : PCardinal; stdcall;
FI_WriteProc = function(buffer : pointer; size, count : Cardinal; handle : FI_Handle) : PCardinal; stdcall;
FI_SeekProc = function(handle : fi_handle; offset : longint; origin : integer) : pint; stdcall;
FI_TellProc = function(handle : fi_handle) : PCardinal; stdcall;
FreeImageIO = packed record
read_proc : FI_ReadProc; // pointer to the function used to read data
write_proc: FI_WriteProc; // pointer to the function used to write data
seek_proc : FI_SeekProc; // pointer to the function used to seek
tell_proc : FI_TellProc; // pointer to the function used to aquire the current position
end;
PFreeImageIO = ^FreeImageIO;
// Handle to a memory I/O stream
FIMEMORY = record
data: Pointer;
end;
PFIMEMORY = ^FIMEMORY;
const
// constants used in FreeImage_Seek for Origin parameter
SEEK_SET = 0;
SEEK_CUR = 1;
SEEK_END = 2;
// --------------------------------------------------------------------------
// Plugin routines ----------------------------------------------------------
// --------------------------------------------------------------------------
type
PPluginStruct = ^PluginStruct;
FI_InitProc = procedure(Plugin: PPluginStruct; Format_ID: Integer); stdcall;
FI_FormatProc = function: PChar; stdcall;
FI_DescriptionProc = function: PChar; stdcall;
FI_ExtensionListProc = function: PChar; stdcall;
FI_RegExprProc = function: PChar; stdcall;
FI_OpenProc = function(IO: PFreeImageIO; Handle: FI_Handle; Read: Boolean): Pointer; stdcall;
FI_CloseProc = procedure(IO: PFreeImageIO; Handle: FI_Handle; Data: Pointer); stdcall;
FI_PageCountProc = function(IO: PFreeImageIO; Handle: FI_Handle; Data: Pointer): Integer; stdcall;
FI_PageCapabilityProc = function(IO: PFreeImageIO; Handle: FI_Handle; Data: Pointer): integer; stdcall;
FI_LoadProc = function(IO: PFreeImageIO; Handle: FI_Handle; Page, Flags: Integer; data: pointer): PFIBITMAP; stdcall;
FI_SaveProc = function(IO: PFreeImageIO; Dib: PFIBITMAP; Handle: FI_Handle; Page, Flags: Integer; Data: Pointer): Boolean; stdcall;
FI_ValidateProc = function(IO: PFreeImageIO; Handle: FI_Handle): Boolean; stdcall;
FI_MimeProc = function: PChar; stdcall;
FI_SupportsExportBPPProc = function(Bpp: integer): boolean; stdcall;
FI_SupportsExportTypeProc = function(AType: FREE_IMAGE_TYPE): Boolean; stdcall;
FI_SupportsICCProfilesProc = function: Boolean; stdcall;
PluginStruct = record
format_proc: FI_FormatProc;
description_proc: FI_DescriptionProc;
extension_proc: FI_ExtensionListProc;
regexpr_proc: FI_RegExprProc;
open_proc: FI_OpenProc;
close_proc: FI_CloseProc;
pagecount_proc: FI_PageCountProc;
pagecapability_proc: FI_PageCapabilityProc;
load_proc: FI_LoadProc;
save_proc: FI_SaveProc;
validate_proc: FI_ValidateProc;
mime_proc: FI_MimeProc;
supports_export_bpp_proc: FI_SupportsExportBPPProc;
supports_export_type_proc: FI_SupportsExportTypeProc;
supports_icc_profiles_proc: FI_SupportsICCProfilesProc;
end;
// --------------------------------------------------------------------------
// Load/Save flag constants -------------------------------------------------
// --------------------------------------------------------------------------
const
BMP_DEFAULT = 0;
BMP_SAVE_RLE = 1;
CUT_DEFAULT = 0;
DDS_DEFAULT = 0;
FAXG3_DEFAULT = 0;
GIF_DEFAULT = 0;
ICO_DEFAULT = 0;
ICO_MAKEALPHA = 1; // convert to 32bpp and create an alpha channel from the AND-mask when loading
IFF_DEFAULT = 0;
JPEG_DEFAULT = 0;
JPEG_FAST = 1;
JPEG_ACCURATE = 2;
JPEG_QUALITYSUPERB = $0080;
JPEG_QUALITYGOOD = $0100;
JPEG_QUALITYNORMAL = $0200;
JPEG_QUALITYAVERAGE = $0400;
JPEG_QUALITYBAD = $0800;
JPEG_CMYK = $1000; // load separated CMYK "as is" (use | to combine with other flags)
KOALA_DEFAULT = 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -