mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-05 01:58:31 +02:00
aggpas: 64bit fixes from fpgui aggpas
git-svn-id: trunk@47745 -
This commit is contained in:
parent
41a6b409a2
commit
80fb2b2367
@ -47,6 +47,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$IFDEF LCLGtk2}
|
{$IFDEF LCLGtk2}
|
||||||
HasFont:=true;
|
HasFont:=true;
|
||||||
|
FontFilename:=SetDirSeparators('../../verdana.ttf');
|
||||||
|
if not FileExistsUTF8(FontFilename) then begin
|
||||||
|
ShowMessage('file not found: '+FontFilename+' CurDir='+GetCurrentDirUTF8);
|
||||||
|
HasFont:=false;
|
||||||
|
end;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
HasFont:=false;
|
HasFont:=false;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -54,8 +59,6 @@ begin
|
|||||||
// paint to agg canvas
|
// paint to agg canvas
|
||||||
with AggLCLCanvas do begin
|
with AggLCLCanvas do begin
|
||||||
if HasFont then begin
|
if HasFont then begin
|
||||||
FontFilename:=SetDirSeparators('../../verdana.ttf');
|
|
||||||
if not FileExistsUTF8(FontFilename) then raise Exception.Create('file not found: '+FontFilename+' CurDir='+GetCurrentDirUTF8);
|
|
||||||
Font.LoadFromFile(FontFilename);
|
Font.LoadFromFile(FontFilename);
|
||||||
Font.Size:=10;
|
Font.Size:=10;
|
||||||
Font.Color:=clBlack;
|
Font.Color:=clBlack;
|
||||||
@ -86,12 +89,14 @@ begin
|
|||||||
Pie(220,10,240,30, 230,5, 220,30);
|
Pie(220,10,240,30, 230,5, 220,30);
|
||||||
RadialPie(245,10,265,30, 1000,2000);
|
RadialPie(245,10,265,30, 1000,2000);
|
||||||
|
|
||||||
s:='Font.Size='+IntToStr(Font.Size);
|
if HasFont then begin
|
||||||
GetTextSize(s,TxtW,TxtH);
|
s:='Font.Size='+IntToStr(Font.Size);
|
||||||
TxtX:=10;
|
GetTextSize(s,TxtW,TxtH);
|
||||||
TxtY:=40;
|
TxtX:=10;
|
||||||
FillRect(TxtX,TxtY,TxtX+TxtW,TxtY+TxtH);
|
TxtY:=40;
|
||||||
TextOut(TxtX,TxtY,s);
|
FillRect(TxtX,TxtY,TxtX+TxtW,TxtY+TxtH);
|
||||||
|
TextOut(TxtX,TxtY,s);
|
||||||
|
end;
|
||||||
|
|
||||||
RoundRect(10,80,30,100,15,15);
|
RoundRect(10,80,30,100,15,15);
|
||||||
Polyline([Point(35,80),Point(45,80),Point(55,80),Point(55,90),
|
Polyline([Point(35,80),Point(45,80),Point(55,80),Point(55,90),
|
||||||
|
@ -3,30 +3,18 @@
|
|||||||
// Based on Anti-Grain Geometry
|
// Based on Anti-Grain Geometry
|
||||||
// Copyright (C) 2005 Maxim Shemanarev (http://www.antigrain.com)
|
// Copyright (C) 2005 Maxim Shemanarev (http://www.antigrain.com)
|
||||||
//
|
//
|
||||||
// Agg2D - Version 1.0 Release Milano 3 (AggPas 2.3 RM3)
|
// Agg2D - Version 1.0 Release Milano 3 (AggPas 2.4 RM3)
|
||||||
// Pascal Port By: Milan Marusinec alias Milano
|
// Pascal Port By: Milan Marusinec alias Milano
|
||||||
// milan@marusinec.sk
|
// milan@marusinec.sk
|
||||||
// http://www.aggpas.org
|
// http://www.aggpas.org
|
||||||
// Copyright (c) 2007
|
// Copyright (c) 2007 - 2008
|
||||||
//
|
//
|
||||||
// Permission to copy, use, modify, sell and distribute this software
|
// Permission to copy, use, modify, sell and distribute this software
|
||||||
// is granted provided this copyright notice appears in all copies.
|
// is granted provided this copyright notice appears in all copies.
|
||||||
// This software is provided "as is" without express or implied
|
// This software is provided "as is" without express or implied
|
||||||
// warranty, and with no claim as to its suitability for any purpose.
|
// warranty, and with no claim as to its suitability for any purpose.
|
||||||
//
|
//
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
// Contact: mcseem@antigrain.com
|
|
||||||
// mcseemagg@yahoo.com
|
|
||||||
// http://www.antigrain.com
|
|
||||||
//
|
|
||||||
// [Pascal Port History] -----------------------------------------------------
|
|
||||||
//
|
|
||||||
// 22.08.2007-Milano: Unit port establishment
|
|
||||||
// 23.08.2007-Milano: Porting
|
|
||||||
// 11.09.2007-Milano: -"-
|
|
||||||
// 13.09.2007-Milano: -"-, Finished OK
|
|
||||||
//
|
|
||||||
{ agg_2D.pas }
|
|
||||||
unit
|
unit
|
||||||
agg_2D ;
|
agg_2D ;
|
||||||
|
|
||||||
@ -73,12 +61,10 @@ uses
|
|||||||
|
|
||||||
{$IFDEF AGG2D_USE_FREETYPE }
|
{$IFDEF AGG2D_USE_FREETYPE }
|
||||||
agg_font_freetype ,
|
agg_font_freetype ,
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
{$IFDEF AGG2D_USE_WINFONTS}
|
{$IFDEF AGG2D_USE_WINFONTS}
|
||||||
agg_font_win32_tt ,
|
agg_font_win32_tt ,
|
||||||
Windows ,
|
Windows ,
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
Math ;
|
Math ;
|
||||||
@ -150,11 +136,9 @@ type
|
|||||||
|
|
||||||
{$IFDEF AGG2D_USE_FREETYPE }
|
{$IFDEF AGG2D_USE_FREETYPE }
|
||||||
FontEngine = font_engine_freetype_int32;
|
FontEngine = font_engine_freetype_int32;
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
{$IFDEF AGG2D_USE_WINFONTS}
|
{$IFDEF AGG2D_USE_WINFONTS}
|
||||||
FontEngine = font_engine_win32_tt_int32;
|
FontEngine = font_engine_win32_tt_int32;
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
Gradient = (Solid ,Linear ,Radial );
|
Gradient = (Solid ,Linear ,Radial );
|
||||||
@ -341,6 +325,8 @@ type
|
|||||||
|
|
||||||
procedure clearAll(c : Color ); overload;
|
procedure clearAll(c : Color ); overload;
|
||||||
procedure clearAll(r ,g ,b : unsigned; a : unsigned = 255 ); overload;
|
procedure clearAll(r ,g ,b : unsigned; a : unsigned = 255 ); overload;
|
||||||
|
procedure FillAll(c: Color); overload;
|
||||||
|
procedure FillAll(r, g, b: byte; a: byte = 255); overload;
|
||||||
|
|
||||||
procedure clearClipBox(c : Color ); overload;
|
procedure clearClipBox(c : Color ); overload;
|
||||||
procedure clearClipBox(r ,g ,b : unsigned; a : unsigned = 255 ); overload;
|
procedure clearClipBox(r ,g ,b : unsigned; a : unsigned = 255 ); overload;
|
||||||
@ -440,7 +426,7 @@ type
|
|||||||
rxTop ,ryTop : double ); overload;
|
rxTop ,ryTop : double ); overload;
|
||||||
|
|
||||||
procedure ellipse(cx ,cy ,rx ,ry : double );
|
procedure ellipse(cx ,cy ,rx ,ry : double );
|
||||||
|
|
||||||
procedure arc (cx ,cy ,rx ,ry ,start ,sweep : double );
|
procedure arc (cx ,cy ,rx ,ry ,start ,sweep : double );
|
||||||
procedure star(cx ,cy ,r1 ,r2 ,startAngle : double; numRays : int );
|
procedure star(cx ,cy ,r1 ,r2 ,startAngle : double; numRays : int );
|
||||||
|
|
||||||
@ -678,24 +664,24 @@ end;
|
|||||||
{ PREMULTIPLY }
|
{ PREMULTIPLY }
|
||||||
procedure Image.premultiply;
|
procedure Image.premultiply;
|
||||||
//var
|
//var
|
||||||
// pixf : pixel_formats;
|
//pixf : pixel_formats;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{ pixfmt_rgba32(pixf ,@renBuf );
|
{ pixfmt_rgba32(pixf ,@renBuf );
|
||||||
|
|
||||||
pixf.premultiply; {!}
|
pixf.premultiply; }
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ DEMULTIPLY }
|
{ DEMULTIPLY }
|
||||||
procedure Image.demultiply;
|
procedure Image.demultiply;
|
||||||
//var
|
//var
|
||||||
// pixf : pixel_formats;
|
//pixf : pixel_formats;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{ pixfmt_rgba32(pixf ,@renBuf );
|
{ pixfmt_rgba32(pixf ,@renBuf );
|
||||||
|
|
||||||
pixf.demultiply; {!}
|
pixf.demultiply; }
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -812,20 +798,15 @@ begin
|
|||||||
|
|
||||||
{$IFDEF AGG2D_USE_FREETYPE }
|
{$IFDEF AGG2D_USE_FREETYPE }
|
||||||
m_fontEngine.Construct;
|
m_fontEngine.Construct;
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
{$IFDEF AGG2D_USE_WINFONTS}
|
{$IFDEF AGG2D_USE_WINFONTS}
|
||||||
|
|
||||||
m_fontDC:=GetDC(0 );
|
m_fontDC:=GetDC(0 );
|
||||||
|
|
||||||
m_fontEngine.Construct(m_fontDC );
|
m_fontEngine.Construct(m_fontDC );
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
{$IFNDEF AGG2D_NO_FONT}
|
{$IFNDEF AGG2D_NO_FONT}
|
||||||
m_fontCacheManager.Construct(@m_fontEngine );
|
m_fontCacheManager.Construct(@m_fontEngine );
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
lineCap (m_lineCap );
|
lineCap (m_lineCap );
|
||||||
lineJoin(m_lineJoin );
|
lineJoin(m_lineJoin );
|
||||||
|
|
||||||
@ -856,7 +837,6 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$IFDEF AGG2D_USE_WINFONTS }
|
{$IFDEF AGG2D_USE_WINFONTS }
|
||||||
ReleaseDC(0 ,m_fontDC );
|
ReleaseDC(0 ,m_fontDC );
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
end;
|
end;
|
||||||
@ -954,6 +934,22 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure Agg2D.FillAll(c: Color);
|
||||||
|
var
|
||||||
|
clr: aggclr;
|
||||||
|
begin
|
||||||
|
clr.Construct (c );
|
||||||
|
m_renBase.fill(@clr );
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure Agg2D.FillAll(r, g, b: byte; a: byte);
|
||||||
|
var
|
||||||
|
clr: Color;
|
||||||
|
begin
|
||||||
|
clr.Construct(r, g, b, a);
|
||||||
|
FillAll(clr);
|
||||||
|
end;
|
||||||
|
|
||||||
{ CLEARCLIPBOX }
|
{ CLEARCLIPBOX }
|
||||||
procedure Agg2D.clearClipBox(c : Color );
|
procedure Agg2D.clearClipBox(c : Color );
|
||||||
var
|
var
|
||||||
@ -2112,6 +2108,7 @@ procedure Agg2D.font(
|
|||||||
var
|
var
|
||||||
b : int;
|
b : int;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
m_textAngle :=angle;
|
m_textAngle :=angle;
|
||||||
m_fontHeight :=height;
|
m_fontHeight :=height;
|
||||||
@ -2129,10 +2126,8 @@ begin
|
|||||||
m_fontEngine.height_(height )
|
m_fontEngine.height_(height )
|
||||||
else
|
else
|
||||||
m_fontEngine.height_(worldToScreen(height ) );
|
m_fontEngine.height_(worldToScreen(height ) );
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
{$IFDEF AGG2D_USE_WINFONTS}
|
{$IFDEF AGG2D_USE_WINFONTS}
|
||||||
|
|
||||||
m_fontEngine.hinting_(m_textHints );
|
m_fontEngine.hinting_(m_textHints );
|
||||||
|
|
||||||
if bold then
|
if bold then
|
||||||
@ -2144,7 +2139,6 @@ begin
|
|||||||
m_fontEngine.create_font_(PChar(fileName ) ,glyph_ren_outline ,height ,0.0 ,b ,italic )
|
m_fontEngine.create_font_(PChar(fileName ) ,glyph_ren_outline ,height ,0.0 ,b ,italic )
|
||||||
else
|
else
|
||||||
m_fontEngine.create_font_(PChar(fileName ) ,glyph_ren_agg_gray8 ,worldToScreen(height) ,0.0 ,b ,italic );
|
m_fontEngine.create_font_(PChar(fileName ) ,glyph_ren_agg_gray8 ,worldToScreen(height) ,0.0 ,b ,italic );
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
end;
|
end;
|
||||||
@ -3312,10 +3306,8 @@ function Agg2DUsesFreeType : boolean;
|
|||||||
begin
|
begin
|
||||||
{$IFDEF AGG2D_USE_FREETYPE }
|
{$IFDEF AGG2D_USE_FREETYPE }
|
||||||
result:=true;
|
result:=true;
|
||||||
|
|
||||||
{$ELSE }
|
{$ELSE }
|
||||||
result:=false;
|
result:=false;
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
end;
|
end;
|
||||||
@ -3324,14 +3316,10 @@ function Agg2DUsesWin32TrueType: boolean;
|
|||||||
begin
|
begin
|
||||||
{$IFDEF AGG2D_USE_WINFONTS }
|
{$IFDEF AGG2D_USE_WINFONTS }
|
||||||
result:=true;
|
result:=true;
|
||||||
|
|
||||||
{$ELSE }
|
{$ELSE }
|
||||||
result:=false;
|
result:=false;
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
END.
|
end.
|
||||||
|
|
||||||
{!}
|
|
||||||
|
|
||||||
|
@ -38,7 +38,6 @@ uses
|
|||||||
|
|
||||||
{ TYPES DEFINITION }
|
{ TYPES DEFINITION }
|
||||||
type
|
type
|
||||||
|
|
||||||
agg_types = (
|
agg_types = (
|
||||||
|
|
||||||
int8_type ,
|
int8_type ,
|
||||||
@ -150,15 +149,7 @@ type
|
|||||||
p32 = record
|
p32 = record
|
||||||
case integer of
|
case integer of
|
||||||
1 : (ptr : pointer );
|
1 : (ptr : pointer );
|
||||||
|
2 : (int : ptrcomp );
|
||||||
{$IFDEF CPU64 }
|
|
||||||
2 : (int : system.int64 );
|
|
||||||
|
|
||||||
{$ELSE }
|
|
||||||
2 : (int : integer );
|
|
||||||
|
|
||||||
{$ENDIF }
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
double_ptr_ptr = ^double_ptr;
|
double_ptr_ptr = ^double_ptr;
|
||||||
@ -366,11 +357,11 @@ type
|
|||||||
procedure NoP;
|
procedure NoP;
|
||||||
|
|
||||||
{ These implementations have changed to use FPC's Sar*() functions, so should
|
{ These implementations have changed to use FPC's Sar*() functions, so should
|
||||||
now support all platforms with ASM code. At a later date these functions
|
now support all platforms without the need for ASM code. At a later date these
|
||||||
could be removed completely. }
|
functions could be removed completely. }
|
||||||
function shr_int8 (i ,shift : int8 ) : int8;
|
function shr_int8 (i ,shift : int8 ) : int8; inline;
|
||||||
function shr_int16(i ,shift : int16 ) : int16;
|
function shr_int16(i ,shift : int16 ) : int16; inline;
|
||||||
function shr_int32(i ,shift : int ) : int;
|
function shr_int32(i ,shift : int ) : int; inline;
|
||||||
|
|
||||||
IMPLEMENTATION
|
IMPLEMENTATION
|
||||||
{ UNIT IMPLEMENTATION }
|
{ UNIT IMPLEMENTATION }
|
||||||
@ -457,7 +448,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ NORMALIZE }
|
{ NORMALIZE }
|
||||||
function rect.normalize;
|
function rect.normalize: rect_ptr;
|
||||||
var
|
var
|
||||||
t : int;
|
t : int;
|
||||||
|
|
||||||
@ -483,7 +474,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ CLIP }
|
{ CLIP }
|
||||||
function rect.clip;
|
function rect.clip(r: rect_ptr): boolean;
|
||||||
begin
|
begin
|
||||||
if x2 > r.x2 then
|
if x2 > r.x2 then
|
||||||
x2:=r.x2;
|
x2:=r.x2;
|
||||||
@ -502,7 +493,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ IS_VALID }
|
{ IS_VALID }
|
||||||
function rect.is_valid;
|
function rect.is_valid: boolean;
|
||||||
begin
|
begin
|
||||||
result:=(x1 <= x2 ) and (y1 <= y2 );
|
result:=(x1 <= x2 ) and (y1 <= y2 );
|
||||||
|
|
||||||
@ -1149,6 +1140,7 @@ var
|
|||||||
fr : integer;
|
fr : integer;
|
||||||
|
|
||||||
get : shortstring;
|
get : shortstring;
|
||||||
|
flg : char;
|
||||||
dth ,
|
dth ,
|
||||||
prc ,
|
prc ,
|
||||||
err : integer;
|
err : integer;
|
||||||
@ -1253,6 +1245,7 @@ begin
|
|||||||
fr:=trunc(system.frac(val ) );
|
fr:=trunc(system.frac(val ) );
|
||||||
sc:=_string;
|
sc:=_string;
|
||||||
|
|
||||||
|
flg:=#0;
|
||||||
dth:=1;
|
dth:=1;
|
||||||
prc:=0;
|
prc:=0;
|
||||||
prf:=#0;
|
prf:=#0;
|
||||||
@ -1281,7 +1274,10 @@ begin
|
|||||||
_flags :
|
_flags :
|
||||||
case src^ of
|
case src^ of
|
||||||
'-' ,'+' ,'0' ,' ' ,'#' :
|
'-' ,'+' ,'0' ,' ' ,'#' :
|
||||||
;
|
begin
|
||||||
|
flg:=src^;
|
||||||
|
if flg=#0 then ; // ToDo
|
||||||
|
end;
|
||||||
|
|
||||||
'1'..'9' :
|
'1'..'9' :
|
||||||
begin
|
begin
|
||||||
|
@ -409,7 +409,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ CONSTRUCT }
|
{ CONSTRUCT }
|
||||||
constructor font_cache_manager.Construct;
|
constructor font_cache_manager.Construct(engine : font_engine_ptr; max_fonts : unsigned);
|
||||||
begin
|
begin
|
||||||
m_fonts.Construct(max_fonts );
|
m_fonts.Construct(max_fonts );
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
// 17.09.2007-Milano: Porting & Finished OK
|
// 17.09.2007-Milano: Porting & Finished OK
|
||||||
// 16.09.2007-Milano: Unit port establishment
|
// 16.09.2007-Milano: Unit port establishment
|
||||||
//
|
//
|
||||||
{ agg_font_freetype.pas }
|
|
||||||
unit
|
unit
|
||||||
agg_font_freetype ;
|
agg_font_freetype ;
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ uses
|
|||||||
type
|
type
|
||||||
face_name_ptr = ^face_name;
|
face_name_ptr = ^face_name;
|
||||||
face_name = record
|
face_name = record
|
||||||
name : char_ptr; //PChar;
|
name : PChar;
|
||||||
size : unsigned;
|
size : unsigned;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
@ -834,7 +834,7 @@ begin
|
|||||||
m_curves16.approximation_scale_(4.0 );
|
m_curves16.approximation_scale_(4.0 );
|
||||||
m_curves32.approximation_scale_(4.0 );
|
m_curves32.approximation_scale_(4.0 );
|
||||||
|
|
||||||
m_last_error:=FT_Init_FreeType(@m_library );
|
m_last_error:=FT_Init_FreeType(m_library );
|
||||||
|
|
||||||
if m_last_error = 0 then
|
if m_last_error = 0 then
|
||||||
m_library_initialized:=true;
|
m_library_initialized:=true;
|
||||||
@ -906,13 +906,13 @@ begin
|
|||||||
idx:=find_face(font_name );
|
idx:=find_face(font_name );
|
||||||
|
|
||||||
if idx >= 0 then
|
if idx >= 0 then
|
||||||
begin
|
begin
|
||||||
m_cur_face:=FT_Face_ptr_ptr(ptrcomp(m_faces ) + idx * sizeof(FT_Face_ptr ) )^;
|
m_cur_face:=FT_Face_ptr_ptr(ptrcomp(m_faces ) + idx * sizeof(FT_Face_ptr ) )^;
|
||||||
m_name :=PChar(face_name_ptr(ptrcomp(m_face_names ) + idx * sizeof(face_name ) ).name );
|
m_name :=PChar(face_name_ptr(ptrcomp(m_face_names ) + idx * sizeof(face_name ) ).name );
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if m_num_faces >= m_max_faces then
|
if m_num_faces >= m_max_faces then
|
||||||
begin
|
begin
|
||||||
agg_freemem (pointer(m_face_names.name ) ,m_face_names.size );
|
agg_freemem (pointer(m_face_names.name ) ,m_face_names.size );
|
||||||
@ -977,7 +977,7 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if m_last_error = 0 then
|
if m_last_error = 0 then
|
||||||
begin
|
begin
|
||||||
@ -1238,7 +1238,7 @@ begin
|
|||||||
m_glyph_index:=FT_Get_Char_Index(m_cur_face ,glyph_code );
|
m_glyph_index:=FT_Get_Char_Index(m_cur_face ,glyph_code );
|
||||||
|
|
||||||
if m_hinting then
|
if m_hinting then
|
||||||
m_last_error:=FT_Load_Glyph(m_cur_face ,m_glyph_index ,FT_LOAD_DEFAULT{} {FT_LOAD_FORCE_AUTOHINT{} )
|
m_last_error:=FT_Load_Glyph(m_cur_face ,m_glyph_index ,FT_LOAD_DEFAULT {FT_LOAD_FORCE_AUTOHINT} )
|
||||||
else
|
else
|
||||||
m_last_error:=FT_Load_Glyph(m_cur_face ,m_glyph_index ,FT_LOAD_NO_HINTING );
|
m_last_error:=FT_Load_Glyph(m_cur_face ,m_glyph_index ,FT_LOAD_NO_HINTING );
|
||||||
|
|
||||||
@ -1727,5 +1727,5 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
END.
|
end.
|
||||||
|
|
||||||
|
@ -31,80 +31,138 @@ INTERFACE
|
|||||||
|
|
||||||
{$I agg_mode.inc }
|
{$I agg_mode.inc }
|
||||||
|
|
||||||
|
{$packrecords c}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
agg_basics ;
|
agg_basics ;
|
||||||
|
|
||||||
{ GLOBAL VARIABLES & CONSTANTS }
|
|
||||||
type
|
type
|
||||||
FT_Encoding = array[0..3 ] of char;
|
FT_Encoding = array[0..3] of char;
|
||||||
|
|
||||||
const
|
const
|
||||||
{$IFDEF AGG_WINDOWS }
|
{$IFDEF WINDOWS }
|
||||||
ft_lib = 'freetype.dll';
|
ft_lib = 'freetype.dll';
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
{$IFDEF AGG_LINUX }
|
// Linux, FreeBSD etc.
|
||||||
ft_lib = 'freetype.so';
|
{$if defined(UNIX) and not defined(darwin)}
|
||||||
|
ft_lib = 'freetype';
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
{$IFDEF AGG_MACOSX }
|
// Mac OS X
|
||||||
ft_lib = 'libfreetype';
|
{$ifdef darwin}
|
||||||
|
ft_lib = 'libfreetype';
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
FT_CURVE_TAG_ON = 1;
|
FT_CURVE_TAG_ON = 1;
|
||||||
FT_CURVE_TAG_CONIC = 0;
|
FT_CURVE_TAG_CONIC = 0;
|
||||||
FT_CURVE_TAG_CUBIC = 2;
|
FT_CURVE_TAG_CUBIC = 2;
|
||||||
|
|
||||||
FT_FACE_FLAG_SCALABLE = 1 shl 0;
|
FT_FACE_FLAG_SCALABLE = 1 shl 0;
|
||||||
FT_FACE_FLAG_KERNING = 1 shl 6;
|
FT_FACE_FLAG_FIXED_SIZES = 1 shl 1;
|
||||||
|
FT_FACE_FLAG_FIXED_WIDTH = 1 shl 2;
|
||||||
|
FT_FACE_FLAG_SFNT = 1 shl 3;
|
||||||
|
FT_FACE_FLAG_HORIZONTAL = 1 shl 4;
|
||||||
|
FT_FACE_FLAG_VERTICAL = 1 shl 5;
|
||||||
|
FT_FACE_FLAG_KERNING = 1 shl 6;
|
||||||
|
FT_FACE_FLAG_FAST_GLYPHS = 1 shl 7;
|
||||||
|
FT_FACE_FLAG_MULTIPLE_MASTERS = 1 shl 8;
|
||||||
|
FT_FACE_FLAG_GLYPH_NAMES = 1 shl 9;
|
||||||
|
FT_FACE_FLAG_EXTERNAL_STREAM = 1 shl 10;
|
||||||
|
|
||||||
FT_ENCODING_NONE : FT_Encoding = (#0 ,#0 ,#0 ,#0 );
|
FT_STYLE_FLAG_ITALIC = 1 shl 0;
|
||||||
|
FT_STYLE_FLAG_BOLD = 1 shl 1;
|
||||||
|
|
||||||
FT_LOAD_DEFAULT = $0000;
|
FT_LOAD_DEFAULT = $0000;
|
||||||
FT_LOAD_NO_HINTING = $0002;
|
FT_LOAD_NO_SCALE = $0001;
|
||||||
FT_LOAD_FORCE_AUTOHINT = $0020;
|
FT_LOAD_NO_HINTING = $0002;
|
||||||
|
FT_LOAD_RENDER = $0004;
|
||||||
|
FT_LOAD_NO_BITMAP = $0008;
|
||||||
|
FT_LOAD_VERTICAL_LAYOUT = $0010;
|
||||||
|
FT_LOAD_FORCE_AUTOHINT = $0020;
|
||||||
|
FT_LOAD_CROP_BITMAP = $0040;
|
||||||
|
FT_LOAD_PEDANTIC = $0080;
|
||||||
|
FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = $0200;
|
||||||
|
FT_LOAD_NO_RECURSE = $0400;
|
||||||
|
FT_LOAD_IGNORE_TRANSFORM = $0800;
|
||||||
|
FT_LOAD_MONOCHROME = $1000;
|
||||||
|
FT_LOAD_LINEAR_DESIGN = $2000;
|
||||||
|
|
||||||
FT_RENDER_MODE_NORMAL = 0;
|
ft_glyph_format_none = $00000000;
|
||||||
FT_RENDER_MODE_LIGHT = FT_RENDER_MODE_NORMAL + 1;
|
ft_glyph_format_composite = $636F6D70; //comp 099 111 109 112
|
||||||
FT_RENDER_MODE_MONO = FT_RENDER_MODE_LIGHT + 1;
|
ft_glyph_format_bitmap = $62697473; //bits 098 105 116 115
|
||||||
FT_RENDER_MODE_LCD = FT_RENDER_MODE_MONO + 1;
|
ft_glyph_format_outline = $6F75746C; //outl 111 117 116 108
|
||||||
FT_RENDER_MODE_LCD_V = FT_RENDER_MODE_LCD + 1;
|
ft_glyph_format_plotter = $706C6F74; //plot 112 108 111 116
|
||||||
FT_RENDER_MODE_MAX = FT_RENDER_MODE_LCD_V + 1;
|
|
||||||
|
|
||||||
FT_KERNING_DEFAULT = 0;
|
FT_ENCODING_NONE : FT_Encoding = (#0 ,#0 ,#0 ,#0 );
|
||||||
FT_KERNING_UNFITTED = 1;
|
FT_ENCODING_MS_SYMBOL : FT_Encoding = 'symb';
|
||||||
FT_KERNING_UNSCALED = 2;
|
FT_ENCODING_UNICODE : FT_Encoding = 'unic';
|
||||||
|
FT_ENCODING_MS_SJIS : FT_Encoding = 'sjis';
|
||||||
|
FT_ENCODING_MS_GB2312 : FT_Encoding = 'gb ';
|
||||||
|
FT_ENCODING_MS_BIG5 : FT_Encoding = 'big5';
|
||||||
|
FT_ENCODING_MS_WANSUNG : FT_Encoding = 'wans';
|
||||||
|
FT_ENCODING_MS_JOHAB : FT_Encoding = 'joha';
|
||||||
|
FT_ENCODING_ADOBE_STANDARD : FT_Encoding = 'ADOB';
|
||||||
|
FT_ENCODING_ADOBE_EXPERT : FT_Encoding = 'ADBE';
|
||||||
|
FT_ENCODING_ADOBE_CUSTOM : FT_Encoding = 'ADBC';
|
||||||
|
FT_ENCODING_ADOBE_LATIN_1 : FT_Encoding = 'lat1';
|
||||||
|
FT_ENCODING_OLD_LATIN_2 : FT_Encoding = 'lat2';
|
||||||
|
FT_ENCODING_APPLE_ROMAN : FT_Encoding = 'armn';
|
||||||
|
|
||||||
|
ft_glyph_bbox_unscaled = 0; //* return unscaled font units */
|
||||||
|
ft_glyph_bbox_subpixels = 0; //* return unfitted 26.6 coordinates */
|
||||||
|
ft_glyph_bbox_gridfit = 1; //* return grid-fitted 26.6 coordinates */
|
||||||
|
ft_glyph_bbox_truncate = 2; //* return coordinates in integer pixels */
|
||||||
|
ft_glyph_bbox_pixels = 3; //* return grid-fitted pixel coordinates */
|
||||||
|
|
||||||
|
FT_KERNING_DEFAULT = 0;
|
||||||
|
FT_KERNING_UNFITTED = 1;
|
||||||
|
FT_KERNING_UNSCALED = 2;
|
||||||
|
|
||||||
FT_STYLE_FLAG_ITALIC = 1 shl 0;
|
|
||||||
FT_STYLE_FLAG_BOLD = 1 shl 1;
|
|
||||||
|
|
||||||
{ TYPES DEFINITION }
|
{ TYPES DEFINITION }
|
||||||
type
|
type
|
||||||
FT_Byte = byte;
|
|
||||||
FT_Short = smallint;
|
|
||||||
FT_UShort = word;
|
|
||||||
FT_Int = longint;
|
|
||||||
FT_UInt = longword;
|
|
||||||
FT_Int32 = longint;
|
|
||||||
FT_Long = longint;
|
|
||||||
FT_ULong = longword;
|
|
||||||
FT_Fixed = longint;
|
|
||||||
FT_Pos = longint;
|
|
||||||
FT_Error = longint;
|
|
||||||
FT_F26Dot6 = longint;
|
|
||||||
|
|
||||||
FT_Byte_ptr = ^FT_Byte;
|
FT_Bool = boolean;
|
||||||
FT_Short_ptr = ^FT_Short;
|
FT_FWord = smallint;
|
||||||
|
FT_UFWord = word;
|
||||||
|
FT_Char = char;
|
||||||
|
FT_Byte = byte;
|
||||||
|
FT_String = char;
|
||||||
|
FT_Short = smallint;
|
||||||
|
FT_UShort = word;
|
||||||
|
FT_Int = longint;
|
||||||
|
FT_UInt = longword;
|
||||||
|
FT_Int32 = longint;
|
||||||
|
{$if defined(cpu64) and not(defined(win64) and defined(cpux86_64))}
|
||||||
|
FT_Long = int64;
|
||||||
|
FT_ULong = qword;
|
||||||
|
FT_Pos = int64;
|
||||||
|
{$ELSE}
|
||||||
|
FT_Long = longint;
|
||||||
|
FT_ULong = longword;
|
||||||
|
FT_Pos = longint;
|
||||||
|
{$ENDIF}
|
||||||
|
FT_F2Dot14 = smallint;
|
||||||
|
FT_F26Dot6 = longint;
|
||||||
|
FT_Fixed = FT_Long;
|
||||||
|
FT_Error = longint;
|
||||||
|
FT_Pointer = pointer;
|
||||||
|
|
||||||
FT_Render_Mode = FT_Int;
|
FT_Byte_ptr = ^FT_Byte;
|
||||||
|
FT_Short_ptr = ^FT_Short;
|
||||||
|
|
||||||
|
FT_Render_Mode = (FT_RENDER_MODE_NORMAL, FT_RENDER_MODE_LIGHT,
|
||||||
|
FT_RENDER_MODE_MONO, FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V,
|
||||||
|
FT_RENDER_MODE_MAX);
|
||||||
|
|
||||||
FT_Library_ptr_ptr = ^FT_Library_ptr;
|
FT_Library_ptr_ptr = ^FT_Library_ptr;
|
||||||
FT_Library_ptr = ^FT_Library;
|
FT_Library_ptr = ^FT_Library;
|
||||||
FT_Library = packed record
|
FT_Library = record
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FT_Subglyph_ptr = ^FT_Subglyph;
|
FT_Subglyph_ptr = ^FT_Subglyph;
|
||||||
FT_Subglyph = packed record // TODO
|
FT_Subglyph = record // TODO
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FT_Bitmap_Size = record
|
FT_Bitmap_Size = record
|
||||||
@ -121,14 +179,14 @@ type
|
|||||||
|
|
||||||
FT_Generic_Finalizer = procedure(AnObject : pointer ); cdecl;
|
FT_Generic_Finalizer = procedure(AnObject : pointer ); cdecl;
|
||||||
|
|
||||||
FT_Generic = packed record
|
FT_Generic = record
|
||||||
data : pointer;
|
data : pointer;
|
||||||
finalizer : FT_Generic_Finalizer;
|
finalizer : FT_Generic_Finalizer;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FT_BBox_ptr = ^FT_BBox;
|
FT_BBox_ptr = ^FT_BBox;
|
||||||
FT_BBox = packed record
|
FT_BBox = record
|
||||||
xMin ,
|
xMin ,
|
||||||
yMin ,
|
yMin ,
|
||||||
xMax ,
|
xMax ,
|
||||||
@ -137,14 +195,14 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
FT_Vector_ptr = ^FT_Vector;
|
FT_Vector_ptr = ^FT_Vector;
|
||||||
FT_Vector = packed record
|
FT_Vector = record
|
||||||
x ,
|
x ,
|
||||||
y : FT_Pos;
|
y : FT_Pos;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FT_Bitmap_ptr = ^FT_Bitmap;
|
FT_Bitmap_ptr = ^FT_Bitmap;
|
||||||
FT_Bitmap = packed record
|
FT_Bitmap = record
|
||||||
rows ,
|
rows ,
|
||||||
width ,
|
width ,
|
||||||
pitch : FT_Int;
|
pitch : FT_Int;
|
||||||
@ -160,7 +218,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
FT_Outline_ptr = ^FT_Outline;
|
FT_Outline_ptr = ^FT_Outline;
|
||||||
FT_Outline = packed record
|
FT_Outline = record
|
||||||
n_contours ,
|
n_contours ,
|
||||||
n_points : FT_Short;
|
n_points : FT_Short;
|
||||||
|
|
||||||
@ -172,7 +230,7 @@ type
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FT_Glyph_Metrics = packed record
|
FT_Glyph_Metrics = record
|
||||||
width ,
|
width ,
|
||||||
height ,
|
height ,
|
||||||
|
|
||||||
@ -189,7 +247,7 @@ type
|
|||||||
FT_Face_ptr = ^FT_Face;
|
FT_Face_ptr = ^FT_Face;
|
||||||
|
|
||||||
FT_GlyphSlot_ptr = ^FT_GlyphSlot;
|
FT_GlyphSlot_ptr = ^FT_GlyphSlot;
|
||||||
FT_GlyphSlot = packed record
|
FT_GlyphSlot = record
|
||||||
alibrary : FT_Library_ptr;
|
alibrary : FT_Library_ptr;
|
||||||
|
|
||||||
face : FT_Face_ptr;
|
face : FT_Face_ptr;
|
||||||
@ -242,7 +300,7 @@ type
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FT_Face = packed record
|
FT_Face = record
|
||||||
num_faces ,
|
num_faces ,
|
||||||
face_index ,
|
face_index ,
|
||||||
face_flags ,
|
face_flags ,
|
||||||
@ -277,7 +335,7 @@ type
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FT_Charmap = packed record
|
FT_Charmap = record
|
||||||
face : FT_Face_ptr;
|
face : FT_Face_ptr;
|
||||||
encoding : FT_Encoding;
|
encoding : FT_Encoding;
|
||||||
|
|
||||||
@ -291,7 +349,7 @@ type
|
|||||||
function FT_IS_SCALABLE(face : FT_Face_ptr ) : boolean;
|
function FT_IS_SCALABLE(face : FT_Face_ptr ) : boolean;
|
||||||
function FT_HAS_KERNING(face : FT_Face_ptr ) : boolean;
|
function FT_HAS_KERNING(face : FT_Face_ptr ) : boolean;
|
||||||
|
|
||||||
function FT_Init_FreeType(alibrary : FT_Library_ptr ) : FT_Error; cdecl; external ft_lib name 'FT_Init_FreeType';
|
function FT_Init_FreeType(var alibrary : FT_Library_ptr ) : FT_Error; cdecl; external ft_lib name 'FT_Init_FreeType';
|
||||||
|
|
||||||
function FT_Done_FreeType(alibrary : FT_Library_ptr ) : FT_Error; cdecl; external ft_lib name 'FT_Done_FreeType';
|
function FT_Done_FreeType(alibrary : FT_Library_ptr ) : FT_Error; cdecl; external ft_lib name 'FT_Done_FreeType';
|
||||||
|
|
||||||
@ -351,16 +409,14 @@ end;
|
|||||||
{ FT_IS_SCALABLE }
|
{ FT_IS_SCALABLE }
|
||||||
function FT_IS_SCALABLE(face : FT_Face_ptr ) : boolean;
|
function FT_IS_SCALABLE(face : FT_Face_ptr ) : boolean;
|
||||||
begin
|
begin
|
||||||
result:=boolean(face.face_flags and FT_FACE_FLAG_SCALABLE );
|
Result := (face.face_flags and FT_FACE_FLAG_SCALABLE) = 1;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ FT_HAS_KERNING }
|
{ FT_HAS_KERNING }
|
||||||
function FT_HAS_KERNING(face : FT_Face_ptr ) : boolean;
|
function FT_HAS_KERNING(face : FT_Face_ptr ) : boolean;
|
||||||
begin
|
begin
|
||||||
result:=boolean(face.face_flags and FT_FACE_FLAG_KERNING );
|
Result := (face.face_flags and FT_FACE_FLAG_KERNING) = 1;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
END.
|
end.
|
||||||
|
|
||||||
|
@ -7,29 +7,29 @@
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
{$IFDEF CPUPOWERPC }
|
{$IFDEF CPUPOWERPC }
|
||||||
{$DEFINE AGG_CPU_PPC }
|
{$DEFINE AGG_CPU_PPC }
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
{$IFDEF CPUI386 }
|
{$IFDEF CPUI386 }
|
||||||
{$DEFINE AGG_CPU_386 }
|
{$DEFINE AGG_CPU_386 }
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
{$IFDEF CPU386 }
|
{$IFDEF CPU386 }
|
||||||
{$DEFINE AGG_CPU_386 }
|
{$DEFINE AGG_CPU_386 }
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
|
{$IFDEF CPUx86_64 }
|
||||||
|
{$DEFINE AGG_CPU_x86_64 }
|
||||||
|
{$ENDIF }
|
||||||
|
|
||||||
|
|
||||||
{$IFDEF FPC }
|
{$IFDEF FPC }
|
||||||
{$MODE DELPHI }
|
{$MODE DELPHI }
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
// OS
|
// OS
|
||||||
|
|
||||||
{$IFDEF WIN32 }
|
{$IFDEF WIN32 }
|
||||||
{$DEFINE AGG_WINDOWS }
|
{$DEFINE AGG_WINDOWS }
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
{$IFDEF WINDOWS }
|
{$IFDEF WINDOWS }
|
||||||
@ -46,15 +46,21 @@
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
|
{$IFDEF FREEBSD }
|
||||||
|
{$Warning Experimental FreeBSD support - totally untested! }
|
||||||
|
{$DEFINE AGG_LINUX }
|
||||||
|
{$IFNDEF AGG2D_NO_FONT}
|
||||||
|
{$DEFINE AGG2D_USE_FREETYPE}
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF }
|
||||||
|
|
||||||
{$IFDEF DARWIN }
|
{$IFDEF DARWIN }
|
||||||
{$DEFINE AGG_MACOSX }
|
{$DEFINE AGG_MACOSX }
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
{$IFDEF AGG_DEBUG }
|
{$IFDEF AGG_DEBUG }
|
||||||
{$DEFINE AGG_FULL_DEBUG }
|
{$DEFINE AGG_FULL_DEBUG }
|
||||||
|
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@ -72,40 +78,40 @@
|
|||||||
{$X+ }{ Extended syntax }
|
{$X+ }{ Extended syntax }
|
||||||
|
|
||||||
{$IFDEF AGG_FULL_DEBUG }
|
{$IFDEF AGG_FULL_DEBUG }
|
||||||
{$R+ }{ Range checking }
|
{$R+ }{ Range checking }
|
||||||
{$I+ }{ IO checking }
|
{$I+ }{ IO checking }
|
||||||
{$Q+ }{ Overflow checking }
|
{$Q+ }{ Overflow checking }
|
||||||
|
|
||||||
{$IFNDEF FPC }
|
{$IFNDEF FPC }
|
||||||
{$O- }{ Code Optimization }
|
{$O- }{ Code Optimization }
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
{$D+ }{ Debug Info ON }
|
{$D+ }{ Debug Info ON }
|
||||||
{$Y+ }{ References Info ON }
|
{$Y+ }{ References Info ON }
|
||||||
|
|
||||||
{$ELSE }
|
{$ELSE }
|
||||||
{$R- }{ Range checking }
|
{$R- }{ Range checking }
|
||||||
{$I- }{ IO checking }
|
{$I- }{ IO checking }
|
||||||
{$Q- }{ Overflow checking }
|
{$Q- }{ Overflow checking }
|
||||||
|
|
||||||
{ Code Optimization }
|
{ Code Optimization }
|
||||||
{$IFNDEF FPC }
|
{$IFNDEF FPC }
|
||||||
{$IFDEF AGG_OPTIMIZE }
|
{$IFDEF AGG_OPTIMIZE }
|
||||||
{$O+ }
|
{$O+ }
|
||||||
{$ELSE }
|
{$ELSE }
|
||||||
{$O- }
|
{$O- }
|
||||||
|
{$ENDIF }
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
{$ENDIF }
|
|
||||||
|
|
||||||
{$D- }{ Debug Info OFF }
|
|
||||||
{$IFNDEF FPC}
|
|
||||||
{$Y- }{ References Info OFF }
|
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
|
{$D- }{ Debug Info OFF }
|
||||||
|
{$IFNDEF FPC}
|
||||||
|
{$Y- }{ References Info OFF }
|
||||||
|
{$ENDIF}
|
||||||
{$ENDIF }
|
{$ENDIF }
|
||||||
|
|
||||||
{$IFNDEF AGG2D_USE_WINFONTS}
|
{$IFNDEF AGG2D_USE_WINFONTS}
|
||||||
{$IFNDEF AGG2D_USE_FREETYPE}
|
{$IFNDEF AGG2D_USE_FREETYPE}
|
||||||
{$DEFINE AGG2D_NO_FONT}
|
{$DEFINE AGG2D_NO_FONT}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
@ -1352,21 +1352,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ FILLING_RULE }
|
{ FILLING_RULE }
|
||||||
procedure rasterizer_scanline_aa.filling_rule;
|
procedure rasterizer_scanline_aa.filling_rule(filling_rule_: filling_rule_e);
|
||||||
begin
|
begin
|
||||||
m_filling_rule:=filling_rule_;
|
m_filling_rule:=filling_rule_;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ AUTO_CLOSE }
|
{ AUTO_CLOSE }
|
||||||
procedure rasterizer_scanline_aa.auto_close;
|
procedure rasterizer_scanline_aa.auto_close(flag: boolean);
|
||||||
begin
|
begin
|
||||||
m_auto_close:=flag;
|
m_auto_close:=flag;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ CLIP_BOX }
|
{ CLIP_BOX }
|
||||||
procedure rasterizer_scanline_aa.clip_box;
|
procedure rasterizer_scanline_aa.clip_box(x1, y1, x2, y2: double);
|
||||||
begin
|
begin
|
||||||
reset;
|
reset;
|
||||||
|
|
||||||
@ -1382,7 +1382,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ GAMMA }
|
{ GAMMA }
|
||||||
procedure rasterizer_scanline_aa.gamma;
|
procedure rasterizer_scanline_aa.gamma(gamma_function: vertex_source_ptr);
|
||||||
var
|
var
|
||||||
i : int;
|
i : int;
|
||||||
|
|
||||||
@ -1395,14 +1395,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ APPLY_GAMMA }
|
{ APPLY_GAMMA }
|
||||||
function rasterizer_scanline_aa.apply_gamma;
|
function rasterizer_scanline_aa.apply_gamma(cover: unsigned): unsigned;
|
||||||
begin
|
begin
|
||||||
result:=m_gamma[cover ];
|
result:=m_gamma[cover ];
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ MOVE_TO_NO_CLIP }
|
{ MOVE_TO_NO_CLIP }
|
||||||
procedure rasterizer_scanline_aa.move_to_no_clip;
|
procedure rasterizer_scanline_aa.move_to_no_clip(x, y: int);
|
||||||
begin
|
begin
|
||||||
if (m_status = status_line_to ) and
|
if (m_status = status_line_to ) and
|
||||||
m_auto_close then
|
m_auto_close then
|
||||||
@ -1418,7 +1418,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ LINE_TO_NO_CLIP }
|
{ LINE_TO_NO_CLIP }
|
||||||
procedure rasterizer_scanline_aa.line_to_no_clip;
|
procedure rasterizer_scanline_aa.line_to_no_clip(x, y: int);
|
||||||
begin
|
begin
|
||||||
if m_status <> status_initial then
|
if m_status <> status_initial then
|
||||||
begin
|
begin
|
||||||
@ -1455,7 +1455,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ CLIP_SEGMENT }
|
{ CLIP_SEGMENT }
|
||||||
procedure rasterizer_scanline_aa.clip_segment;
|
procedure rasterizer_scanline_aa.clip_segment(x, y: int);
|
||||||
var
|
var
|
||||||
flags ,n : unsigned;
|
flags ,n : unsigned;
|
||||||
|
|
||||||
@ -1502,21 +1502,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ MOVE_TO_D }
|
{ MOVE_TO_D }
|
||||||
procedure rasterizer_scanline_aa.move_to_d;
|
procedure rasterizer_scanline_aa.move_to_d(x, y: double);
|
||||||
begin
|
begin
|
||||||
move_to(poly_coord(x ) ,poly_coord(y ) );
|
move_to(poly_coord(x ) ,poly_coord(y ) );
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ LINE_TO_D }
|
{ LINE_TO_D }
|
||||||
procedure rasterizer_scanline_aa.line_to_d;
|
procedure rasterizer_scanline_aa.line_to_d(x, y: double);
|
||||||
begin
|
begin
|
||||||
line_to(poly_coord(x ) ,poly_coord(y ) );
|
line_to(poly_coord(x ) ,poly_coord(y ) );
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ MOVE_TO }
|
{ MOVE_TO }
|
||||||
procedure rasterizer_scanline_aa.move_to;
|
procedure rasterizer_scanline_aa.move_to(x, y: int);
|
||||||
begin
|
begin
|
||||||
if m_clipping then
|
if m_clipping then
|
||||||
begin
|
begin
|
||||||
@ -1545,7 +1545,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ LINE_TO }
|
{ LINE_TO }
|
||||||
procedure rasterizer_scanline_aa.line_to;
|
procedure rasterizer_scanline_aa.line_to(x, y: int);
|
||||||
begin
|
begin
|
||||||
if m_clipping then
|
if m_clipping then
|
||||||
clip_segment(x ,y )
|
clip_segment(x ,y )
|
||||||
@ -1562,7 +1562,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ REWIND_SCANLINES }
|
{ REWIND_SCANLINES }
|
||||||
function rasterizer_scanline_aa.rewind_scanlines;
|
function rasterizer_scanline_aa.rewind_scanlines: boolean;
|
||||||
begin
|
begin
|
||||||
if m_auto_close then
|
if m_auto_close then
|
||||||
close_polygon;
|
close_polygon;
|
||||||
@ -1583,7 +1583,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ SWEEP_SCANLINE }
|
{ SWEEP_SCANLINE }
|
||||||
function rasterizer_scanline_aa.sweep_scanline;
|
function rasterizer_scanline_aa.sweep_scanline(sl: scanline_ptr): boolean;
|
||||||
var
|
var
|
||||||
x ,
|
x ,
|
||||||
area ,
|
area ,
|
||||||
@ -1678,7 +1678,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ NAVIGATE_SCANLINE }
|
{ NAVIGATE_SCANLINE }
|
||||||
function rasterizer_scanline_aa.navigate_scanline;
|
function rasterizer_scanline_aa.navigate_scanline(y: int): boolean;
|
||||||
begin
|
begin
|
||||||
if m_auto_close then
|
if m_auto_close then
|
||||||
close_polygon;
|
close_polygon;
|
||||||
@ -1701,7 +1701,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ HIT_TEST }
|
{ HIT_TEST }
|
||||||
function rasterizer_scanline_aa.hit_test;
|
function rasterizer_scanline_aa.hit_test(tx, ty: int): boolean;
|
||||||
var
|
var
|
||||||
sl : scanline_hit_test;
|
sl : scanline_hit_test;
|
||||||
|
|
||||||
@ -1722,35 +1722,35 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ _MIN_X }
|
{ _MIN_X }
|
||||||
function rasterizer_scanline_aa._min_x;
|
function rasterizer_scanline_aa._min_x: int;
|
||||||
begin
|
begin
|
||||||
result:=m_outline._min_x;
|
result:=m_outline._min_x;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ _MIN_Y }
|
{ _MIN_Y }
|
||||||
function rasterizer_scanline_aa._min_y;
|
function rasterizer_scanline_aa._min_y: int;
|
||||||
begin
|
begin
|
||||||
result:=m_outline._min_y;
|
result:=m_outline._min_y;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ _MAX_X }
|
{ _MAX_X }
|
||||||
function rasterizer_scanline_aa._max_x;
|
function rasterizer_scanline_aa._max_x: int;
|
||||||
begin
|
begin
|
||||||
result:=m_outline._max_x;
|
result:=m_outline._max_x;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ _MAX_Y }
|
{ _MAX_Y }
|
||||||
function rasterizer_scanline_aa._max_y;
|
function rasterizer_scanline_aa._max_y: int;
|
||||||
begin
|
begin
|
||||||
result:=m_outline._max_y;
|
result:=m_outline._max_y;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ CALCULATE_ALPHA }
|
{ CALCULATE_ALPHA }
|
||||||
function rasterizer_scanline_aa.calculate_alpha;
|
function rasterizer_scanline_aa.calculate_alpha(area: int): unsigned;
|
||||||
var
|
var
|
||||||
cover : system.integer;
|
cover : system.integer;
|
||||||
|
|
||||||
@ -1779,7 +1779,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ ADD_PATH }
|
{ ADD_PATH }
|
||||||
procedure rasterizer_scanline_aa.add_path;
|
procedure rasterizer_scanline_aa.add_path(vs: vertex_source_ptr; path_id: unsigned);
|
||||||
var
|
var
|
||||||
cmd : unsigned;
|
cmd : unsigned;
|
||||||
x ,y : double;
|
x ,y : double;
|
||||||
@ -1800,7 +1800,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ ADD_VERTEX }
|
{ ADD_VERTEX }
|
||||||
procedure rasterizer_scanline_aa.add_vertex;
|
procedure rasterizer_scanline_aa.add_vertex(x, y: double; cmd: unsigned);
|
||||||
begin
|
begin
|
||||||
if is_close(cmd ) then
|
if is_close(cmd ) then
|
||||||
close_polygon
|
close_polygon
|
||||||
|
@ -79,6 +79,7 @@ type
|
|||||||
function bounding_ymax : int; virtual;
|
function bounding_ymax : int; virtual;
|
||||||
|
|
||||||
procedure clear(c : aggclr_ptr );
|
procedure clear(c : aggclr_ptr );
|
||||||
|
procedure fill(const c: aggclr_ptr);
|
||||||
|
|
||||||
procedure copy_pixel (x ,y : int; c : aggclr_ptr ); virtual;
|
procedure copy_pixel (x ,y : int; c : aggclr_ptr ); virtual;
|
||||||
procedure blend_pixel(x ,y : int; c : aggclr_ptr; cover : int8u ); virtual;
|
procedure blend_pixel(x ,y : int; c : aggclr_ptr; cover : int8u ); virtual;
|
||||||
@ -127,7 +128,7 @@ type
|
|||||||
dy : int = 0;
|
dy : int = 0;
|
||||||
cover : int8u = cover_full );
|
cover : int8u = cover_full );
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ GLOBAL PROCEDURES }
|
{ GLOBAL PROCEDURES }
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ type
|
|||||||
IMPLEMENTATION
|
IMPLEMENTATION
|
||||||
{ UNIT IMPLEMENTATION }
|
{ UNIT IMPLEMENTATION }
|
||||||
{ CONSTRUCT }
|
{ CONSTRUCT }
|
||||||
constructor renderer_base.Construct;
|
constructor renderer_base.Construct(ren_: pixel_formats_ptr);
|
||||||
var
|
var
|
||||||
w ,h : int;
|
w ,h : int;
|
||||||
|
|
||||||
@ -159,28 +160,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ REN }
|
{ REN }
|
||||||
function renderer_base.ren;
|
function renderer_base.ren: pixel_formats_ptr;
|
||||||
begin
|
begin
|
||||||
result:=m_ren;
|
result:=m_ren;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ WIDTH }
|
{ WIDTH }
|
||||||
function renderer_base.width;
|
function renderer_base.width: unsigned;
|
||||||
begin
|
begin
|
||||||
result:=m_ren._width;
|
result:=m_ren._width;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ HEIGHT }
|
{ HEIGHT }
|
||||||
function renderer_base.height;
|
function renderer_base.height: unsigned;
|
||||||
begin
|
begin
|
||||||
result:=m_ren._height;
|
result:=m_ren._height;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ CLIP_BOX_NAKED }
|
{ CLIP_BOX_NAKED }
|
||||||
procedure renderer_base.clip_box_naked;
|
procedure renderer_base.clip_box_naked(x1, y1, x2, y2: int);
|
||||||
begin
|
begin
|
||||||
m_clip_box.x1:=x1;
|
m_clip_box.x1:=x1;
|
||||||
m_clip_box.y1:=y1;
|
m_clip_box.y1:=y1;
|
||||||
@ -190,7 +191,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ INBOX }
|
{ INBOX }
|
||||||
function renderer_base.inbox;
|
function renderer_base.inbox(x, y: int): boolean;
|
||||||
begin
|
begin
|
||||||
result:=
|
result:=
|
||||||
(x >= m_clip_box.x1 ) and
|
(x >= m_clip_box.x1 ) and
|
||||||
@ -201,7 +202,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ CLIP_BOX_ }
|
{ CLIP_BOX_ }
|
||||||
function renderer_base.clip_box_;
|
function renderer_base.clip_box_(x1, y1, x2, y2: int): boolean;
|
||||||
var
|
var
|
||||||
cb ,
|
cb ,
|
||||||
rc : rect;
|
rc : rect;
|
||||||
@ -232,7 +233,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ RESET_CLIPPING }
|
{ RESET_CLIPPING }
|
||||||
procedure renderer_base.reset_clipping;
|
procedure renderer_base.reset_clipping(visibility: boolean);
|
||||||
begin
|
begin
|
||||||
if visibility then
|
if visibility then
|
||||||
begin
|
begin
|
||||||
@ -259,84 +260,84 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ NEXT_CLIP_BOX }
|
{ NEXT_CLIP_BOX }
|
||||||
function renderer_base.next_clip_box;
|
function renderer_base.next_clip_box: boolean;
|
||||||
begin
|
begin
|
||||||
result:=false;
|
result:=false;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ _CLIP_BOX }
|
{ _CLIP_BOX }
|
||||||
function renderer_base._clip_box;
|
function renderer_base._clip_box: rect_ptr;
|
||||||
begin
|
begin
|
||||||
result:=@m_clip_box;
|
result:=@m_clip_box;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ _XMIN }
|
{ _XMIN }
|
||||||
function renderer_base._xmin;
|
function renderer_base._xmin: int;
|
||||||
begin
|
begin
|
||||||
result:=m_clip_box.x1;
|
result:=m_clip_box.x1;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ _YMIN }
|
{ _YMIN }
|
||||||
function renderer_base._ymin;
|
function renderer_base._ymin: int;
|
||||||
begin
|
begin
|
||||||
result:=m_clip_box.y1;
|
result:=m_clip_box.y1;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ _XMAX }
|
{ _XMAX }
|
||||||
function renderer_base._xmax;
|
function renderer_base._xmax: int;
|
||||||
begin
|
begin
|
||||||
result:=m_clip_box.x2;
|
result:=m_clip_box.x2;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ _YMAX }
|
{ _YMAX }
|
||||||
function renderer_base._ymax;
|
function renderer_base._ymax: int;
|
||||||
begin
|
begin
|
||||||
result:=m_clip_box.y2;
|
result:=m_clip_box.y2;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ BOUNDING_CLIP_BOX }
|
{ BOUNDING_CLIP_BOX }
|
||||||
function renderer_base.bounding_clip_box;
|
function renderer_base.bounding_clip_box: rect_ptr;
|
||||||
begin
|
begin
|
||||||
result:=@m_clip_box;
|
result:=@m_clip_box;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ BOUNDING_XMIN }
|
{ BOUNDING_XMIN }
|
||||||
function renderer_base.bounding_xmin;
|
function renderer_base.bounding_xmin: int;
|
||||||
begin
|
begin
|
||||||
result:=m_clip_box.x1;
|
result:=m_clip_box.x1;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ BOUNDING_YMIN }
|
{ BOUNDING_YMIN }
|
||||||
function renderer_base.bounding_ymin;
|
function renderer_base.bounding_ymin: int;
|
||||||
begin
|
begin
|
||||||
result:=m_clip_box.y1;
|
result:=m_clip_box.y1;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ BOUNDING_XMAX }
|
{ BOUNDING_XMAX }
|
||||||
function renderer_base.bounding_xmax;
|
function renderer_base.bounding_xmax: int;
|
||||||
begin
|
begin
|
||||||
result:=m_clip_box.x2;
|
result:=m_clip_box.x2;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ BOUNDING_YMAX }
|
{ BOUNDING_YMAX }
|
||||||
function renderer_base.bounding_ymax;
|
function renderer_base.bounding_ymax: int;
|
||||||
begin
|
begin
|
||||||
result:=m_clip_box.y2;
|
result:=m_clip_box.y2;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ CLEAR }
|
{ CLEAR }
|
||||||
procedure renderer_base.clear;
|
procedure renderer_base.clear(c: aggclr_ptr);
|
||||||
var
|
var
|
||||||
y : unsigned;
|
y : unsigned;
|
||||||
|
|
||||||
@ -348,8 +349,19 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure renderer_base.fill(const c: aggclr_ptr);
|
||||||
|
var
|
||||||
|
y: unsigned;
|
||||||
|
begin
|
||||||
|
if (width > 0) and (height > 0) then
|
||||||
|
begin
|
||||||
|
for y:=0 to height - 1 do
|
||||||
|
m_ren.blend_hline(m_ren, 0, y, width, c, cover_mask);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ COPY_PIXEL }
|
{ COPY_PIXEL }
|
||||||
procedure renderer_base.copy_pixel;
|
procedure renderer_base.copy_pixel(x, y: int; c: aggclr_ptr);
|
||||||
begin
|
begin
|
||||||
if inbox(x ,y ) then
|
if inbox(x ,y ) then
|
||||||
m_ren.copy_pixel(m_ren ,x ,y ,c );
|
m_ren.copy_pixel(m_ren ,x ,y ,c );
|
||||||
@ -357,7 +369,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_PIXEL }
|
{ BLEND_PIXEL }
|
||||||
procedure renderer_base.blend_pixel;
|
procedure renderer_base.blend_pixel(x, y: int; c: aggclr_ptr; cover: int8u);
|
||||||
begin
|
begin
|
||||||
if inbox(x ,y ) then
|
if inbox(x ,y ) then
|
||||||
m_ren.blend_pixel(m_ren ,x ,y ,c ,cover );
|
m_ren.blend_pixel(m_ren ,x ,y ,c ,cover );
|
||||||
@ -365,7 +377,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ PIXEL }
|
{ PIXEL }
|
||||||
function renderer_base.pixel;
|
function renderer_base.pixel(x, y: int): aggclr;
|
||||||
begin
|
begin
|
||||||
if inbox(x ,y ) then
|
if inbox(x ,y ) then
|
||||||
result:=m_ren.pixel(m_ren ,x ,y )
|
result:=m_ren.pixel(m_ren ,x ,y )
|
||||||
@ -375,7 +387,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ COPY_HLINE }
|
{ COPY_HLINE }
|
||||||
procedure renderer_base.copy_hline;
|
procedure renderer_base.copy_hline(x1, y, x2: int; c: aggclr_ptr);
|
||||||
var
|
var
|
||||||
t : int;
|
t : int;
|
||||||
|
|
||||||
@ -411,7 +423,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ COPY_VLINE }
|
{ COPY_VLINE }
|
||||||
procedure renderer_base.copy_vline;
|
procedure renderer_base.copy_vline(x, y1, y2: int; c: aggclr_ptr);
|
||||||
var
|
var
|
||||||
t : int;
|
t : int;
|
||||||
|
|
||||||
@ -447,7 +459,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_HLINE }
|
{ BLEND_HLINE }
|
||||||
procedure renderer_base.blend_hline;
|
procedure renderer_base.blend_hline(x1, y, x2: int; c: aggclr_ptr; cover: int8u);
|
||||||
var
|
var
|
||||||
t : int;
|
t : int;
|
||||||
|
|
||||||
@ -483,7 +495,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_VLINE }
|
{ BLEND_VLINE }
|
||||||
procedure renderer_base.blend_vline;
|
procedure renderer_base.blend_vline(x, y1, y2: int; c: aggclr_ptr; cover: int8u);
|
||||||
var
|
var
|
||||||
t : int;
|
t : int;
|
||||||
|
|
||||||
@ -519,7 +531,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ COPY_BAR }
|
{ COPY_BAR }
|
||||||
procedure renderer_base.copy_bar;
|
procedure renderer_base.copy_bar(x1, y1, x2, y2: int; c: aggclr_ptr);
|
||||||
var
|
var
|
||||||
y : int;
|
y : int;
|
||||||
rc : rect;
|
rc : rect;
|
||||||
@ -545,7 +557,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_BAR }
|
{ BLEND_BAR }
|
||||||
procedure renderer_base.blend_bar;
|
procedure renderer_base.blend_bar(x1, y1, x2, y2: int; c: aggclr_ptr; cover: int8u);
|
||||||
var
|
var
|
||||||
rc : rect;
|
rc : rect;
|
||||||
y : int;
|
y : int;
|
||||||
@ -570,13 +582,15 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ SPAN {not_implemented}
|
{ SPAN - not_implemented}
|
||||||
function renderer_base.span;
|
{$NOTE renderer_base.span not implemented yet}
|
||||||
|
function renderer_base.span(x, y: int; len: unsigned): pointer;
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_SOLID_HSPAN }
|
{ BLEND_SOLID_HSPAN }
|
||||||
procedure renderer_base.blend_solid_hspan;
|
procedure renderer_base.blend_solid_hspan(x, y, len: int; c: aggclr_ptr;
|
||||||
|
covers: int8u_ptr);
|
||||||
begin
|
begin
|
||||||
if y > _ymax then
|
if y > _ymax then
|
||||||
exit;
|
exit;
|
||||||
@ -611,7 +625,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_SOLID_VSPAN }
|
{ BLEND_SOLID_VSPAN }
|
||||||
procedure renderer_base.blend_solid_vspan;
|
procedure renderer_base.blend_solid_vspan(x, y, len: int; c: aggclr_ptr;
|
||||||
|
covers: int8u_ptr);
|
||||||
begin
|
begin
|
||||||
if x > _xmax then
|
if x > _xmax then
|
||||||
exit;
|
exit;
|
||||||
@ -646,7 +661,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ COPY_COLOR_HSPAN }
|
{ COPY_COLOR_HSPAN }
|
||||||
procedure renderer_base.copy_color_hspan;
|
procedure renderer_base.copy_color_hspan(x, y, len: int; colors: aggclr_ptr);
|
||||||
var
|
var
|
||||||
d : int;
|
d : int;
|
||||||
|
|
||||||
@ -686,7 +701,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_COLOR_HSPAN }
|
{ BLEND_COLOR_HSPAN }
|
||||||
procedure renderer_base.blend_color_hspan;
|
procedure renderer_base.blend_color_hspan(x, y, len: int; colors: aggclr_ptr;
|
||||||
|
covers: int8u_ptr; cover: int8u);
|
||||||
var
|
var
|
||||||
d : int;
|
d : int;
|
||||||
|
|
||||||
@ -729,7 +745,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_COLOR_VSPAN }
|
{ BLEND_COLOR_VSPAN }
|
||||||
procedure renderer_base.blend_color_vspan;
|
procedure renderer_base.blend_color_vspan(x, y, len: int; colors: aggclr_ptr;
|
||||||
|
covers: int8u_ptr; cover: int8u);
|
||||||
var
|
var
|
||||||
d : int;
|
d : int;
|
||||||
|
|
||||||
@ -771,27 +788,29 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ COPY_COLOR_HSPAN_NO_CLIP {not_implemented}
|
{ COPY_COLOR_HSPAN_NO_CLIP - not_implemented}
|
||||||
procedure renderer_base.copy_color_hspan_no_clip;
|
procedure renderer_base.copy_color_hspan_no_clip(x, y, len: int; colors: aggclr_ptr);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_COLOR_HSPAN_NO_CLIP }
|
{ BLEND_COLOR_HSPAN_NO_CLIP }
|
||||||
procedure renderer_base.blend_color_hspan_no_clip;
|
procedure renderer_base.blend_color_hspan_no_clip(x, y, len: int; colors: aggclr_ptr;
|
||||||
|
covers: int8u_ptr; cover: int8u);
|
||||||
begin
|
begin
|
||||||
m_ren.blend_color_hspan(m_ren ,x ,y ,len ,colors ,covers ,cover );
|
m_ren.blend_color_hspan(m_ren ,x ,y ,len ,colors ,covers ,cover );
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_COLOR_VSPAN_NO_CLIP }
|
{ BLEND_COLOR_VSPAN_NO_CLIP }
|
||||||
procedure renderer_base.blend_color_vspan_no_clip;
|
procedure renderer_base.blend_color_vspan_no_clip(x, y, len: int; colors: aggclr_ptr;
|
||||||
|
covers: int8u_ptr; cover: int8u);
|
||||||
begin
|
begin
|
||||||
m_ren.blend_color_vspan(m_ren ,x ,y ,len ,colors ,covers ,cover );
|
m_ren.blend_color_vspan(m_ren ,x ,y ,len ,colors ,covers ,cover );
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ CLIP_RECT_AREA }
|
{ CLIP_RECT_AREA }
|
||||||
function renderer_base.clip_rect_area;
|
function renderer_base.clip_rect_area(dst, src: rect_ptr; wsrc, hsrc: int): rect;
|
||||||
var
|
var
|
||||||
rc ,cb : rect;
|
rc ,cb : rect;
|
||||||
|
|
||||||
@ -857,7 +876,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ COPY_FROM }
|
{ COPY_FROM }
|
||||||
procedure renderer_base.copy_from;
|
procedure renderer_base.copy_from(src: rendering_buffer_ptr; rect_src_ptr: rect_ptr;
|
||||||
|
dx: int; dy: int);
|
||||||
var
|
var
|
||||||
rsrc ,rdst ,rc : rect;
|
rsrc ,rdst ,rc : rect;
|
||||||
|
|
||||||
@ -908,7 +928,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ BLEND_FROM }
|
{ BLEND_FROM }
|
||||||
procedure renderer_base.blend_from;
|
procedure renderer_base.blend_from(src: pixel_formats_ptr; rect_src_ptr: rect_ptr;
|
||||||
|
dx: int; dy: int; cover: int8u);
|
||||||
var
|
var
|
||||||
rsrc ,rdst ,rc : rect;
|
rsrc ,rdst ,rc : rect;
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ row_ptr_cache_ptr = ^row_ptr_cache;
|
{ row_ptr_cache_ptr = ^row_ptr_cache;
|
||||||
row_ptr_cache = object(rendering_buffer ){!}
|
row_ptr_cache = object(rendering_buffer )}
|
||||||
|
|
||||||
rendering_buffer_ptr = ^rendering_buffer;
|
rendering_buffer_ptr = ^rendering_buffer;
|
||||||
rendering_buffer = object
|
rendering_buffer = object
|
||||||
@ -210,7 +210,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ _BUF }
|
{ _BUF }
|
||||||
function rendering_buffer._buf;
|
function rendering_buffer._buf: int8u_ptr;
|
||||||
begin
|
begin
|
||||||
result:=m_buf;
|
result:=m_buf;
|
||||||
|
|
||||||
|
@ -238,36 +238,36 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ WIDHT_ }
|
{ WIDTH_ }
|
||||||
procedure vcgen_stroke.width_;
|
procedure vcgen_stroke.width_(w : double );
|
||||||
begin
|
begin
|
||||||
m_width:=w * 0.5;
|
m_width:=w * 0.5;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ MITER_LIMIT_ }
|
{ MITER_LIMIT_ }
|
||||||
procedure vcgen_stroke.miter_limit_;
|
procedure vcgen_stroke.miter_limit_(ml : double );
|
||||||
begin
|
begin
|
||||||
m_miter_limit:=ml;
|
m_miter_limit:=ml;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ MITER_LIMIT_THETA_ }
|
{ MITER_LIMIT_THETA_ }
|
||||||
procedure vcgen_stroke.miter_limit_theta_;
|
procedure vcgen_stroke.miter_limit_theta_(t : double );
|
||||||
begin
|
begin
|
||||||
m_miter_limit:=1.0 / Sin(t * 0.5 );
|
m_miter_limit:=1.0 / Sin(t * 0.5 );
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ INNER_MITER_LIMIT_ }
|
{ INNER_MITER_LIMIT_ }
|
||||||
procedure vcgen_stroke.inner_miter_limit_;
|
procedure vcgen_stroke.inner_miter_limit_(ml : double );
|
||||||
begin
|
begin
|
||||||
m_inner_miter_limit:=ml;
|
m_inner_miter_limit:=ml;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ APPROXIMATION_SCALE_ }
|
{ APPROXIMATION_SCALE_ }
|
||||||
procedure vcgen_stroke.approximation_scale_;
|
procedure vcgen_stroke.approximation_scale_(as_ : double );
|
||||||
begin
|
begin
|
||||||
m_approx_scale:=as_;
|
m_approx_scale:=as_;
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ ADD_VERTEX }
|
{ ADD_VERTEX }
|
||||||
procedure vcgen_stroke.add_vertex;
|
procedure vcgen_stroke.add_vertex(x ,y : double; cmd : unsigned );
|
||||||
var
|
var
|
||||||
vd : vertex_dist;
|
vd : vertex_dist;
|
||||||
|
|
||||||
@ -365,7 +365,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ REWIND }
|
{ REWIND }
|
||||||
procedure vcgen_stroke.rewind;
|
procedure vcgen_stroke.rewind(path_id : unsigned );
|
||||||
begin
|
begin
|
||||||
if m_status = initial then
|
if m_status = initial then
|
||||||
begin
|
begin
|
||||||
@ -386,7 +386,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ VERTEX }
|
{ VERTEX }
|
||||||
function vcgen_stroke.vertex;
|
function vcgen_stroke.vertex(x ,y : double_ptr ) : unsigned;
|
||||||
var
|
var
|
||||||
c : point_type_ptr;
|
c : point_type_ptr;
|
||||||
|
|
||||||
|
@ -92,10 +92,10 @@ type
|
|||||||
// Possible formats of the rendering buffer. Initially I thought that it's
|
// Possible formats of the rendering buffer. Initially I thought that it's
|
||||||
// reasonable to create the buffer and the rendering functions in
|
// reasonable to create the buffer and the rendering functions in
|
||||||
// accordance with the native pixel format of the system because it
|
// accordance with the native pixel format of the system because it
|
||||||
// would have no overhead for pixel format conersion.
|
// would have no overhead for pixel format conversion.
|
||||||
// But eventually I came to a conclusion that having a possibility to
|
// But eventually I came to a conclusion that having a possibility to
|
||||||
// convert pixel formats on demand is a good idea. First, it was X11 where
|
// convert pixel formats on demand is a good idea. First, it was X11 where
|
||||||
// there lots of different formats and visuals and it would be great to
|
// there are lots of different formats and visuals and it would be great to
|
||||||
// render everything in, say, RGB-24 and display it automatically without
|
// render everything in, say, RGB-24 and display it automatically without
|
||||||
// any additional efforts. The second reason is to have a possibility to
|
// any additional efforts. The second reason is to have a possibility to
|
||||||
// debug renderers for different pixel formats and colorspaces having only
|
// debug renderers for different pixel formats and colorspaces having only
|
||||||
|
@ -373,7 +373,7 @@ type
|
|||||||
// It's perfect if they can be called anytime.
|
// It's perfect if they can be called anytime.
|
||||||
procedure caption_(cap : shortstring );
|
procedure caption_(cap : shortstring );
|
||||||
|
|
||||||
// These 3 menthods handle working with images. The image
|
// These 3 methods handle working with images. The image
|
||||||
// formats are the simplest ones, such as .BMP in Windows or
|
// formats are the simplest ones, such as .BMP in Windows or
|
||||||
// .ppm in Linux. In the applications the names of the files
|
// .ppm in Linux. In the applications the names of the files
|
||||||
// should not have any file extensions. Method load_img() can
|
// should not have any file extensions. Method load_img() can
|
||||||
|
@ -706,7 +706,7 @@ begin
|
|||||||
'%s at line ' ,
|
'%s at line ' ,
|
||||||
unsigned(
|
unsigned(
|
||||||
XML_ErrorString(
|
XML_ErrorString(
|
||||||
XML_GetErrorCode(p ) ) ) );
|
int(XML_GetErrorCode(p ) ) ) ) );
|
||||||
|
|
||||||
sprintf(
|
sprintf(
|
||||||
@msg[StrLen(msg ) ] ,
|
@msg[StrLen(msg ) ] ,
|
||||||
|
Loading…
Reference in New Issue
Block a user