• 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 - Galfar

301
Help & Questions / Re: thread-safe?
14 March 2008, 15:16:48
I've fixed some concurrency issues in Network Graphics (PNG/MNG/JNG) and Portable Maps loaders (PAN, PBM, PPM, ...). JPEG, JPEG2000, and TIFF loaders all seem to work fine.

Updated code is in the SVN repository.
302
Help & Questions / Re: thread-safe?
12 March 2008, 11:59:52
Well, short answer is: not thread-safe.
I think most of the operations could be used concurrently but
there are some that use some global variables and structures
(I can remember color reduction but there are others).
If you would only load images most loaders should be safe.
PNG/MNG/JNG loader is not safe currently but that could be fixed
easily. I don't know about loaders that use 3rd party libraries
(JPEG, JPEG2000, TIFF).

It would be great if you could try it and report image loaders that cause problems
so I could look at them. I really don't have much time these days.

Imaging 0.3x will be thread-safe but that is still a long way from being released.
303
Help & Questions / Re: Saving JPEG2000
1 March 2008, 00:53:39
I've just finished adding CDEF handling to OpenJpeg library and updated Imaging to use it.
Updated files are now in SVN repository (I can send them to you by mail if you can't access SVN).

JP2 images with alpha saved by Imaging are now loaded properly by other applications (tested in PSP, IrfanView, XnView, ...).
304
Help & Questions / Re: Saving JPEG2000
26 February 2008, 23:18:55
I'll have some free time this Friday & Saturday so I'll try to get it done.
I think that should be enough time (not yet 100% sure though).
305
Help & Questions / Re: Indexed PNG & Transparency
18 February 2008, 22:24:27
Sorry, I overlooked that you are using Lazarus: no 8bit here, all LCL TBitmaps created by ConvertDataToBitmap are 32bit so they work with LCL TImage (as you noticed with LCLImager).
DisplayImage should work for those too. If it doesn't upload you image here as an attachment.
306
Help & Questions / Re: Saving JPEG2000
10 February 2008, 20:13:47
I'll start working on it in the second half of February (next week?).
I'll let you know when it could be finished once I start
(when I know what exactly needs to be added/changed in OpenJPEG lib).
307
Help & Questions / Re: Indexed PNG & Transparency
29 January 2008, 15:30:48
Try to save TBitmap created from indexed PNG to file and see if it is ok.
If it is ok than the error is in the display part, otherwise it is in the Imaging's loading code.
Maybe also attach your source indexed PNG here so I can have a look how it is handled
by Imaging.

In what pixel format is your TBitmap? If you convert indexed PNG directly to TBitmap you get
8bit TBitmap.
308
Help & Questions / Re: Indexed PNG & Transparency
27 January 2008, 15:01:23
You can try SDL, OpenGL, DirectX, or other APIs designed for fast graphics display.
309
Next update of Imaging 0.2x branch will be 0.24.4 (April/May June/July 2008?).
Next update of Imaging 0.2x branch will be 0.26.0 (end of August 2008).

There will be new data formats: compressed 3Dc (ATI1N and ATI2N)
and support for them in D3D/OpenGL extensions.
XPM file format loader is long due and there will also be
other additions since I'll be using Imaging in my MSc thesis (terrain rendering stuff).
And the bug fixes of course. 

EDIT: I'll also modify OpenJPEG library to allow saving proper JPEG 2000 images with alpha channels and updated OpenJpeg to version 1.3.

Status Update 31.5.2008: I've just added 3Dc data formats to Imaging, various
bugs were fixed in image loaders, and some level of thread safety was ensured (image loaders).
Due to work on my thesis new Imaging release didn't make it in April/May so the new timeframe is
June/July. July is more probable since now I have to study for my final exam.

Status Update 8.7.2008: I've made some canvas extensions (point transforms, non-linear filters)
and I'm planning some more (drawing images with alpha blending). There will be quite a few new things
in new Imaging version so I decided to change its version number from 0.24.4 to 0.26. I hope to get it finished before the end of July.
310
I started with Imaging 0.30 in November '07 and designed basic classes and structures.
Also basic processes like data format conversions and file loading saving were written.
Currently it is nearly 100 KiB of Pascal code but still far from usable.
I hope I'll have more time for it in coming months.

Some of the new features (not in 0.2x) in 0.30:
Data Formats:

  • Native 1, 2, and 4 bit grayscale and indexed formats

  • New YCC and CMYK data formats

  • New compressed data formats (ATI 3Dc, ...)

  • Custom data formats


311
Help & Questions / Re: Indexed PNG & Transparency
25 January 2008, 00:18:14
TImagingCanvas provides some drawing operations that work on images (TImageData, TSingleImage, ...). It's in no way compatible with VCL TCanvas class.

Creating new TBitmap every frame would be slow but you can create it just once and update
its bits when needed (see SetDIBits WinAPI function) - that would be much faster.
But still, using Windows GDI is not very well suited for 60fps graphics (if it's something more complex than just a few small images).
312
Help & Questions / Re: Indexed PNG & Transparency
23 January 2008, 19:17:16
If you suspect that some image is not loaded correctly try saving it back to some file (try more  file formats) right after loading and check this file. Loading could be fine but the displaying could not.

As you wrote in your post DisplayImage only supports 32bit images so it can't display 8bit indexed PNG correctly. DisplayImages uses StretchDIBits WinAPI function which assumes scanlines aligned to 32bits - so every 32bit image is fine but for example 8bit images would have to have width that is multiple of four (to get 4x8=32bit alignment). In Linux different API si used but the requirements for the image are pretty much the same.

StretchDIBits doesn't support alpha blending so no transparency can be displayed.
Rather convert image to native representation of display API you are using (ConvertImageToBitmap to get TBitmap, or SDL/D3D/OGL units).
313
There is a library path missing in the BuildLibraryFPC.bat script. I added fixed one
in the attachment.
With the fixed one it should work in FPC 2.0.4 and with 2.2 if you remove the resource reference.
Otherwise I get this error:

gcc: Warning: `-x c' after last input file has no effect
gcc: No input files
c:\progra~1\freepa~1\bin\i386-win32\windres.exe: no resources
VampyreImaging.dpr(129,1) Error: Error while linking
VampyreImaging.dpr(129,1) Error: Can't open object file: ..\Bin\fpc-res.or
VampyreImaging.dpr(129,1) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
Error: c:\progra~1\freepa~1\bin\i386-win32\ppc386.exe returned an error exitcode
(normal if you did not specify a source file to be compiled)
Error when building library!


EDIT: Added the fixed script.
314
Help & Questions / Re: Saving JPEG2000
17 December 2007, 23:30:22
I guess it wouldn't take more than one or two whole days of work. But I can't say
when I'll have that much free time because I've got a lot of other work to do right now and
this probably won't change until February :(
315
I get the same error with FPC 2.2 but it works with FPC 2.0.4.
Looks like there is some problem with resource compiler (windres) because
if you delete {$R *.res} line in VampyreImaging.dpr it compiles in FPC 2.2 too.

By the way do you use DLL version of Imaging?

Does you error output when compiling BuildLibraryFPC.bat look the same?

gcc: Warning: `-x c' after last input file has no effect
gcc: No input files
c:\progra~1\freepa~1\bin\i386-win32\windres.exe: no resources
VampyreImaging.dpr(129,1) Error: Error while linking
VampyreImaging.dpr(129,1) Error: Can't open object file: ..\Bin\fpc-res.or
VampyreImaging.dpr(129,1) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
Error: c:\progra~1\freepa~1\bin\i386-win32\ppc386.exe returned an error exitcode
(normal if you did not specify a source file to be compiled)
Error when building library!

SMF spam blocked by CleanTalk