~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to lcl/graphtype.pp

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{  $Id: graphtype.pp 31025 2011-06-03 18:12:33Z juha $  }
 
1
{  $Id: graphtype.pp 36873 2012-04-17 08:23:08Z zeljko $  }
2
2
{
3
3
 /***************************************************************************
4
4
                                graphtype.pp
147
147
    PaletteBitOrder: TRawImageBitOrder;
148
148
    PaletteByteOrder: TRawImageByteOrder;
149
149
    
150
 
    // don't use a contructor here, it will break compatebility with a record
 
150
    // don't use a constructor here, it will break compatibility with a record
151
151
    procedure Init;
152
 
    
 
152
 
 
153
    // 1-bit mono format
 
154
    procedure Init_BPP1(AWidth, AHeight: integer);
 
155
 
 
156
    // 16-bits formats
 
157
    procedure Init_BPP16_R5G6B5(AWidth, AHeight: integer);
 
158
 
 
159
    // Formats in RGB order
 
160
    procedure Init_BPP24_R8G8B8_BIO_TTB(AWidth, AHeight: integer);
 
161
    procedure Init_BPP24_R8G8B8_BIO_TTB_UpsideDown(AWidth, AHeight: integer);
 
162
    procedure Init_BPP32_A8R8G8B8_BIO_TTB(AWidth, AHeight: integer);
 
163
    procedure Init_BPP32_R8G8B8A8_BIO_TTB(AWidth, AHeight: integer);
 
164
 
 
165
    // Formats in Windows pixels order: BGR
153
166
    procedure Init_BPP24_B8G8R8_BIO_TTB(AWidth, AHeight: integer);
154
167
    procedure Init_BPP24_B8G8R8_M1_BIO_TTB(AWidth, AHeight: integer);
155
168
    procedure Init_BPP32_B8G8R8_BIO_TTB(AWidth, AHeight: integer);
194
207
    Palette: PByte;
195
208
    PaletteSize: PtrUInt;
196
209
    
197
 
    // don't use a contructor here, it will break compatebility with a record
 
210
    // don't use a constructor here, it will break compatibility with a record
198
211
    procedure Init;
199
212
    procedure CreateData(AZeroMem: Boolean);
200
213
 
202
215
    procedure ReleaseData;
203
216
    procedure ExtractRect(const ARect: TRect; out ADst: TRawImage);
204
217
 
205
 
    procedure PerformEffect(const ADrawEffect: TGraphicsDrawEffect; CreateNewData: Boolean = True);
 
218
    procedure PerformEffect(const ADrawEffect: TGraphicsDrawEffect; CreateNewData: Boolean = True; FreeOldData: boolean = false);
206
219
    function  ReadBits(const APosition: TRawImagePosition; APrec, AShift: Byte): Word;
207
220
    procedure ReadChannels(const APosition: TRawImagePosition; out ARed, AGreen, ABlue, AAlpha: Word);
208
221
    procedure ReadMask(const APosition: TRawImagePosition; out AMask: Boolean);
228
241
  public
229
242
    Positions: array of TRawImagePosition;
230
243
 
231
 
    // don't use a contructor here, it will break compatibility with a record
 
244
    // don't use a constructor here, it will break compatibility with a record
232
245
    procedure Init(AWidth, AHeight: cardinal; ABitsPerPixel: Byte; ALineEnd: TRawImageLineEnd; ALineOrder: TRawImageLineOrder);
233
246
    function GetPosition(x, y: cardinal): TRawImagePosition;
234
247
  end;
235
248
  PRawImageLineStarts = ^TRawImageLineStarts;
236
249
 
237
250
const
238
 
  RawImageColorFormatNames: array[TRawImageColorFormat] of string = (
239
 
    'ricfNone',
240
 
    'ricfRGBA',
241
 
    'ricfGray'
242
 
    );
243
 
 
244
 
  RawImageByteOrderNames: array[TRawImageByteOrder] of string = (
245
 
    'riboLSBFirst',
246
 
    'riboMSBFirst'
247
 
    );
248
 
 
249
 
  RawImageBitOrderNames: array[TRawImageBitOrder] of string = (
250
 
    'riboBitsInOrder',
251
 
    'riboReversedBits'
252
 
    );
253
 
 
254
 
  RawImageLineEndNames: array[TRawImageLineEnd] of string = (
255
 
    'rileTight',
256
 
    'rileByteBoundary',
257
 
    'rileWordBoundary',
258
 
    'rileDWordBoundary',
259
 
    'rileQWordBoundary',
260
 
    'rileDQWordBoundary'
261
 
    );
262
 
 
263
 
  RawImageLineOrderNames: array[TRawImageLineOrder] of string = (
264
 
    'riloTopToBottom',
265
 
    'riloBottomToTop'
266
 
    );
267
 
    
268
251
  DefaultByteOrder = {$IFDEF Endian_Little}riboLSBFirst{$ELSE}riboMSBFirst{$ENDIF};
269
252
 
270
253
 
275
258
                       ASource: Pointer; const ARect: TRect; ASourceOrder: TRawImageLineOrder;
276
259
                       ADestinationOrder: TRawImageLineOrder; ADestinationEnd: TRawImageLineEnd;
277
260
                       out ADestination: Pointer; out ASize: PtrUInt): Boolean;
 
261
function RawImageQueryFlagsToString(AFlags: TRawImageQueryFlags): string;
278
262
 
279
263
var
280
264
  MissingBits: array[0..15] of array[0..7] of word;
284
268
uses
285
269
  Math;
286
270
 
287
 
 
288
271
{------------------------------------------------------------------------------
289
272
  Function: CopyImageData
290
273
 ------------------------------------------------------------------------------}
445
428
  Result := True;
446
429
end;
447
430
 
 
431
function RawImageQueryFlagsToString(AFlags: TRawImageQueryFlags): string;
 
432
begin
 
433
  Result := '';
 
434
  if riqfMono in AFlags then Result := Result + 'riqfMono ';
 
435
  if riqfGrey in AFlags then Result := Result + 'riqfGrey ';
 
436
  if riqfRGB in AFlags then Result := Result + 'riqfRGB ';
 
437
  if riqfAlpha in AFlags then Result := Result + 'riqfAlpha ';
 
438
  if riqfMask in AFlags then Result := Result + 'riqfMask ';
 
439
  if riqfPalette in AFlags then Result := Result + 'riqfPalette ';
 
440
  if riqfUpdate in AFlags then Result := Result + 'riqfUpdate ';
 
441
end;
 
442
 
448
443
{------------------------------------------------------------------------------
449
444
  Function: GetBytesPerLine
450
445
 ------------------------------------------------------------------------------}
569
564
  FillChar(Self, SizeOf(Self), 0);
570
565
end;
571
566
 
 
567
// 1-bit mono format
 
568
procedure TRawImageDescription.Init_BPP1(AWidth, AHeight: integer);
 
569
begin
 
570
  // setup an artificial ScanLineImage with format RGB 24 bit, 24bit depth format
 
571
  FillChar(Self, SizeOf(Self), 0);
 
572
 
 
573
  Format := ricfGray;
 
574
  Depth := 1; // used bits per pixel
 
575
  Width := AWidth;
 
576
  Height := AHeight;
 
577
  BitOrder := riboBitsInOrder;
 
578
  ByteOrder := riboLSBFirst;
 
579
  LineOrder := riloTopToBottom;
 
580
  BitsPerPixel := 1; // bits per pixel. can be greater than Depth.
 
581
  LineEnd := rileDWordBoundary;
 
582
  RedPrec := 1; // grey precision
 
583
  RedShift := 0;
 
584
  GreenPrec := 0;
 
585
  GreenShift := 0; // bitshift. Direction: from least to most significant
 
586
  BluePrec := 0;
 
587
  BlueShift:=0;
 
588
//  AlphaPrec:=0;
 
589
//  MaskBitsPerPixel:=0;
 
590
end;
 
591
 
 
592
procedure TRawImageDescription.Init_BPP16_R5G6B5(AWidth, AHeight: integer);
 
593
begin
 
594
  // setup an artificial ScanLineImage with format RGB 24 bit, 24bit depth format
 
595
  FillChar(Self, SizeOf(Self), 0);
 
596
 
 
597
  Format := ricfRGBA;
 
598
  Depth := 16; // used bits per pixel
 
599
  Width := AWidth;
 
600
  Height := AHeight;
 
601
  BitOrder := riboBitsInOrder;
 
602
  ByteOrder := riboLSBFirst;
 
603
  LineOrder := riloTopToBottom;
 
604
  BitsPerPixel := 24; // bits per pixel. can be greater than Depth.
 
605
  LineEnd := rileDWordBoundary;
 
606
  RedPrec := 5; // red precision. bits for red
 
607
  RedShift := 0;
 
608
  GreenPrec := 6;
 
609
  GreenShift := 5; // bitshift. Direction: from least to most significant
 
610
  BluePrec := 5;
 
611
  BlueShift:=11;
 
612
//  AlphaPrec:=0;
 
613
//  MaskBitsPerPixel:=0;
 
614
end;
 
615
 
 
616
procedure TRawImageDescription.Init_BPP24_R8G8B8_BIO_TTB(AWidth, AHeight: integer);
 
617
begin
 
618
  // setup an artificial ScanLineImage with format RGB 24 bit, 24bit depth format
 
619
  FillChar(Self, SizeOf(Self), 0);
 
620
 
 
621
  Format := ricfRGBA;
 
622
  Depth := 24; // used bits per pixel
 
623
  Width := AWidth;
 
624
  Height := AHeight;
 
625
  BitOrder := riboBitsInOrder;
 
626
  ByteOrder := riboLSBFirst;
 
627
  LineOrder := riloTopToBottom;
 
628
  BitsPerPixel := 24; // bits per pixel. can be greater than Depth.
 
629
  LineEnd := rileDWordBoundary;
 
630
  RedPrec := 8; // red precision. bits for red
 
631
  RedShift := 0;
 
632
  GreenPrec := 8;
 
633
  GreenShift := 8; // bitshift. Direction: from least to most significant
 
634
  BluePrec := 8;
 
635
  BlueShift:=16;
 
636
//  AlphaPrec:=0;
 
637
//  MaskBitsPerPixel:=0;
 
638
end;
 
639
 
 
640
procedure TRawImageDescription.Init_BPP24_R8G8B8_BIO_TTB_UpsideDown(AWidth, AHeight: integer);
 
641
begin
 
642
  // setup an artificial ScanLineImage with format RGB 24 bit, 24bit depth format
 
643
  FillChar(Self, SizeOf(Self), 0);
 
644
 
 
645
  Format := ricfRGBA;
 
646
  Depth := 24; // used bits per pixel
 
647
  Width := AWidth;
 
648
  Height := AHeight;
 
649
  BitOrder := riboBitsInOrder;
 
650
  ByteOrder := riboLSBFirst;
 
651
  LineOrder := riloBottomToTop;
 
652
  BitsPerPixel := 24; // bits per pixel. can be greater than Depth.
 
653
  LineEnd := rileDWordBoundary;
 
654
  RedPrec := 8; // red precision. bits for red
 
655
  RedShift := 0;
 
656
  GreenPrec := 8;
 
657
  GreenShift := 8; // bitshift. Direction: from least to most significant
 
658
  BluePrec := 8;
 
659
  BlueShift:=16;
 
660
//  AlphaPrec:=0;
 
661
//  MaskBitsPerPixel:=0;
 
662
end;
 
663
 
 
664
procedure TRawImageDescription.Init_BPP32_A8R8G8B8_BIO_TTB(AWidth, AHeight: integer);
 
665
begin
 
666
  // setup an artificial ScanLineImage with format RGB 32 bit, 32bit depth format
 
667
  FillChar(Self, SizeOf(Self), 0);
 
668
 
 
669
  Format := ricfRGBA;
 
670
  Depth := 32; // used bits per pixel
 
671
  Width := AWidth;
 
672
  Height := AHeight;
 
673
  BitOrder := riboBitsInOrder;
 
674
  ByteOrder := riboLSBFirst;
 
675
  LineOrder := riloTopToBottom;
 
676
  BitsPerPixel := 32; // bits per pixel. can be greater than Depth.
 
677
  LineEnd := rileDWordBoundary;
 
678
  RedPrec := 8; // red precision. bits for red
 
679
  RedShift := 8;
 
680
  GreenPrec := 8;
 
681
  GreenShift := 16; // bitshift. Direction: from least to most signifikant
 
682
  BluePrec := 8;
 
683
  BlueShift := 24;
 
684
  AlphaPrec := 8;
 
685
  AlphaShift := 0;
 
686
//  MaskBitsPerPixel := 0;
 
687
end;
 
688
 
 
689
procedure TRawImageDescription.Init_BPP32_R8G8B8A8_BIO_TTB(AWidth, AHeight: integer);
 
690
begin
 
691
  // setup an artificial ScanLineImage with format RGB 32 bit, 32bit depth format
 
692
  FillChar(Self, SizeOf(Self), 0);
 
693
 
 
694
  Format := ricfRGBA;
 
695
  Depth := 32; // used bits per pixel
 
696
  Width := AWidth;
 
697
  Height := AHeight;
 
698
  BitOrder := riboBitsInOrder;
 
699
  ByteOrder := riboLSBFirst;
 
700
  LineOrder := riloTopToBottom;
 
701
  BitsPerPixel := 32; // bits per pixel. can be greater than Depth.
 
702
  LineEnd := rileDWordBoundary;
 
703
  RedPrec := 8; // red precision. bits for red
 
704
  RedShift := 0;
 
705
  GreenPrec := 8;
 
706
  GreenShift := 8; // bitshift. Direction: from least to most signifikant
 
707
  BluePrec := 8;
 
708
  BlueShift := 16;
 
709
  AlphaPrec := 8;
 
710
  AlphaShift := 24;
 
711
//  MaskBitsPerPixel := 0;
 
712
end;
 
713
 
572
714
procedure TRawImageDescription.Init_BPP24_B8G8R8_BIO_TTB(AWidth, AHeight: integer);
573
715
{ pf24bit:
574
716
 
765
907
 
766
908
function TRawImageDescription.GetDescriptionFromMask: TRawImageDescription;
767
909
begin
768
 
  Result.Init;
 
910
  Result{%H-}.Init;
769
911
 
770
912
  Result.Format       := ricfGray;
771
913
  Result.Width        := Width;
792
934
 
793
935
function TRawImageDescription.GetDescriptionFromAlpha: TRawImageDescription;
794
936
begin
795
 
  Result.Init;
 
937
  Result{%H-}.Init;
796
938
 
797
939
  Result.Format       := ricfGray;
798
940
  Result.Width        := Width;
819
961
end;
820
962
 
821
963
function TRawImageDescription.AsString: string;
 
964
 
 
965
  function EnumToString(AEnum: TRawImageColorFormat): string;
 
966
  begin
 
967
    WriteStr(Result, AEnum);
 
968
  end;
 
969
 
 
970
  function EnumToString(AEnum: TRawImageByteOrder): string;
 
971
  begin
 
972
    WriteStr(Result, AEnum);
 
973
  end;
 
974
 
 
975
  function EnumToString(AEnum: TRawImageBitOrder): string;
 
976
  begin
 
977
    WriteStr(Result, AEnum);
 
978
  end;
 
979
 
 
980
  function EnumToString(AEnum: TRawImageLineEnd): string;
 
981
  begin
 
982
    WriteStr(Result, AEnum);
 
983
  end;
 
984
 
 
985
  function EnumToString(AEnum: TRawImageLineOrder): string;
 
986
  begin
 
987
    WriteStr(Result, AEnum);
 
988
  end;
 
989
 
822
990
begin
823
991
  Result:=
824
 
     ' Format='+RawImageColorFormatNames[Format]
 
992
     ' Format='+EnumToString(Format)
825
993
    +' HasPalette->'+dbgs(PaletteColorCount <> 0)
826
994
    +' HasMask->'+dbgs(PaletteColorCount <> 0)
827
995
    +' Depth='+IntToStr(Depth)
828
996
    +' Width='+IntToStr(Width)
829
997
    +' Height='+IntToStr(Height)
830
 
    +' BitOrder='+RawImageBitOrderNames[BitOrder]
831
 
    +' ByteOrder='+RawImageByteOrderNames[ByteOrder]
832
 
    +' LineOrder='+RawImageLineOrderNames[LineOrder]
833
 
    +' LineEnd='+RawImageLineEndNames[LineEnd]
 
998
    +' BitOrder='+EnumToString(BitOrder)
 
999
    +' ByteOrder='+EnumToString(ByteOrder)
 
1000
    +' LineOrder='+EnumToString(LineOrder)
 
1001
    +' LineEnd='+EnumToString(LineEnd)
834
1002
    +' BitsPerPixel='+IntToStr(BitsPerPixel)
835
1003
    +' BytesPerLine->'+IntToStr(GetBytesPerLine(Width,BitsPerPixel,LineEnd))
836
1004
    +' RedPrec='+IntToStr(RedPrec)
844
1012
    +' ~~~mask~~~'
845
1013
    +' MaskBitsPerPixel='+IntToStr(MaskBitsPerPixel)
846
1014
    +' MaskShift='+IntToStr(MaskShift)
847
 
    +' MaskLineEnd='+RawImageLineEndNames[MaskLineEnd]
848
 
    +' MaskBitOrder='+RawImageBitOrderNames[MaskBitOrder]
 
1015
    +' MaskLineEnd='+EnumToString(MaskLineEnd)
 
1016
    +' MaskBitOrder='+EnumToString(MaskBitOrder)
849
1017
    +' MaskBytesPerLine->'+IntToStr(GetBytesPerLine(Width,MaskBitsPerPixel,MaskLineEnd))
850
1018
    +' ~~~palette~~~'
851
1019
    +' PaletteColorCount='+IntToStr(PaletteColorCount)
852
1020
    +' PaletteBitsPerIndex='+IntToStr(PaletteBitsPerIndex)
853
1021
    +' PaletteShift='+IntToStr(PaletteShift)
854
 
    +' PaletteLineEnd='+RawImageLineEndNames[PaletteLineEnd]
855
 
    +' PaletteBitOrder='+RawImageBitOrderNames[PaletteBitOrder]
856
 
    +' PaletteByteOrder='+RawImageByteOrderNames[PaletteByteOrder]
 
1022
    +' PaletteLineEnd='+EnumToString(PaletteLineEnd)
 
1023
    +' PaletteBitOrder='+EnumToString(PaletteBitOrder)
 
1024
    +' PaletteByteOrder='+EnumToString(PaletteByteOrder)
857
1025
    +' PaletteBytesPerLine->'+IntToStr(GetBytesPerLine(Width,PaletteBitsPerIndex,PaletteLineEnd))
858
1026
    +'';
859
1027
end;
910
1078
  Result := True;
911
1079
end;
912
1080
 
913
 
 
914
1081
{ TRawImage }
915
1082
 
916
1083
function TRawImage.IsMasked(ATestPixels: Boolean): Boolean;
1352
1519
          // dst[byte|bit]: 12 11 10 07 06 05 04 03 :
1353
1520
          for x := 0 to ByteCount - 1 do
1354
1521
          begin
1355
 
            DstW1 := SrcPos[0] shl Shift0;
1356
 
            DstPos^ := Byte(DstW1 or (SrcPos[1] shr Shift1));
 
1522
            DstW1 := SrcPos[0] shr Shift0;
 
1523
            DstPos^ := Byte(DstW1 or (SrcPos[1] shl Shift1));
1357
1524
            inc(SrcPos);
1358
1525
            inc(DstPos);
1359
1526
          end;
1425
1592
end;
1426
1593
 
1427
1594
procedure TRawImage.PerformEffect(const ADrawEffect: TGraphicsDrawEffect;
1428
 
  CreateNewData: Boolean);
 
1595
  CreateNewData: Boolean; FreeOldData: boolean);
1429
1596
  
1430
1597
  function CheckDescription: Boolean;
1431
1598
  begin
1464
1631
  P: Pointer;
1465
1632
  i, j: integer;
1466
1633
begin
 
1634
  // check here for Description. Only RGBA data can be processed here.
 
1635
  if not CheckDescription then
 
1636
    Exit;
 
1637
 
1467
1638
  if CreateNewData then
1468
1639
  begin
1469
1640
    GetMem(AData, DataSize);
1470
1641
    Move(Data^, AData^, DataSize);
1471
1642
    P := AData;
1472
1643
  end
1473
 
  else
1474
 
  begin
 
1644
  else begin
1475
1645
    P := Data;
1476
1646
    AData := P;
1477
1647
  end;
1478
1648
 
1479
 
  // check here for Description. Only RGBA data can be processed here.
1480
 
  if not CheckDescription then
1481
 
    Exit;
1482
 
  
1483
 
  
1484
1649
  case ADrawEffect of
1485
1650
    gdeNormal: ;
1486
1651
    gdeDisabled:
1549
1714
          end;
1550
1715
      end;
1551
1716
  end;
 
1717
 
 
1718
  if FreeOldData then
 
1719
    ReAllocMem(Data,0);
1552
1720
  Data := P;
1553
1721
end;
1554
1722