www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - libpng libjpg

reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
I've made imageio.d and imageio.lib which has
libpng(+zlib) libjpeg inside and I am going to publish the whole
project in a week or two.

Meantime if anybody needs them now just drop me a message

imageio.lib compiled using dmc and make file provided

imageio.d file is simple:
--------------------------
module imageio.imageio;

version (Windows) { pragma(lib, "imageio\\imageio.lib"); } // weird , 
Windows supports / in paths
else {  pragma(lib, "imageio/imageio.lib"); }

// PNG and JPEG image decoder/encoder library
extern (C)
{
  // callback image ctor
  alias int function(void* prm, uint width, uint height, int bytesPerPixel, 
ubyte** rowPtrs) ImageCtor;
  // image decoder by itself
  int DecodeImage(ImageCtor pctor, void* pctorPrm, ubyte* src, uint 
srcLength);
}
---EOF-----------------


Fragment of real code which uses it and creates Win32 DIB:

extern(C) int DibCtor(void* pctorPrm, uint width, uint height, int 
bytesPerPixel, ubyte** rowPtrs)
{
  Dib im = cast(Dib)pctorPrm;
  im.init(size(width,height),bytesPerPixel);

  for(int i = 0; i < height; ++i)
    rowPtrs[i] = im.rowBytes(i).ptr;

  return 1;
}

class Dib
{
....
       // creates Dib from PNG or JPEG encoded bytes.
       static Dib create(ubyte[] bytes)
      {
          Dib d = new Dib();
          if(d.DecodeImage(&DibCtor, d, bytes.ptr, bytes.length))
              return d;
          delete d;
          return null;
      }
      // loads Dib from PNG/JPG file
      static Dib load(char[] path) { .... }

}
Apr 02 2005
next sibling parent reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
Here is a screenshot of PNG with alpha rendering in D
http://terrainformatica.com/screenshots/smileui.png
As you may see image rendered on top of input widgets.
Apr 05 2005
next sibling parent Georg Wrede <georg.wrede nospam.org> writes:
Cool!

Andrew Fedoniouk wrote:
 Here is a screenshot of PNG with alpha rendering in D
 http://terrainformatica.com/screenshots/smileui.png
 As you may see image rendered on top of input widgets.
 
 
Apr 05 2005
prev sibling parent reply "Charlie" <charles jwavro.com> writes:
Is that the HTML GUI ?  Looks promising!

Charlie

"Andrew Fedoniouk" <news terrainformatica.com> wrote in message
news:d2v5ug$5to$1 digitaldaemon.com...
 Here is a screenshot of PNG with alpha rendering in D
 http://terrainformatica.com/screenshots/smileui.png
 As you may see image rendered on top of input widgets.
Apr 06 2005
parent reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
 Is that the HTML GUI ?  Looks promising!
Solely HTML GUI is unpractical. Too many reasons. Embedded HTML used as universal layout manager and simple viewer of e.g. html documents (help, tooltip) does make sense. In short : use cases are similar to what XUL (Mozilla) is used for currently. In any case it will be reduced HTML tightly integrated with the rest of the framework. E.g. it will be possible to say: hPanel.load( "<p>And your age is: " ~ new NumericBox(0,150) ~ " years</p>"); Andrew.
Apr 06 2005
parent reply jicman <jicman_member pathlink.com> writes:
And how do I get a hold of this library? :-)


Andrew Fedoniouk says...
 Is that the HTML GUI ?  Looks promising!
Solely HTML GUI is unpractical. Too many reasons. Embedded HTML used as universal layout manager and simple viewer of e.g. html documents (help, tooltip) does make sense. In short : use cases are similar to what XUL (Mozilla) is used for currently. In any case it will be reduced HTML tightly integrated with the rest of the framework. E.g. it will be possible to say: hPanel.load( "<p>And your age is: " ~ new NumericBox(0,150) ~ " years</p>"); Andrew.
Apr 07 2005
parent reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
In a week or two I hope to publish it.
Only win32 version for a while. 
Apr 08 2005
parent jicman <jicman_member pathlink.com> writes:
That's ok, that's what I want it for, anyway. ;-)


Andrew Fedoniouk says...
In a week or two I hope to publish it.
Only win32 version for a while. 
Apr 08 2005
prev sibling parent reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
Tables and simple styles are pretty much done:
http://www.terrainformatica.com/screenshots/smileui.png
Apr 12 2005
next sibling parent reply Georg Wrede <georg.wrede nospam.org> writes:
The one where the parrot was in front of the box was cooler!

Still, congratulations! Keep up this _excellent_ work!

Andrew Fedoniouk wrote:
 Tables and simple styles are pretty much done:
 http://www.terrainformatica.com/screenshots/smileui.png
 
 
 
 
Apr 13 2005
parent "Andrew Fedoniouk" <news terrainformatica.com> writes:
 The one where the parrot was in front of the box was cooler!
:) Sorry, I just don't want to publish something which is partly done so far. The intention is to provide a solid foundation for crossplatform UI framework (and yet practical!) and at current stage I did not finished even its basement. But it is close. "Georg Wrede" <georg.wrede nospam.org> wrote in message news:425CFFD0.9020903 nospam.org...
 The one where the parrot was in front of the box was cooler!

 Still, congratulations! Keep up this _excellent_ work!

 Andrew Fedoniouk wrote:
 Tables and simple styles are pretty much done:
 http://www.terrainformatica.com/screenshots/smileui.png


 
Apr 13 2005
prev sibling parent reply "Charlie" <charles jwavro.com> writes:
Hehe, you keep teasing us with these screen shots :S.


"Andrew Fedoniouk" <news terrainformatica.com> wrote in message
news:d3ibis$tuo$1 digitaldaemon.com...
 Tables and simple styles are pretty much done:
 http://www.terrainformatica.com/screenshots/smileui.png
Apr 13 2005
parent jicman <jicman_member pathlink.com> writes:
I agree, Charlie!  He is a teaser!

jic

Charlie says...
Hehe, you keep teasing us with these screen shots :S.


"Andrew Fedoniouk" <news terrainformatica.com> wrote in message
news:d3ibis$tuo$1 digitaldaemon.com...
 Tables and simple styles are pretty much done:
 http://www.terrainformatica.com/screenshots/smileui.png
Apr 13 2005