Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: C to Pascal conversion hq2x

  1. #11

    C to Pascal conversion hq2x

    Updated the download link above with Setharian's version. I did make one minor change from longword to hq2xnumber this way in 64 bit compilers it should be easy to find the right type when someone decides to change it.

    I've also started to convert the cimage unit, as it seems that RGB won't work due to the internal pixel format . The converted cimage.pas file doesn't work properly right now. There are problems with the convert16 and convert24 methods. Basically I ran the C source through a converter and then cleaned it up until it compiled. Looking at the output of the images after convert16 is called it appears that I have my pointers jacked up again , the colors are quite off but the pattern is correct.

    Thanks everyone for the help so far, hopefully soon we will have a pure pascal version of hq2x. When this is complete I think working on 2xSAI would make sense. Any interest on converting this one as well?

  2. #12

    C to Pascal conversion hq2x

    So any screenies from this project yet?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #13

    C to Pascal conversion hq2x

    Not yet, I'm still working on getting cimage working in its converted state. The hq2x download listed above, or in my zip file, seems to do exactly what its supposed to but needs a 16bit surface to work against. So until I get cimage converted I think it is almost useless as I can't find any image component for Lazarus that uses 16bit.

    I will say that you get some pretty cool and interesting results pushing a Laz RGB image into the routine though

  4. #14

    hq2x in FPC WORKING!

    Ok, well sorta... Using the Vampyre Imaging Library I am able to prove that the conversion of hq2x works perfectly! It loads, scales, and saves out an image just fine.

    This brings in an interesting problem though. I can load the resulting image in anything except for a Lazarus TImage. Oh well, loading with paint and then resaving works just fine. I wonder if I used Vampyre to save it to a more compatible format if it would work ok.

    Anyways, the download link above has the updated code that works fine.

    Here are the two samples, input and output, sorry for the bitmap posting but thats the format hq2x plays in and I don't want to show 3rd party conversions.



    Just in case, here is the download link (same as above) again:
    http://www.eonclash.com/PGD/hq2x.zip

  5. #15

    C to Pascal conversion hq2x

    Looks good. Did it take you long to find the last few pointer issues?
    How quick is it compared to other scalers?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  6. #16

    C to Pascal conversion hq2x

    Quote Originally Posted by savage
    Looks good. Did it take you long to find the last few pointer issues?
    How quick is it compared to other scalers?
    I still haven't managed to fix cimage, but when Vampyre worked I stopped looking .

    As for speed, I don't know haven't actually benchmarked many 2x scalers in my life. On my system it performs a scale of a 256x256 image easily at 60fps real time.

  7. #17
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    C to Pascal conversion hq2x

    If it performs well in window mode, I might just have to take advantage of it for my final version of S33.

    Nice work Jeremy.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  8. #18

    Re: hq2x in FPC WORKING!

    Quote Originally Posted by jdarling
    This brings in an interesting problem though. I can load the resulting image in anything except for a Lazarus TImage. Oh well, loading with paint and then resaving works just fine. I wonder if I used Vampyre to save it to a more compatible format if it would work ok.
    I noticed that too. Lazarus' bitmap loader for some reason only loads bottom-up and not top-down bitmaps (which Imaging creates). I'll probably change bitmap saver in Imaging to save bitmaps as bottom-up instead (these should work everywhere).
    Vampyre Imaging Library
    Earth Under Fire (PGD Big Boss 3rd place)
    Domains Of Chaos (PGD Multiplexity 5th place)

  9. #19

    C to Pascal conversion hq2x

    Jeremy, are there any plans to write an SDL compatible implementation by any chance ?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  10. #20

    C to Pascal conversion hq2x

    Well, Galfar actually fixed my original translation so I'll have to get to where I understand his changes. But, yes, I plan on building out a version that works with SDL images eventually.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •