Changeset 33 for trunk/Packages/FastGraphics
- Timestamp:
- Jan 5, 2017, 11:48:36 PM (8 years ago)
- Location:
- trunk/Packages/FastGraphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/FastGraphics/UFGraphics.pas
r31 r33 6 6 7 7 uses 8 Classes, SysUtils, Graphics, UGGraphics, UPixmapSpecialized, Contnrs;8 Classes, SysUtils, Graphics, UGGraphics, UPixmapSpecialized, Fgl; 9 9 10 10 type … … 81 81 end; 82 82 83 TColorFormats = class(TFPGObjectList<TColorFormat>) 84 end; 85 83 86 TColorFormatClass = class of TColorFormat; 84 87 … … 87 90 TColorFormatManager = class 88 91 private 89 FFormats: T ObjectList; // TList<TColorFormat>92 FFormats: TColorFormats; 90 93 function GetFormat(Index: Integer): TColorFormat; 91 94 public 92 95 constructor Create; virtual; 93 destructor Destroy; override; 96 destructor Destroy; override; 97 function FindByName(Name: string): Integer; 94 98 procedure RegisterFormat(Format: TColorFormatClass); 95 99 function FormatCount: Integer; 96 property Formats [Index: Integer]: TColorFormat read GetFormat;100 property Formats: TColorFormats read FFormats; 97 101 end; 98 102 … … 261 265 constructor TColorFormatManager.Create; 262 266 begin 263 FFormats := T ObjectList.Create;267 FFormats := TColorFormats.Create; 264 268 end; 265 269 … … 268 272 FreeAndNil(FFormats); 269 273 inherited Destroy; 274 end; 275 276 function TColorFormatManager.FindByName(Name: string): Integer; 277 var 278 I: Integer; 279 begin 280 Result := -1; 281 for I := 0 to FFormats.Count - 1 do begin 282 if FFormats[I].Name = Name then begin 283 Result := I; 284 Break; 285 end; 286 end; 270 287 end; 271 288 -
trunk/Packages/FastGraphics/UGGraphics.pas
r31 r33 203 203 PixelPtrMin: PInteger; 204 204 PixelRowPtr: PInteger; 205 P: TPixelFormat;206 205 RawImage: TRawImage; 207 206 BytePerPixel: Integer; … … 218 217 for X := Rect.Left to Rect.Right - 1 do begin 219 218 if (X >= 0) and (X < FSize.X) and (Y >= 0) and (Y < FSize.Y) and 220 (PixelPtr < PixelPtrMax) and (PixelPtr > PixelPtrMin) then219 (PixelPtr < PixelPtrMax) and (PixelPtr >= PixelPtrMin) then begin 221 220 PixelPtr^ := ColorConvertFunc(Pixels[X, Y]); 221 end; 222 222 Inc(PByte(PixelPtr), BytePerPixel); 223 224 223 end; 225 224 Inc(PByte(PixelRowPtr), RawImage.Description.BytesPerLine);
Note:
See TracChangeset
for help on using the changeset viewer.