Announcement

Collapse
No announcement yet.

Smaller Animals

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Smaller Animals

    I have seen that some people use the smaller animals
    graphic libraries. I recently got the library and
    am a little lost with some of the translations.
    Particularly, I have a RGB buffer in memory that
    I want to convert to JPG. I would appreciate any
    directions.

    Thanks all,

    Michael

    ------------------

  • #2
    Generally speaking, DLL function declarations are usually covered by Copyright, therefore posting them (or even PB conversions of them) is not usually permissable, unless the copyright owner explicitly agrees to it. I submitted my conversions of a bunch of IMGDLL's functions to the author, but TTBOMK they were never made public.

    However, we can probably help you with the translations, but which library are you using? IMGDLL or ISOURCE?

    Anyway, here are a couple of IMGDLL parameters sets to get you started:

    IMGDLLRGBfromBMP... (szFILENAME AS ASCIIZ, iWidth AS LONG, iHeight AS LONG)
    IMGDLLSaveRGBToBMP... (szFILENAME AS ASCIIZ, BYVAL pBuf AS LONG PTR, BYVAL iWidth AS LONG, BYVAL iHeight AS LONG)



    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      I understand. I am using the _isource.dll. I purchased
      the source in C from smaller animals, but need to get
      something running fast and am having trouble following
      the code. I found a translation from C to VB at the SA
      web site http://www.smalleranimals.com/isource.htm written
      by Kevin Wilson. This should help make my translation
      to PB a little less painful, but am still a little lost
      on the order of the calls. All I need to do at this point
      for my program is convert a flat buffer of RGB Values
      "RGBBuf()" into a JPG in memory. My buffer is not a bitmap
      at this point but rather a one dimensional array of
      byte values. The steps to undertake this with isource
      have been eluding to me so far. Thanks for any advice.

      Thanks all,

      Michael



      ------------------

      Comment


      • #4
        Is this array of byte values some kind of image or is it binary data? Remember that JPG uses a "lossy" compression algorithm, so it is not a good idea to save data this way... we can get away with it for images as the eye is easily "fooled".

        I'm not familiar with iSOURCE (as I use IMGDLL), but if it is anything like IMGDLL (which is what I suspect), internally it only 'stores' images in an RGB buffer, not in an 'traditional' image specific format like BMP or JPG.

        IMGDLL can create a JPG/BMP/TIF/etc, but it does so by writing it to a disk file, converting from RGB to the target format as necessary.

        Therefore, to load a raw JPG file into memory, you'd have to use the SmallerAnimals library to create the appropriate disk file, then load it back into memory yourself by opening the JPG file in BINARY mode.

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          Originally posted by Lance Edmonds:
          Is this array of byte values some kind of image or is it binary data? Remember that JPG uses a "lossy" compression algorithm, so it is not a good idea to save data this way... we can get away with it for images as the eye is easily "fooled".

          I'm not familiar with iSOURCE (as I use IMGDLL), but if it is anything like IMGDLL (which is what I suspect), internally it only 'stores' images in an RGB buffer, not in an 'traditional' image specific format like BMP or JPG.

          IMGDLL can create a JPG/BMP/TIF/etc, but it does so by writing it to a disk file, converting from RGB to the target format as necessary.

          Therefore, to load a raw JPG file into memory, you'd have to use the SmallerAnimals library to create the appropriate disk file, then load it back into memory yourself by opening the JPG file in BINARY mode.

          AFAIK iSOURCE supports memory source and destination read/write handlers.
          You have to write functions to handle the writing/reading and seek though.
          I'm not suscribing at the moment, but I seem remember that there was a discussion on
          http://www.smalleranimals.com/cgi-bin/isourceboard.pl about this.
          Chris is very active and helpful in this forum.

          BTW: The original .bas headers had many errors. Be sure to double check the declarations.
          Maybe the are better now.

          --
          Peter Scheutz




          ------------------
          Best Regards
          Peter Scheutz

          Comment

          Working...
          X