Ignore:
Timestamp:
Sep 22, 2014, 5:40:17 PM (10 years ago)
Author:
chronos
Message:
  • Modified: Color format properties are now initialized as variables instead by executing function.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ColorFormats/UColorGray8.pas

    r9 r14  
    1212
    1313  TGColorFormatGray8 = class(TGColorFormat)
    14     function GetPixelSize: Integer; override;
    15     function GetBitDepth: Integer; override;
    16     function GetName: string; override;
    17     function GetChannelBitPos(Channel: TGColorChannel): Integer; override;
    18     function GetChannelBitWidth(Channel: TGColorChannel): Integer; override;
     14    constructor Create; override;
    1915  end;
    2016
     
    2319{ TGColorFormatGray8 }
    2420
    25 function TGColorFormatGray8.GetPixelSize: Integer;
     21
     22
     23constructor TGColorFormatGray8.Create;
    2624begin
    27   Result := 8;
     25  inherited Create;
     26  inherited;
     27  Name := 'Gray8';
     28  BitDepth := 8;
     29  Channels[ccGray].Position := 0;
     30  Channels[ccGray].BitWidth := 8;
    2831end;
    29 
    30 function TGColorFormatGray8.GetBitDepth: Integer;
    31 begin
    32   Result := 8;
    33 end;
    34 
    35 function TGColorFormatGray8.GetName: string;
    36 begin
    37   Result := 'Gray8';
    38 end;
    39 
    40 function TGColorFormatGray8.GetChannelBitPos(Channel: TGColorChannel): Integer;
    41 begin
    42   case Channel of
    43     ccGray: Result := 0;
    44     else Result := 0;
    45   end;
    46 end;
    47 
    48 function TGColorFormatGray8.GetChannelBitWidth(Channel: TGColorChannel
    49   ): Integer;
    50 begin
    51   if Channel = ccGray then
    52     Result := 8 else Result := 0;
    53 end;
    54 
    5532
    5633end.
Note: See TracChangeset for help on using the changeset viewer.