JPEG support with ijg - getting access violation

前端 未结 7 1247
余生分开走
余生分开走 2021-01-06 12:00

I was recently trying to update my game to store graphics in compressed formats (JPEG and PNG).

Whilst I ended up settling on a different library, my initial attempt

7条回答
  •  离开以前
    2021-01-06 12:16

    To work with images in multiple formats, let me recommend you DevIL as a library http://openil.sourceforge.net/. It's an excellent choice, as I've used it many times with excellent results. Beware that it's syntax is OpenGL-like.

    The list of features:

    Supports loading of:

    • .bmp
    • .cut
    • .dcx
    • .dds
    • .exr
    • .ico
    • .icns
    • .gif
    • .jpg
    • .jp2
    • .lbm
    • .lif
    • .mdl
    • .pcd
    • .pcx
    • .pic
    • .png
    • .pnm
    • .psd
    • .psp
    • .raw
    • .sgi
    • .tga
    • .tif
    • .wal
    • .act
    • .pal
    • .hdr
    • Doom graphics

    Supports saving of:

    • .bmp
    • .dds
    • .jpg
    • .pcx
    • .png
    • .pnm
    • .raw
    • .sgi
    • .tga
    • .tif
    • .pal

    Library Features

    • Portable, supports Windows, Mac OS X and *nix.
    • OpenGL-style syntax.
    • Use of image names instead of ugly pointers.
    • Loading from files, file streams or memory "lumps".
    • Direct access to data through ilGetData() and ilSetData().
    • Support for luminance, rgb(a), bgr(a) and colour-indexed images.
    • Support for 3 different numbers of bits per channel.
    • Conversion between all formats and datatypes (including palettes).
    • User-defined automatic conversions if desired when loading images.
    • Automatic conversion when saving images if needed.
    • Automatic conversion of colour-indexed images to truecolour images if desired.
    • Controllable compression when saving.
    • Maintains a state stack that can be pushed and popped.
    • Full support for 3d texture volumes (3d images).
    • Validation of images.
    • Support for layers.
    • Support for mipmaps.
    • Support for animations.
    • User-specified clear colour.
    • Can load a default image if loading fails.
    • User-specified hints.
    • Use of key colours.
    • Support for overlaying an image on top of another.
    • Allows the user to specify their own loading and saving callbacks, even overriding the default ones.
    • Support for user-specified read and write functions.
    • Delphi support.
    • Visual Basic support.
    • Linux support.
    • Can pick and choose which features will be used to create smaller dlls.
    • Choose whether to use the Intel Jpeg Library or libjpeg.
    • A whole host of effects and filters to apply to images, such as embossing and edge detection.
    • Images can be resized or even be put on a larger background (enlarged canvas).
    • OpenGL, Allegro, Windows GDI and DirectX API support.

提交回复
热议问题