• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - jdarling

1
Start to finish was maybe 8 hours over 3 days.  I have a few things that might allow me some time later this week to take a look at 3x and 4x.  Since they build on one another I'll start at 3x when I get some time.
2
I don't know how to detect the lazarus version at compile time, but some place I was reading about performing an {$IFDEF ProcName} or something similar.  I'll take a look around and see if I can find it.

I noticed the thread after you pointed it out, but the title threw me and didn't notice it when I was looking for a fix.
3
I've thought of converting 3 and 4, but am not sure what the demand would be for them.  Not to mention that 2x was "fun" enough LOL.
4
I just downloaded the latest snapshot of Lazarus only to find that it completely breaks when you try and install Vampyre.  The problem is that they (unannounced to anyone) have deprecated and removed CreateBitmapFromRawImage and a few others.

The fix is to open ImagingComponents and edit the following lines:
Change if CreateBitmapFromRawImage(RawImage, ImgHandle, ImgMaskHandle, False) then
toif RawImage_CreateBitmaps(RawImage, ImgHandle, ImgMaskHandle, false) then
and Changeif GetBitmapRawImageDescription(Bitmap.Handle, @RawImage.Description) then
toif RawImage_DescriptionFromBitmap(Bitmap.Handle, RawImage.Description) then
and Changeif GetRawImageFromBitmap(Bitmap.Handle, 0, Classes.Rect(0, 0, Data.Width, Data.Height), RawImage) then
toif RawImage_FromBitmap(RawImage, Bitmap.Handle, 0, Classes.Rect(0, 0, Data.Width, Data.Height)) then
and FINALLY ChangeFreeRawImageData(@RawImage);
toRawImage.FreeData;

Just thought others might want to know about this so that the next time you update you don't have to do the leg work yourself :).
5
Hey Galf, was going through my hard drive and noticed my version of hq2x for Vampyre.  Since you helped me fix the code in the first place, was wondering if you wanted to include it in Vampyre as a feature.  Latest version can be downloaded at: http://www.eonclash.com/PGD/hq2x.zip

My little contribution back for such a great lib :)
6
I don't know if the spec is published some place or not.  I have contacted the author before and he seemed very responsive, of course that was in regards to the Lua integration and not direct access to his data files :).  When I tried reading in a PSD it didn't quite work well, but then again the PSD is a CS3 version with embedded objects so that may be a problem.  I'll have Creative save it as a CS2 and see how that loads.

My other request would be getting transparency working when blitting :(.  Right now I'm using:procedure BlendImageTo(WhatCanvas: TCanvas; ImageData : TImageData; SourceRect : classes.TRect; DestX, DestY : Integer; AlphaThreshold : Byte = 255);
var
  ax, ay,
  ix, iy : integer;
  c32    : TColor32Rec;
begin
  iy := DestY;
  for ay := SourceRect.Top to SourceRect.Bottom do
    begin
      ix := DestX;
      for ax := SourceRect.Left to SourceRect.Right do
        begin
          c32:= GetPixel32(ImageData, ax, ay);
          if c32.A >= AlphaThreshold then
            WhatCanvas.Pixels[ix, iy] := RGBToColor(c32.R, c32.G, c32.B);
          inc(ix);
        end;
      inc(iy);
    end;
end;
Of course thats extremely slow and not really a good way to perform the blit :(.  It also doesn't handle the alpha blending, but hey it works :).
7
I'd like to see support built out in a few more image formats.  Specifically: XPM and PSD support added.  AWD would be a nice to have, but seeing as how ArtWeaver can export to other formats (PNG, TIFF, etc...) it isn't that much of a hassle.  Might be some re-useable code in GraphEx (http://www.soft-gems.net/index.php?option=com_content&task=view&id=13&Itemid=33).

Of course, Lazarus has built in support for XPM that could be used for reference as well :).
8
I noticed that when I use LoadGLTextureFromStream to load a graphic and the graphic isn't proper power of 2 the final texture is up-scaled to the next power of two.  This causes blurry images when rendering and makes sprite sheet locations all sorts of "fun".  Any chance that there is a way to have the new texture created not scale the original image and instead create a new texture that is proper power of 2 and just has empty space around it?

A picture might be worth a 1000 words in this case.  Given the following source (72x128):

The texture created by LoadGLTextureFromStream is:

I'd rather it be:
(or similar)

As when rendered with OpenGL the current version becomes blurry.

Thanks,
- Jeremy

PS: Sill loving Vampyre :)
9
Help & Questions / Re: 1 bit image output
18 July 2007, 15:42:29
Hey Galf, sorry it took so long to reply I've been busy on another project that had immediate attention needs :).  Anyways, the library I'm using is called Tesseract and can be found at http://code.google.com/p/tesseract-ocr/

Seems to work well, but does have its limitations (like I can't figure out how to use iterative training with the damned thing).

On another note, I've been working on wrapping up a lot of the Vampyer stuff to I can use it from my Lua scripts inside our application.  Any chance you would be interested in the code when its complete?  It would require anyone using it to have my version of the Lua headers or to make sure that they have support for the proper libraries (I think the JEDI version would also work), but it may be useful to people who need to do image manipulation within their Pascal projects using Lua scripting.
10
Help & Questions / Re: 1 bit image output
5 July 2007, 20:39:33
Saved to file would be nice, but I can work with it in memory as well.  Right now I'm calling a command line OCR application, but it has a DLL that can be put in its place.  Just have to look at the API.
11
Help & Questions / 1 bit image output
2 July 2007, 18:24:36
I've been playing with OCR and the Triss library.  I'm finally ready to incorporate Triss into my application but need to be able to generate 1 bit black and white bitmaps in order to run the OCR against the images.  Can anyone explain how to use Vamp to do this?

Thanks,
- Jeremy
SMF spam blocked by CleanTalk