• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 
19 April 2024, 20:06:29

Recent posts

Pages 1 2 3 4 5 6 7 ... 10
31
Help & Questions / Re: MacOs 64
Last post by Galfar - 7 August 2019, 01:13:21
It's fixed now.
Many changes were needed actually, Delphi macOS and Linux 64bit targets have LongInt/LongWord 64bit in size. It stays 32bit for Win64 and for all FPC targets.
32
Help & Questions / Re: MacOs 64
Last post by Galfar - 3 August 2019, 23:56:14
I've updated my Delphi Community Ed. so I can have a look at this in next few days.
33
Help & Questions / MacOs 64
Last post by JordiMonty - 1 August 2019, 17:52:13
Hello, I'm testing new Delphi 10.3 to build a MacOs64 bit application, and the library only compiles in 32bit mode.

TLongIntArray = array[0..MaxInt div 4 - 1] of LongInt;
[dccosx64 Error] ImagingUtility.pas(47): E2100 Data type too large: exceeds 2 GB

Are there any plans to support it?

Thank you,
Jordi
34
Bugs And Other Insects / Re: Range error when adding im...
Last post by Galfar - 3 July 2019, 16:31:30
Thanks for the fixes, I'll add them to the repository.
TSingleImage and especially TMultiImage are not used and tested that much unfortunately.
35
Bugs And Other Insects / Range error when adding images...
Last post by Patman - 3 July 2019, 15:03:13
Windows 7 x64
Delphi RAD Studio 10.2
Vampyre Imaging latest snapshot
-----

Error occurs when adding mipmaps to MultiImage before exporting to DDS. Like this:

Code (pascal) Select
var
  LImage: TMultiImage;
  LImageCanvas: TImagingCanvas;
  LImageMipMaps: TDynImageDataArray;
begin
          ...
          LImage.Format := ifDXT5;
          Imaging.GenerateMipMaps(LImage.ImageDataPointer^, 10, LImageMipMaps);
          LImage.AddImages(LImageMipMaps);
          FreeImagesInArray(LImageMipMaps);
          LImage.SaveMultiToFile(ToDir + ToMaterial + '.dds');
          ...
end;


LImage has only 1 image when AddImages is called to add 10 mipmaps.
Getting range error from System.Move operation in ImagingClasses::PrepareInsert:

Code (pascal) Select
function TMultiImage.PrepareInsert(Index, Count: Integer): Boolean;
var
  I: Integer;
begin
  // Inserting to empty image will add image at index 0
  if GetImageCount = 0 then
    Index := 0;

  if (Index >= 0) and (Index <= GetImageCount) and (Count > 0) then
  begin
    SetLength(FDataArray, GetImageCount + Count);
    if Index < GetImageCount - 1 then
    begin
      // Move imges to new position
      System.Move(FDataArray[Index], FDataArray[Index + Count],
        (GetImageCount - Count - Index) * SizeOf(TImageData));
      // Null old images, not free them!
      for I := Index to Index + Count - 1 do
        InitImage(FDataArray[I]);
    end;
    Result := True;
  end
  else
    Result := False;
end;


The System.Move and InitImage loop are for handling insertions via InsertImage(s) procedures, but it is also executed for all AddImage(s) procedures, which always add to the end of the array.
I changed it to the following (not tested for all InsertImage(s) and AddImage(s) operations):

Code (pascal) Select
function TMultiImage.PrepareInsert(Index, Count: Integer): Boolean;
var
  I, LImageCount: Integer;
begin
  // Inserting to empty image will add image at index 0
  LImageCount := GetImageCount;
  if LImageCount = 0 then
    Index := 0;

  if (Index >= 0) and (Index <= LImageCount) and (Count > 0) then
  begin
    SetLength(FDataArray, LImageCount + Count);
    if Index <= LImageCount - 1 then
    begin
      // Move images to new position
      System.Move(FDataArray[Index], FDataArray[Index + Count], (GetImageCount - Count - Index) * SizeOf(TImageData));
      // Null old images; do not free them!
      for I := Index to Index + Count - 1 do
        InitImage(FDataArray[I]);
    end;
    Result := True;
  end
  else
    Result := False;
end;



Secondly, this appears to be a bug:

Code (pascal) Select
procedure TMultiImage.InsertImages(Index: Integer;
  const Images: TDynImageDataArray);
begin
  DoInsertImages(Index, FDataArray);
end;


Which should be:

Code (pascal) Select
procedure TMultiImage.InsertImages(Index: Integer;
  const Images: TDynImageDataArray);
begin
  DoInsertImages(Index, Images);
end;

36
Help & Questions / Re: Cropping image possible?
Last post by pka4916 - 31 May 2019, 19:03:59
Thanks.
I figured it out with what you mentioned :)
37
Help & Questions / Re: Cropping image possible?
Last post by Galfar - 31 May 2019, 15:47:53
There's no simple CropImage function but you can
do the two steps that CropImage would do:

1. Create new image with size the same as desired crop rectangle (NewImage)
2. Copy part of the original image to the new one (CopyRect) with proper SrcX and SrcY parameters.
38
Help & Questions / Cropping image possible?
Last post by pka4916 - 23 May 2019, 01:26:17
Is it possible to crop an image?
I have scanned a photo and i want to cut off all the blank parts,   is there a way to  take only a part of an page?

Thank you
39
Help & Questions / [Fixed] Convert dds to png int...
Last post by Shira - 3 May 2019, 19:01:14
Hi, I am able to load a .dds file and save it to a .png, but how can do I to onto a stream instead?

This generates an empty file:

Var Img: TImageData;
      tm: TMemoryStream;

  tm := TMemoryStream.Create;
  InitImage(Img);
  LoadImageFromFile('Z:\xx.dds', Img);
  SaveImageToStream('.png',tm,Img);
  tm.SaveToFile('z:\xxx.png');
  tm.free;
  FreeImage(Img);


Edit: found the issue, '.png' -> 'png'
40
Help & Questions / Re: Convert png with transpare...
Last post by Galfar - 20 March 2019, 13:38:31
You can call ReplaceColor multiple times, once for each color.
Pages 1 2 3 4 5 6 7 ... 10
SMF spam blocked by CleanTalk