Does anyone have ASM JPEG Library?

I worked with Independent JPEG Group(IJG) library in my C program.

But, Now I'm working with Win32 Assembly, So I'm searching ASM JPEG Library
(Someone can tell me 'You can use IJG library by eliminating C runtime library functions -> But I want to work with pure ASM. :) )

Could anyone help me please?

Thank you for reading!!! :)


P.S. I also have used Intel JPEG Library (DLL). It's messy...
Posted on 2002-05-29 01:15:44 by nyam
There used to be a 4KB asm jpeg library around but I can't find it anymore. You could also use window's functionality of loading images (for GIF and JPEG), Ernie has examples on his site of how to do use it.

Thomas
Posted on 2002-05-29 01:20:41 by Thomas
Thank you Exagone!!! (Also for your PNGlib!!! :) )

But...
I don't want to use OLE LoadPicture method.

And, I have been using prometee's ASM JPEG library,
But It can read *few* of JPEG 1.0 image.

Do I have to write it in my own?
Posted on 2002-05-29 01:28:04 by nyam
It's the only asm jpeg library I've ever seen so I'm afraid you'll have to write your own :(.

Thomas
Posted on 2002-05-29 01:38:50 by Thomas
nyam: Compile a C one and get the resulting asm source.. then optimize it further, if you wish.
Posted on 2002-05-29 03:27:18 by Maverick
You can grab the Intel JPEG library.

There is an assembly routine as example here:

http://spiff.tripnet.se/~iczelion/source0.html

JC
Posted on 2002-05-29 15:07:01 by MCoder
>And, I have been using prometee's ASM JPEG library,
>But It can read *few* of JPEG 1.0 image.
Where can I find this piece of code ?

Also, I have another question: is there a ZIP ASM library available somewhere ?
PNGLib includes a small ZIP extractor, but where can I find a full source code library ? (I know about BigSpeedZIP and PKWARE packages, but I'm searching an open source ASM lib).

JC
Posted on 2002-05-29 17:27:17 by MCoder
Here is prometee's JPEGLIB.

The size of library is very small.

But It doesn't contain sources. (only binary library)

It can read some JPEG files.
And, it decodes it by 32bit DIB.

P.S. I couldn't find any ASM Zip library... :(
Posted on 2002-05-29 19:03:43 by nyam
Have you tried freeimage.dll, its a freeware image reading / saving (converting...) dll that i have been using - 600 k or so, but compresses to about 290k.

I find it works just as well as the Intel library, but supports LOTS of formats..

To use just import the dll functions as normal, if you want I did create an include file for it.....
Posted on 2002-06-04 16:35:53 by Terab

To use just import the dll functions as normal, if you want I did create an include file for it.....


Please attach it... ;)
I would eventually use this library in a more or less near/far future, and it would save me some time to have a the asm include for it.
Thanks in advance. ;)
Posted on 2002-06-05 01:13:45 by JCP
Sure thing, all the EQU's are in the inc file, but not all the definitions.

Will try and post it a bit later..... busy getting a new videocapture system running now, goes live in about 15 minutes over 4 servers - <gulp>
Posted on 2002-06-05 09:57:34 by Terab
Alrighty then everything seems ok so far, so i'll post the example code with some explanation.

just noticed cant attach a .inc file - so its now called freeimageinc.asm

sorry but i didnt import all the functions from the library
just the ones i needed at the time, maybe one day i will do the rest, but these should be
enough for most things.

Honestly i did this so long ago i cant even remember if there were more functions....

First we load the dll - thanks to the great examples with masm for this bit

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
invoke LoadLibrary,ADDR FreeImageDLL ; Load the DLL and get its handle

.if eax==NULL
invoke MessageBox,NULL,addr DllNotFound,addr AppName,MB_OK

return 0
.else

mov hDLL, eax

invoke LoadProcs,hDLL ; Get the addresses of the procedures

.if eax==NULL
return 0
.else
.endif
.endif

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Now save the addresses of the functions - once again thanks to dll masm example
no difference from example just added a few functions

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LoadProcs proc hLibrary:DWORD


invoke GetProcAddress,hLibrary,ADDR f1name
mov lpFreeInitialise , eax

invoke GetProcAddress,hLibrary,ADDR f2name
mov lpFreeGetFileType , eax

invoke GetProcAddress,hLibrary,ADDR f3name
mov lpFreeLoad, eax

invoke GetProcAddress,hLibrary,ADDR f4name
mov lpFreeSave, eax

invoke GetProcAddress,hLibrary,ADDR f5name
mov lpFreeUnload , eax

invoke GetProcAddress,hLibrary,ADDR f6name
mov lpFreeDeInitialise, eax


ret

LoadProcs endp


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Now my piece of code - notice the more messy look (generally a giveaway that I coded it :-)
Sometimes .... too often I use numbers instead of equates

;this was to read a bitmap then save as a jpeg...
; quite a useful bit of code for most graphics programs

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


SaveAsJPEG proc

.data
ImageFormat db ?
TEST_FILE db "test.bmp",0
TEST_OUT db "test.jpg",0
DIB dd ?

.code

push NULL
call ;initialize the freeimage dll

push 0 ;a null
mov eax,offset TEST_FILE ;a pointer to the address of the name of the file to read
push eax
push 0 ;imageformat -DIB ;what format to read
call
mov DIB,eax ;if all went ok eax has handle to DIB - should check for errors here

mov edx,0 ; zero out the high word - should use xor edx,edx
mov dx,ImageQuality ;0400h quality setting - 0200 - average to good
push edx
mov eax,offset TEST_OUT ;a pointer to the address of the name of the file to write
push eax
mov eax,DIB ;the handle to the DIB
push eax
push FIF_JPEG ;what are we saving it as - could it be a jpeg? :-)
call


push DIB ;need to clean up - so unload the DIB
call

call ;deinit the freeimage engine


ret

SaveAsJPEG endp


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Posted on 2002-06-05 11:26:21 by Terab
You can find another free library there:

http://perso.wanadoo.fr/pierre.g/xnview/engfl.html

(XnView)
Posted on 2002-06-06 06:37:08 by MCoder
XnView rocks! We use it here at our company as our Main program for graphic displaying! Awesome Freeware stuff! :alright:

Here is a short list of the supported formats of the library and XnView (I love to bloat threads ;) )


Supported formats Extension Compression Remarks
======================================================================================================

[adex] Adex img rle
[aim] AIM Grey Scale ima
[arf] ARF arf
[att] AT&T Group 4 att
[acc] Access g4
[aces] Aces200 ace
[acorn] Acorn Sprite
[ai] Adobe Illustrator ai Ghostscript needed, available on [url]http://www.cs.wisc.edu/~ghost/[/url]
[aphp] Adobe PhotoParade PhP
[psd] Adobe Photoshop Document psd
[ocp] Advanced Art Studio ocp
[anv] AirNav nav
[alias] Alias Image pix als alias
[abmp] Alpha Microsystem BMP bmp
[2d] Amapi 2d
[ami] Amica Paint ami [b]
[iff] Amiga IFF iff blk (1)
[cpc] Amstrad CPC screen
[atk] Andrew Toolkit raster object atk
[hdru] Apollo HRDU hdru hdr
[artdir] Art Director art
[art] Artisan art
[aurora] Aurora sim
[cadc] Autocad CAD-Camera img
[fli] Autodesk Animator fli flc
[gm] Autologic gm gm2 gm4
[bfli] BFLI bfl bfli
[bmf] BMF bmf Windows only, Plugin required
[bfx] Bfx Bitware bfx
[biorad] Bio-Rad confocal pic
[bob] Bob Ray-Tracer bob
[til] Buttonz & Tilez texture til
[brk] Brooktrout 301 brk 301 brt
[cals] CALS Raster Goup 1 cal cals
[cdu] CDU Paint cdu
[cmu] CMU Window Manager cmu
[cp8] CP8 256 gray scale cp8
[crg] Calamus picture cpi crg
[can] Canon Navigator Fax can
[crw] Canon PowerShot 600/A5/A50/Pro70 crw
[cam] Casio QV-10/100 Camera cam
[cmt] Chinon ES-1000 digital camera cmt
[cloe] Cloe Ray-tracer clo
[rix] ColoRIX rix scx sc?
[gif] CompuServe GIF gif giff
[ce] Computer Eyes, Digital Vision ce
[ce1] Computer Eyes, Raw ce1 ce2
[icd] Core IDC idc
[cdr] Corel Draw Bitmap (preview) cdr
[cpat] Corel Draw Pattern (preview) pat
[cbmf] Corel Flow bmf
[cmx] Corel Metafile Exchange (preview) cmx
[cpt6] Corel PhotoPaint 6.0 cpt
[dbw] DBW Render
[map] DIV Game Studio Map map
[fpg] DIV Game Studio Multi Map fpg
[dkb] DKB Ray-tracer dis
[dpx] DPX dpx
[dali] Dali raw sd0 sd1 sd2
[dcpy] Datacopy img
[degas] Degas / Degas Elite pi[1-6] pc[1-3]
[lbm] Deluxe Paint, Electronic Arts lbm
[dicom] Dicom 3 dcm
[tdim] Digital F/X tdim graf
[gem] Digital Research (GEM Paint) img
[dcmp] Discorp CMP Image cmp
[djvu] DjVu djvu djv iw4 Windows only, Plugin required
[doodle] Doodle Atari doo
[dd] Doodle C64 dd
[jj] Doodle C64 Compressed jj
[cut] Dr Halo cut
[eri] ERI-chan (Entis Rasterized Image) eri Windows only, Plugin required
[epi] EPS Interchange Format epi Ghostscript needed, available on [url]http://www.cs.wisc.edu/~ghost/[/url]
[esmp] ESM Software Pix pix
[c4] Edmics c4
[eidi] Electric Image ei eidi
[eps] Encapsulated Postscript (Preview) eps
[esm] Enhance Simplex esm
[ecw] Enhanced Compressed Wavelet ecw Windows only, Plugin required
[tdi] Explore (TDI) & Maya tdi iff
[fif] FIF fif Windows only, Plugin required
[fit] FIT fit
[fax] Fax Group 3 g3 fax
[fi] FlashImage fi
[fpx] FlashPix fpx Windows only, Plugin required
[fits] Flexible Image Transport Systeme fits fts fit
[fbm] Fuzzy Bitmap fbm cbm
[geo] GeoPaint geo
[gfaray] GFA Raytrace sul
[xcf] Gimp Bitmap xcf
[gbr] Gimp Brush gbr
[gicon] Gimp Icon ico
[gpat] Gimp Pattern pat
[god] GoDot 4bt clp
[hf] HF hf
[grob] HP-48/49 Grob gro grb
[hru] HRU hru
[hsi] HSI Raw raw
[mdl] Half-Life Model mdl
[jtf] Hayes JTFax jtf
[m8] Heretic II MipMap m8
[hir] Hires C64 hir
[lif] HomeWorld Texture lif
[kps] IBM Kips kps
[pseg] IBM Printer Page Segment pse
[im5] IM5 (Visilog) im5
[imt] IMNET Image imt
[ioca] IOCA Image Object Content ica
[iss] ISS iss
[icb] Image Capture Board icb
[miff] Image Magick mif miff
[ish] Image Speeder ish
[rlc2] Image Systems RLC2 Graphic rlc2
[ilab] ImageLab b&w b_w
[q3n] Imaging Fax g3n
[imgt] Imaging Technology img
[img] Img Software Set img
[iim] Inshape iim
[ingr] Intergraph Format itg cit rle
[ct] Iris CT ct
[iimg] Interleaf iimg
[wic] J Wavelet Image Codec wic Windows only, Plugin required
[jbig] Joint Bi-level Image experts Group jbg jbig Windows only, Plugin required
[jpeg] Joint Photographic Experts Group jpg jpeg jif jfif J
[jif] Jeff's Image Format jif
[vi] Jovian VI vi
[viff] Khoros Visualization image file vif viff xv
[cel] KiSS Cel cel
[koa] Koala Paint koa
[gg] Koala Paint Compressed gg
[cin] Kodak Cineon cin dpx
[kdc] Kodak DC120 Digital Camera kdc
[k25] Kodak DC25 Camera k25
[pcd] Kodak Photo CD pcd
[kfx] Kofax Group 4 kfx
[lvp] LView Pro lvp
[lda] LaserData lda
[lwi] Light Work Image lwi
[lff] LucasFilm Format lff
[lcel] Lumena CEL cel
[pzp] MGI Photosuite Project pzp
[ldf] LuraDocument Format ldf Windows only, Plugin required
[lwf] LuraWave Format lwf Windows only, Plugin required
[mgr] MGR bitmap mgr
[] MPEG 1 mpg m1v mpa mpe mpeg Windows only
[mtv] MTV Ray-tracer mtv
[mac] Mac Paint mac mpnt
[pict] Macintosh Quickdraw/Pict pic pict pct
[fff] Maggi Hairstyles & Cosmetics fff
[mrf] Marks Russel File mrf
[411] Mavica 411
[pdx] Mayura Draw pdx
[bld] MegaPaint bld
[msp] Microsoft Paint msp
[eyes] Microtek Eyestar img
[msx2] Msx 2 Screen sc2
[mng] Multiple Network Graphics mng
[ncr] NCR Image ncr
[nist] NIST Ihdr pct
[nitf] National Imagery Transmission Format nitf
[car] NeoBook Cartoon car
[neo] Neochrome (ST & TT) neo
[nmp] Neopaint Mask nmp
[stw] Neopaint Stamp stw
[ngg] Nokia Group Graphics ngg
[nlm] Nokia Logo File nlm
[nol] Nokia Operator Logo nol
[oaz] OAZ Fax oaz
[os2] OS/2 Bitmap bmp bga (1) 4 & 8 bits
[abs] Optocat abs
[pic] PC Paint / Pictor Page pic clp
[pm] PM pm
[pcl] Page Control Language pcl
[jbf] PaintShopPro Browser Cache File jbf
[pfr] PaintShopPro Frame pfr
[psp] PaintShopPro Image psp
[pspp] PaintShopPro Pattern pat
[tub] PaintShopPro Picture Tube tub
[pspt] PaintShopPro Texture tex
[palm] Palm Pilot pdb
[pegs] Pegs pxa pxs
[pfs] Pfs Art Publisher art
[pdd] Photo Deluxe pdd pdb
[cat] Photomatrix cat
[pxr] Pixar picture file pic pxr picio pixar
[pixp] Pixel Power Collage ib7 i17 i18 if9
[pxa] Pixia pxa
[pixi] Pixibox pxb
[pds] Planetary Data System pds img
[prf] Polychrome Recursive Format prf
[pbm] Portable Bitmap pbm rpbm
[pdf] Portable Document Format pdf Ghostscript needed, available on [url]http://www.cs.wisc.edu/~ghost/[/url]
[pgm] Portable Greyscale pgm rpgm
[ppm] Portable Image pnm rpnm
[png] Portable Network Graphics png
[ppm] Portable Pixmap ppm rppm
[pgf] Portfolio Graphics pgf
[pgc] Portfolio Graphics Compressed pgc
[cvp] Portrait cvp
[bum] Poser Bump files bum
[ps] Postscript ps Ghostscript needed, available on [url]http://www.cs.wisc.edu/~ghost/[/url]
[pps] PowerPoint (images) pps
[prx] Printfox/Pagefox bs pg gb
[prisms] Prisms pri
[psion3] Psion Series 3 pic
[psion5] Psion Series 5 mbm
[ppp] Punk Productions Picture ppp
[pzl] Puzzle pzl
[q0] Q0 q0
[qdv] Qdv (Random Dot Software) qdv
[qrt] Qrt Ray-tracer qrt
[wal] Quake Texture wal
[vpb] Quantel VPB vpb
[qtif] Quicktime Picture qtif
[ript] RIPTerm Image icn
[rad] Radiance rad img pic
[raw] Raw raw gry grey
[ray] Rayshade pic
[rsb] Red Storm File Format rsb
[j6i] Ricoh Digital Camera j6i
[rfax] Ricoh Fax 001
[pig] Ricoh IS30 pig
[st4] SBIG CCD camera ST-4 st4
[stx] SBIG CCD camera ST-X stx st4 st5 st6 st7 st8
[sci] SciFax sci
[sct] SciTex Continuous Tone sct sc
[sfw] Seattle Film Works sfw
[pwp] Seattle Film Works multi-image pwp
[sj1] Sega SJ-1 DIGIO sj1
[gpb] Sharp GPB img
[sgi] Silicon Graphics RGB rgb bw iris sgi (1)
[skn] Skantek skn
[hrz] Slow Scan Television hrz
[sfax] Smartfax 001
[soft] Softimage bitmap pic si (1)
[sir] Solitaire Image Recorder sir
[pmp] Sony DSC-F1 Cyber-shot pmp
[tim] Sony Playstation TIM PSX tim
[spu] Spectrum 512 spu
[spc] Spectrum 512 compressed spc
[sps] Spectrum 512 smooshed sps
[ssi] SriSun ssi
[stad] Stad pic pac seq
[sdg] Star Office Gallery sdg
[star] Starbase img
[avs] Stardent AVS X x avs mbfs mbfavs
[jps] Stereo Image jps
[sff] Structured Fax Format sff Windows only, Plugin required
[icon] Sun Icon/Cursor icon cursor pr
[ras] Sun Raster Images ras rast sun sr scr rs
[taac] Sun TAAC file format iff vff suniff taac
[synu] Synthetic Universe synu syn
[tg4] TG4 tg4
[ti] TI-73/82/83/85/86/89/92 Bitmap 73i 82i 83i 85i 86i 89i 92i
[tiff] TIFF Revision 6 tif tim tiff (1) (2) (3)
[hr] TRS 80 hr
[teal] TealPaint pdb
[tiny] Tiny tny tn1 tn2 tn3
[tga] TrueVision Targa tga pix bpx vda icb vst (1)
[upst] Ulead Pattern pst
[upi] Ulead PhotoImpact upi
[upe4] Ulead Texture pe4
[face] Usenix FaceServer fac face
[rle] Utah Raster image rle
[vit] VITec vit
[wrl] VRML 2 wrl
[vif] Verity vif
[vicar] Video Image Communication And Retrieval vic vicar img
[vda] Video Display Adapter vda
[] Video for windows avi Windows only
[vst] Vista vst
[vivid] Vivid Ray-tracer img
[vort] Vort pix
[vob] Vue d'Esprit vob
[rla] Wavefront Raster file rla rlb
[fxs] Winfax fxs fxo
[wmf] Windows & Aldus Metafile wmf Windows only
[ani] Windows Animated Cursor ani
[bmp] Windows Bitmap bmp rle rl4 rl8 sys (1) 4 & 8 bits
[clp] Windows Clipboard clp
[cur] Windows Cursor cur
[dib] Windows DIB dib
[emf] Windows Enhanced Metafile emf Windows only
[ico] Windows Icon ico
[wbmp] Wireless Bitmap (level 0) wbmp wbm wap
[wpg] Word Perfect Graphics wpg
[xwd] X Windows System window dump xwd x11
[xbm] X11 BitMap xbm bm
[xpm] X11 PixMap xpm pm
[p7] XV Visual Schnauzer p7
[xim] Xim file xim
[smp] Xionics SMP smp
[uyvy] YUV 16Bits yuv qtl uyvy
[uyvyi] YUV 16Bits Interleaved yuv qtl uyvy
[yuv411] YUV 4:1:1 yuv qtl
[yuv422] YUV 4:2:2 yuv qtl
[yuv444] YUV 4:4:4 yuv qtl
[z80scr] Z80 Screen dump scr
[z80sna] Z80 Spectrum SNA sna
[zzrough] ZZ Rough rgh
[zbr] Zoner Zebra Metafile (preview) zbr
[pcx] Zsoft Multi-page Paintbrush dcx
[dcx] Zsoft Publisher's Paintbrush pcx pcc dcx (1)


Compression Type
================
1 Rle
2 LZW
3 LZW + Prediction
Posted on 2002-06-06 07:01:55 by bazik
woweeee have some image formats there why dont you!

like in 'I married and axe murderer' - hello i asked for the small coffee :-)

Thanks for the link - will check it out
Posted on 2002-06-06 17:22:40 by Terab
BTW, I should forward this format list to Thomas. Perhaps he has some time to write a few librarys :tongue:
Posted on 2002-06-07 01:08:39 by bazik
here is some stuff for IJL.DLL (intel's library). i used it lot of times so it works. i have included some of my examples too.



http://www.hardcore.jawnet.pl/ijl.zip
Posted on 2002-06-25 12:39:34 by ti_mo_n
Posted on 2002-07-13 01:14:05 by comrade
:)
Posted on 2002-07-13 21:36:20 by zjlcc