📄 jpeg.inc
字号:
{******************************************************************/
/* libjpeg for Allegro */
/* by Eric Vannier */
/* */
/* libpng for Allegro */
/* by Saniko */
/* */
/* Version : 1.03 */
/* Date : 02/03/98 */
/* */
/* If you need some information read the readme.1st */
/* */
/******************************************************************}
{$IFDEF ALLEGRO_INTERFACE}
const
JPEG_VERSION = 1;
JPEG_SUBVERSION = 0;
JPEG_REVISION = 3;
JPEG_DESC = 'jpeg library v1.03 based on IJG v6.0a';
JPEG_AUTHOR = 'Eric Vannier as known as Fweibuli';
DEFAULT_QUALITY = 75;
type
color_type_t = (CT_RGB, CT_GRAYSCALE);
decoding_speed_t = (DS_SLOW, DS_FAST);
p_jpeg_code_param = ^jpeg_code_param;
jpeg_code_param = record
{* quality factor : from 0 to 100. Lowest value result in a poor quality/good compression image *}
quality : sint32;
{* type of output : color or grayscale output. The input should be always RGB encoded with
Grayscale Y value used *}
color_type : color_type_t;
end;
p_jpeg_decode_param = ^jpeg_decode_param;
jpeg_decode_param = record
{* type of the result : color or grayscale output. this will be always RGB coded *}
color_type : color_type_t;
{* scale factor of the output. It must be 1 , 2, 4 ,8. 1 is default.
The main interest is to have thumbnail images and therefore fast decompression *}
scale_factor : sint32;
{* Unless you want to save for thumbnail output for example, this should be DS_SLOW,
since a fast output may result in a lower quality *}
decoding_speed : decoding_speed_t;
{* first color to be altered in the palette. Only used in 8 bits mode.
It is faster if it equals zero. *}
first_color : uint32;
{* Number of colors to be altered in the palette. Only used in 8 bits mode.
This should be used with the previous option.
first_color+nbr_colors must be less than 256 *}
nbr_colors : uint32;
end;
var
load_jpeg: function(const filename: PChar; pal: P_PALETTE): P_BITMAP; cdecl;
save_jpeg: function(const filename: PChar; bmp: P_BITMAP; const pal: P_PALETTE): sint32; cdecl;
load_jpeg_ex: function(const filename: PChar; pal: P_PALETTE; const jpeg: p_jpeg_decode_param): P_BITMAP; cdecl;
save_jpeg_ex: function(const filename: PChar; bmp: P_BITMAP; const pal: P_PALETTE; const jpeg: p_jpeg_code_param): sint32; cdecl;
load_png: function(const filename: PChar; pal: P_PALETTE): P_BITMAP; cdecl;
save_png: function(const filename: PChar; bmp: P_BITMAP; const pal: P_PALETTE): sint32; cdecl;
{$ENDIF ALLEGRO_INTERFACE}
{$IFDEF ALLEGRO_IMPLEMENTATION}
{$ENDIF ALLEGRO_IMPLEMENTATION}
{$IFDEF ALLEGRO_LOADVARIABLE}
load_jpeg := LoadDLL('load_jpeg');
save_jpeg := LoadDLL('save_jpeg');
load_jpeg_ex := LoadDLL('load_jpeg_ex');
save_jpeg_ex := LoadDLL('save_jpeg_ex');
load_png := LoadDLL('load_png');
save_png := LoadDLL('save_png');
{$ENDIF ALLEGRO_LOADVARIABLE}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -