亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pngimage.pas

?? New tj source www.opensc.ws - trojan source codes.
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
function TChunktEXt.LoadFromStream(Stream: TStream;
  const ChunkName: TChunkName; Size: Integer): Boolean;
begin
  {Load data from stream and validate}
  Result := inherited LoadFromStream(Stream, ChunkName, Size);
  if not Result or (Size < 3) then exit;
  {Get text}
  fKeyword := PChar(Data);
  SetLength(fText, Size - Length(fKeyword) - 1);
  CopyMemory(@fText[1], Ptr(Longint(Data) + Length(fKeyword) + 1),
    Length(fText));
end;

{Saving the chunk to a stream}
function TChunktEXt.SaveToStream(Stream: TStream): Boolean;
begin
  {Size is length from keyword, plus a null character to divide}
  {plus the length of the text}
  ResizeData(Length(fKeyword) + 1 + Length(fText));
  Fillchar(Data^, DataSize, #0);
  {Copy data}
  if Keyword <> '' then
    CopyMemory(Data, @fKeyword[1], Length(Keyword));
  if Text <> '' then
    CopyMemory(Ptr(Longint(Data) + Length(Keyword) + 1), @fText[1],
      Length(Text));
  {Let ancestor calculate crc and save}
  Result := inherited SaveToStream(Stream);
end;


{TChunkIHDR implementation}

{Chunk being created}
constructor TChunkIHDR.Create(Owner: TPngObject);
begin
  {Call inherited}
  inherited Create(Owner);
  {Prepare pointers}
  ImageHandle := 0;
  ImageDC := 0;
end;

{Chunk being destroyed}
destructor TChunkIHDR.Destroy;
begin
  {Free memory}
  FreeImageData();

  {Calls TChunk destroy}
  inherited Destroy;
end;

{Assigns from another IHDR chunk}
procedure TChunkIHDR.Assign(Source: TChunk);
begin
  {Copy the IHDR data}
  if Source is TChunkIHDR then
  begin
    {Copy IHDR values}
    IHDRData := TChunkIHDR(Source).IHDRData;

    {Prepare to hold data by filling BitmapInfo structure and}
    {resizing ImageData and ImageAlpha memory allocations}
    PrepareImageData();

    {Copy image data}
    CopyMemory(ImageData, TChunkIHDR(Source).ImageData,
      BytesPerRow * Integer(Height));
    CopyMemory(ImageAlpha, TChunkIHDR(Source).ImageAlpha,
      Integer(Width) * Integer(Height));

    {Copy palette colors}
    BitmapInfo.bmiColors := TChunkIHDR(Source).BitmapInfo.bmiColors;
  end
  else
    Owner.RaiseError(EPNGError, EPNGCannotAssignChunkText);
end;

{Release allocated image data}
procedure TChunkIHDR.FreeImageData;
begin
  {Free old image data}
  if ImageHandle <> 0  then DeleteObject(ImageHandle);
  if ImageDC     <> 0  then DeleteDC(ImageDC);
  if ImageAlpha <> nil then FreeMem(ImageAlpha);
  ImageHandle := 0; ImageDC := 0; ImageAlpha := nil; ImageData := nil;
end;

{Chunk being loaded from a stream}
function TChunkIHDR.LoadFromStream(Stream: TStream; const ChunkName: TChunkName;
  Size: Integer): Boolean;
begin
  {Let TChunk load it}
  Result := inherited LoadFromStream(Stream, ChunkName, Size);
  if not Result then Exit;

  {Now check values}
  {Note: It's recommended by png specification to make sure that the size}
  {must be 13 bytes to be valid, but some images with 14 bytes were found}
  {which could be loaded by internet explorer and other tools}
  if (fDataSize < SIZEOF(TIHdrData)) then
  begin
    {Ihdr must always have at least 13 bytes}
    Result := False;
    Owner.RaiseError(EPNGInvalidIHDR, EPNGInvalidIHDRText);
    exit;
  end;

  {Everything ok, reads IHDR}
  IHDRData := pIHDRData(fData)^;
  IHDRData.Width := ByteSwap(IHDRData.Width);
  IHDRData.Height := ByteSwap(IHDRData.Height);

  {The width and height must not be larger than 65535 pixels}
  if (IHDRData.Width > High(Word)) or (IHDRData.Height > High(Word)) then
  begin
    Result := False;
    Owner.RaiseError(EPNGSizeExceeds, EPNGSizeExceedsText);
    exit;
  end {if IHDRData.Width > High(Word)};
  {Compression method must be 0 (inflate/deflate)}
  if (IHDRData.CompressionMethod <> 0) then
  begin
    Result := False;
    Owner.RaiseError(EPNGUnknownCompression, EPNGUnknownCompressionText);
    exit;
  end;
  {Interlace must be either 0 (none) or 7 (adam7)}
  if (IHDRData.InterlaceMethod <> 0) and (IHDRData.InterlaceMethod <> 1) then
  begin
    Result := False;
    Owner.RaiseError(EPNGUnknownInterlace, EPNGUnknownInterlaceText);
    exit;
  end;

  {Updates owner properties}
  Owner.InterlaceMethod := TInterlaceMethod(IHDRData.InterlaceMethod);

  {Prepares data to hold image}
  PrepareImageData();
end;

{Saving the IHDR chunk to a stream}
function TChunkIHDR.SaveToStream(Stream: TStream): Boolean;
begin
  {Ignore 2 bits images}
  if BitDepth = 2 then BitDepth := 4;

  {It needs to do is update the data with the IHDR data}
  {structure containing the write values}
  ResizeData(SizeOf(TIHDRData));
  pIHDRData(fData)^ := IHDRData;
  {..byteswap 4 byte types}
  pIHDRData(fData)^.Width := ByteSwap(pIHDRData(fData)^.Width);
  pIHDRData(fData)^.Height := ByteSwap(pIHDRData(fData)^.Height);
  {..update interlace method}
  pIHDRData(fData)^.InterlaceMethod := Byte(Owner.InterlaceMethod);
  {..and then let the ancestor SaveToStream do the hard work}
  Result := inherited SaveToStream(Stream);
end;

{Resizes the image data to fill the color type, bit depth, }
{width and height parameters}
procedure TChunkIHDR.PrepareImageData();

  {Set the bitmap info}
  procedure SetInfo(const Bitdepth: Integer; const Palette: Boolean);
  begin

    {Copy if the bitmap contain palette entries}
    HasPalette := Palette;
    {Initialize the structure with zeros}
    fillchar(BitmapInfo, sizeof(BitmapInfo), #0);
    {Fill the strucutre}
    with BitmapInfo.bmiHeader do
    begin
      biSize := sizeof(TBitmapInfoHeader);
      biHeight := Height;
      biWidth := Width;
      biPlanes := 1;
      biBitCount := BitDepth;
      biCompression := BI_RGB;
    end {with BitmapInfo.bmiHeader}
  end;
begin
  {Prepare bitmap info header}
  Fillchar(BitmapInfo, sizeof(TMaxBitmapInfo), #0);
  {Release old image data}
  FreeImageData();

  {Obtain number of bits for each pixel}
  case ColorType of
    COLOR_GRAYSCALE, COLOR_PALETTE, COLOR_GRAYSCALEALPHA:
      case BitDepth of
        {These are supported by windows}
        1, 4, 8: SetInfo(BitDepth, TRUE);
        {2 bits for each pixel is not supported by windows bitmap}
        2      : SetInfo(4, TRUE);
        {Also 16 bits (2 bytes) for each pixel is not supported}
        {and should be transormed into a 8 bit grayscale}
        16     : SetInfo(8, TRUE);
      end;
    {Only 1 byte (8 bits) is supported}
    COLOR_RGB, COLOR_RGBALPHA:  SetInfo(24, FALSE);
  end {case ColorType};
  {Number of bytes for each scanline}
  BytesPerRow := (((BitmapInfo.bmiHeader.biBitCount * Width) + 31)
    and not 31) div 8;

  {Build array for alpha information, if necessary}
  if (ColorType = COLOR_RGBALPHA) or (ColorType = COLOR_GRAYSCALEALPHA) then
  begin
    GetMem(ImageAlpha, Integer(Width) * Integer(Height));
    ZeroMemory(ImageAlpha, Integer(Width) * Integer(Height));
  end;

  {Creates the image to hold the data, CreateDIBSection does a better}
  {work in allocating necessary memory}
  ImageDC := CreateCompatibleDC(0);
  ImageHandle := CreateDIBSection(ImageDC, pBitmapInfo(@BitmapInfo)^,
    DIB_RGB_COLORS, ImageData, 0, 0);

  {Build array and allocate bytes for each row}
  zeromemory(ImageData, BytesPerRow * Integer(Height));
end;

{TChunktRNS implementation}

{$IFNDEF UseDelphi}
function CompareMem(P1, P2: pByte; const Size: Integer): Boolean;
var i: Integer;
begin
  Result := True;
  for i := 1 to Size do
  begin
    if P1^ <> P2^ then Result := False;
    inc(P1); inc(P2);
  end {for i}
end;
{$ENDIF}

{Sets the transpararent color}
procedure TChunktRNS.SetTransparentColor(const Value: ColorRef);
var
  i: Byte;
  LookColor: TRGBQuad;
begin
  {Clears the palette values}
  Fillchar(PaletteValues, SizeOf(PaletteValues), #0);
  {Sets that it uses bit transparency}
  fBitTransparency := True;


  {Depends on the color type}
  with Header do
    case ColorType of
      COLOR_GRAYSCALE:
      begin
        Self.ResizeData(BitDepth div 8);
        PaletteValues[0] := GetRValue(Value);
      end;
      COLOR_RGB:
      begin
        Self.ResizeData((BitDepth div 8) * 3);
        PaletteValues[0] := GetRValue(Value);
        PaletteValues[1*(BitDepth div 8)] := GetGValue(Value);
        PaletteValues[2*(BitDepth div 8)] := GetBValue(Value);
      end;
      COLOR_PALETTE:
      begin
        {Creates a RGBQuad to search for the color}
        LookColor.rgbRed := GetRValue(Value);
        LookColor.rgbGreen := GetGValue(Value);
        LookColor.rgbBlue := GetBValue(Value);
        {Look in the table for the entry}
        for i := 0 to 255 do
          if CompareMem(@BitmapInfo.bmiColors[i], @LookColor, 3) then
            Break;
        {Fill the transparency table}
        Fillchar(PaletteValues, i, 255);
        Self.ResizeData(i + 1)

      end
    end {case / with};

end;

{Returns the transparent color for the image}
function TChunktRNS.GetTransparentColor: ColorRef;
var
  PaletteChunk: TChunkPLTE;
  i: Integer;
begin
  Result := 0; {Default: Unknown transparent color}

  {Depends on the color type}
  with Header do
    case ColorType of
      COLOR_GRAYSCALE: Result := RGB(PaletteValues[0], PaletteValues[0],
        PaletteValues[0]);
      COLOR_RGB:
        if BitDepth = 8 then
          Result := RGB(PaletteValues[0], PaletteValues[1], PaletteValues[2])
        else
          Result := RGB(PaletteValues[0], PaletteValues[2], PaletteValues[4]);
      COLOR_PALETTE:
      begin
        {Obtains the palette chunk}
        PaletteChunk := Owner.Chunks.ItemFromClass(TChunkPLTE) as TChunkPLTE;

        {Looks for an entry with 0 transparency meaning that it is the}
        {full transparent entry}
        for i := 0 to Self.DataSize - 1 do
          if PaletteValues[i] = 0 then
            with PaletteChunk.GetPaletteItem(i) do
            begin
              Result := RGB(rgbRed, rgbGreen, rgbBlue);
              break
            end
      end {COLOR_PALETTE}
    end {case Header.ColorType};
end;

{Saving the chunk to a stream}
function TChunktRNS.SaveToStream(Stream: TStream): Boolean;
begin
  {Copy palette into data buffer}
  if DataSize <= 256 then
    CopyMemory(fData, @PaletteValues[0], DataSize);

  Result := inherited SaveToStream(Stream);
end;

{Assigns from another chunk}
procedure TChunktRNS.Assign(Source: TChunk);
begin
  CopyMemory(@PaletteValues[0], @TChunkTrns(Source).PaletteValues[0], 256);
  fBitTransparency := TChunkTrns(Source).fBitTransparency;
  inherited Assign(Source);
end;

{Loads the chunk from a stream}
function TChunktRNS.LoadFromStream(Stream: TStream; const ChunkName: TChunkName;
  Size: Integer): Boolean;
var
  i, Differ255: Integer;
begin
  {Let inherited load}
  Result := inherited LoadFromStream(Stream, ChunkName, Size);

  if not Result then Exit;

  {Make sure size is correct}
  if Size > 256 then Owner.RaiseError(EPNGInvalidPalette,
    EPNGInvalidPaletteText);

  {The unset items should have value 255}
  Fillchar(PaletteValues[0], 256, 255);
  {Copy the other values}
  CopyMemory(@PaletteValues[0], fData, Size);

  {Create the mask if needed}
  case Header.ColorType of
    {Mask for grayscale and RGB}
    COLOR_RGB, COLOR_GRAYSCALE: fBitTransparency := True;
    COLOR_PALETTE:
    begin
      Differ255 := 0; {Count the entries with a value different from 255}
      {Tests if it uses bit transparency}
      for i := 0 to Size - 1 do
        if PaletteValues[i] <> 255 then inc(Differ255);

      {If it has one value different from 255 it is a bit transparency}
      fBitTransparency := (Differ255 = 1);
    end {COLOR_PALETTE}
  end {case Header.ColorType};

end;

{ZLIB support}

const
  ZLIBAllocate = High(Word);

{Initializes ZLIB for decompression}
function ZLIBInitInflate(Stream: TStream): TZStreamRec2;
begin
  {Fill record}
  Fillchar(Result, SIZEOF(TZStreamRec2), #0);

  {Set internal record information}
  with Result do
  begin
    GetMem(Data, ZLIBAllocate);
    fStream := Stream;
  end;

  {Init decompression}
  InflateInit_(Result.zlib, zlib_version, SIZEOF(TZStreamRec));
end;

{Initializes ZLIB for compression}
function ZLIBInitDeflate(Stream: TStream;
  Level: TCompressionleve

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色图欧美激情| 午夜精品一区在线观看| 久久精品视频一区| 久久综合色天天久久综合图片| 国产精品美日韩| 国产精品色婷婷| 亚洲激情综合网| 日本在线不卡视频| 国产成人免费xxxxxxxx| 成人国产精品免费| 91麻豆蜜桃一区二区三区| 日韩精品一区二区在线| 国产亚洲综合av| 亚洲图片另类小说| 奇米一区二区三区| 国产·精品毛片| 欧美色倩网站大全免费| 欧美电视剧在线观看完整版| 久久久91精品国产一区二区精品| 中文字幕第一区| 日韩综合在线视频| 国产精品99久久久久久久女警| 99久久精品国产网站| 欧美日韩精品欧美日韩精品一综合| 欧美日韩激情一区| 国产精品欧美一区二区三区| 天天操天天干天天综合网| 国产精品18久久久久久久久久久久| 99久久精品国产观看| 91精品免费观看| 亚洲精品精品亚洲| 国产精品一级在线| 日韩一区二区三区在线| 亚洲日本va午夜在线影院| 麻豆精品在线看| 欧美色精品在线视频| 国产女同互慰高潮91漫画| 成人欧美一区二区三区| 亚洲成av人片一区二区梦乃| 狠狠色丁香婷婷综合久久片| 色狠狠av一区二区三区| 制服丝袜国产精品| 国产精品久久免费看| 麻豆极品一区二区三区| 色婷婷精品大在线视频 | 国产精品久久毛片av大全日韩| 久久久精品tv| 午夜精品成人在线视频| a级精品国产片在线观看| 欧美一区日韩一区| 国产精品久久久久久久久免费丝袜| 亚洲成人激情自拍| 99久久99久久免费精品蜜臀| 欧美mv和日韩mv的网站| 亚洲综合色区另类av| 成人污污视频在线观看| 欧美亚洲高清一区二区三区不卡| 欧美国产一区二区在线观看| 久久精品国产秦先生| 在线不卡的av| 婷婷激情综合网| 欧美中文字幕一二三区视频| 国产亚洲综合性久久久影院| 国产伦理精品不卡| 久久亚洲一级片| 久久精品二区亚洲w码| 91精品国产91久久久久久一区二区| 亚洲男人的天堂在线观看| 北条麻妃国产九九精品视频| 久久视频一区二区| 国产成人午夜精品影院观看视频| 精品国产乱码久久久久久1区2区 | 日韩精品一区二区三区在线 | 性做久久久久久免费观看| 精品视频全国免费看| 国产精品毛片大码女人| 不卡视频一二三四| 一区二区三区日韩精品| 欧美日韩免费观看一区三区| 日本特黄久久久高潮| 亚洲欧美日韩国产综合在线| 精品av久久707| 欧美区视频在线观看| 成人avav在线| 国产成人aaa| 国产真实乱对白精彩久久| 亚洲免费视频成人| 日韩欧美国产一区二区三区| 91网站在线播放| 精品一区二区免费视频| 亚洲日本在线视频观看| 欧美一级淫片007| 在线观看免费亚洲| 国产精品自在欧美一区| 一区二区三区在线影院| 国产午夜亚洲精品午夜鲁丝片| 欧洲av一区二区嗯嗯嗯啊| 国产精品一色哟哟哟| 亚洲第一激情av| 国产欧美日本一区视频| 91精品国模一区二区三区| 日韩精品一区二区三区中文不卡 | 欧美成人欧美edvon| 欧美亚洲综合在线| 成人网在线播放| 蜜桃视频在线一区| 天天色综合成人网| 亚洲无人区一区| 中文字幕五月欧美| 中文在线一区二区 | 亚洲欧美激情在线| 亚洲人精品午夜| 夜夜嗨av一区二区三区中文字幕| 亚洲男人天堂av网| 午夜天堂影视香蕉久久| 秋霞影院一区二区| 国产一二三精品| 色欧美88888久久久久久影院| 欧美伊人久久久久久久久影院| 欧美日本在线观看| 精品乱人伦一区二区三区| 久久婷婷国产综合国色天香 | 欧美日韩性生活| 日韩极品在线观看| 99re热这里只有精品视频| 日本网站在线观看一区二区三区 | 三级欧美韩日大片在线看| 亚洲欧美日韩国产一区二区三区| 蜜臀久久99精品久久久久久9| 国产一区欧美一区| av电影在线观看一区| 亚洲蜜臀av乱码久久精品蜜桃| 91精彩视频在线观看| 爽好多水快深点欧美视频| 日韩欧美中文字幕制服| 国产精一区二区三区| 国产精品色哟哟| 欧美亚洲综合网| 精品一区在线看| 亚洲青青青在线视频| 欧美一区三区四区| 粉嫩av亚洲一区二区图片| 洋洋成人永久网站入口| 欧美va亚洲va在线观看蝴蝶网| 高清不卡在线观看| 亚洲一区二区三区四区在线观看 | 色94色欧美sute亚洲线路一久 | 色婷婷激情久久| 蜜桃av一区二区| 国产精品免费视频观看| 欧美区一区二区三区| 亚洲精品免费在线观看| 亚洲一区二区3| 亚洲电影一区二区三区| 奇米影视一区二区三区| 国产东北露脸精品视频| 91亚洲精品久久久蜜桃网站| 91蜜桃视频在线| 9191久久久久久久久久久| 欧美一区三区二区| 精品福利一区二区三区| 欧美性高清videossexo| 欧美视频一区二| 欧美一区二区三区免费观看视频 | 久久综合狠狠综合久久激情| 这里只有精品免费| 国产欧美一二三区| 国产精品久久久久永久免费观看| 久久精品一区蜜桃臀影院| 日韩一区二区三区视频在线观看| 欧美性一级生活| 中文字幕亚洲区| 免费人成精品欧美精品| 亚洲精品在线网站| 91视频观看视频| 国产精品白丝在线| 另类人妖一区二区av| 久久欧美一区二区| 亚洲成人免费视频| 丁香婷婷综合五月| 欧美色电影在线| 欧美美女网站色| 678五月天丁香亚洲综合网| 欧美午夜精品久久久久久超碰| 精品国产精品网麻豆系列| 免费久久99精品国产| 亚洲人123区| 国产精品乱人伦中文| 欧美综合色免费| 美国十次综合导航| 亚洲国产成人porn| 亚洲免费资源在线播放| 久久欧美中文字幕| 久久婷婷国产综合精品青草| 欧美日韩一区二区欧美激情| 一本一本大道香蕉久在线精品 | 欧美午夜精品久久久久久超碰| 成人免费视频免费观看| 美日韩一级片在线观看| 天天亚洲美女在线视频|