I've started making the constants include file for DBPro. It will contain
all the information needed to use my plugin. This file will be growing and
changing until I get all the features of my plugin in place.
Here is part of the include file showing the supported formats:
` ------------------------------------------------------------------------------------------
` DarkIMAGE CONSTANTS Include File
` ------------------------------------------------------------------------------------------
` Author: D Ogre
` Version: 1.0
` Date: 03/04/2008
` External Library: FreeImage
` Library Version: 3.10.0
` ------------------------------------------------------------------------------------------
` *** CONSTANTS FOR LOADING WITH A DECOMPRESSION FLAG ***
` Examples: DI_Load Bitmap "filename.jpeg", 1, JPEG_ACCURATE
` DI_Load Image "filename.gif", 1, GIF_LOAD256
` ------------------------------------------------------------------------------------------
#Constant GIF_LOAD256 1 :` .gif Load the image as a 256 color image with ununsed palette entries, If it's 16 or 2 color
#Constant ICO_MAKEALPHA 1 :` .ico Convert to 32bpp and create an alpha channel from the AND-mask when loading
#Constant JPEG_FAST 1 :` .jpg, jpeg Load the file as FAST as possible, sacrificing some quality
#Constant JPEG_ACCURATE 0x0002 :` Load the file with the BEST quality, sacrificing some speed
#Constant JPEG_CMYK 0x0004 :` Load separated CMYK "as is" (USE | To combine with OTHER load flags)
#Constant PCD_BASE 1 :` .pcd Load the bitmap sized 768 x 512
#Constant PCD_BASEDIV4 2 :` Load the Bitmap sized 384 x 256
#Constant PCD_BASEDIV16 3 :` Load the Bitmap sized 192 x 128
#Constant PNG_IGNOREGAMMA 1 :` .png Avoid gamma correction
#Constant TARGA_LOAD_RGB888 1 :` .tga, .targa If set the loader converts RGB555 And ARGB8888 -> RGB888.
` ------------------------------------------------------------------------------------------
` *** CONSTANTS FOR SAVING WITH A COMPRESSION FLAG ***
` Examples: DI_Save Bitmap "filename.bmp", 1, BMP_SAVE_RLE
` DI_Save image "filename.jpeg", 1, JPEG_QUALITYSUPERB
` ------------------------------------------------------------------------------------------
#Constant BMP_SAVE_RLE 1 :` .bmp Save bitmap with RLE Compression
#Constant JPEG_QUALITYSUPERB 0x0080 :` .jpg, jpeg Save with superb quality (100:1)
#Constant JPEG_QUALITYGOOD 0x0100 :` Save with good quality (75:1)
#Constant JPEG_QUALITYNORMAL 0x0200 :` Save with normal quality (50:1)
#Constant JPEG_QUALITYAVERAGE 0x0400 :` Save with average quality (25:1)
#Constant JPEG_QUALITYBAD 0x0800 :` Save with bad quality (10:1)
#Constant JPEG_PROGRESSIVE 0x2000 :` Save as a progressive-JPEG (USE | To combine With OTHER Save flags)
#Constant PNM_SAVE_RAW 0 :` .pbm,.pgm,.ppm If set the writer saves in raw format (i.e. P4, P5 or P6)
#Constant PNM_SAVE_ASCII 1 :` If set the writer saves in ASCII format (i.e. P1, P2 or P3)
#Constant TIFF_CMYK 0x0001 :` .tif Reads/Stores tags For separated CMYK (USE | To combine with compression flags)
#Constant TIFF_PACKBITS 0x0100 :` Save using PACKBITS compression
#Constant TIFF_DEFLATE 0x0200 :` Save using DEFLATE compression (a.k.a. ZLIB compression)
#Constant TIFF_ADOBE_DEFLATE 0x0400 :` Save using ADOBE DEFLATE compression
#Constant TIFF_NONE 0x0800 :` Save without any compression
#Constant TIFF_CCITTFAX3 0x1000 :` Save using CCITT Group 3 fax encoding
#Constant TIFF_CCITTFAX4 0x2000 :` Save using CCITT Group 4 fax encoding
#Constant TIFF_LZW 0x4000 :` Save using LZW compression
#Constant TIFF_JPEG 0x8000 :` Save using JPEG compression
` ------------------------------------------------------------------------------------------
` *** DEFAULT CONSTANTS FOR LOAD AND SAVING ***
` Example: DI_Load Bitmap "filename.koa", 1, KOALA_DEFAULT
` DI_Save Image "filename.pcd", 1, PCD_DEFAULT
` NOTE: You could technically use a ZERO as the parameter for default, or simply ommit the
` parameter altogether when dealing with file formats that require NO compression.
` The constants are provided below for additional information about other formats in which
` this plugin supports using the FreeImage library. It also provides an optional way of
` documenting compression and decompression formats throughout your DarkBASIC
` Professional Program Code.
` Code Snippet:
` Select Compression_Quality
` Case 1 : Flag = JPEG_DEFAULT : EndCase
` Case 2 : Flag = JPEG_QUALITYSUPERB : EndCase
` Case 3 : Flag = JPEG_QUALITYGGOD : EndCase
` Case 4 : Flag = JPEG_QUALITYNORMAL : EndCase
` Case 5 : Flag = JPEG_QUALITYAVERAGE : Endcase
` Case 6 : Flag = JPEG_QUALITYBAD : Endcase
` EndSelect
` DI_Load Save "filename.jpg", 1, Flag
` ------------------------------------------------------------------------------------------
#Constant ADI_DEFAULT 0 :` .XXX DarkIMAGE Constant (Any type)
#Constant BMP_DEFAULT 0 :` .bmp Windows or OS/2 bitmap file
#Constant CUT_DEFAULT 0 :` .cut Dr. Halo
#Constant DDS_DEFAULT 0 :` .dds DirectDraw Surface
#Constant EXR_DEFAULT 0 :` .exr ILM OpenEXR
#Constant FAXG3_DEFAULT 0 :` .g3 Raw Fax format CCITT
#Constant GIF_DEFAULT 0 :` .gif Graphic Interchange Format
#Constant HDR_DEFAULT 0 :` .hdr High Dynamic Range
#Constant ICO_DEFAULT 0 :` .ico Windows Icon
#Constant JPEG_DEFAULT 0 :` .jpg, .jpeg (_FAST) Independent JPEG Group
#Constant IFF_DEFAULT 0 :` .iff Amiga IFF
#Constant KOALA_DEFAULT 0 :` .koa Commodore 64 Koala format
#Constant MNG_DEFAULT 0 :` .mng Multiple Network Graphics
#Constant PCD_DEFAULT 0 :` .pcd Kodak PhotoCD
#Constant PCX_DEFAULT 0 :` .pcx Zsoft Paintbrush PCX bitmap format
#Constant PNG_DEFAULT 0 :` .png Portable Network Graphics
#Constant TIFF_DEFAULT 0 :` .tif Tagged Image File Format
#Constant PNM_DEFAULT 0 :` .pbm,.pgm,.ppm (_RAW) Portable Bitmap, Pixelmap, Graymap
#Constant PSD_DEFAULT 0 :` .psd Abobe Photoshop
#Constant RAS_DEFAULT 0 :` .ras Sun Rasterfile
#Constant SGI_DEFAULT 0 :` .sgi Silicon Graphics SGI image format
#Constant TARGA_DEFAULT 0 :` .tga, .targa Truevision Targa files
#Constant WBMP_DEFAULT 0 :` .wbpm Wireless Bitmap
#Constant XBM_DEFAULT 0 :` .xbm X11 Bitmap Format
#Constant XPM_DEFAULT 0 :` .xpm X11 pixmap Format
I'm still working on the DBPro functions which will allow you to check
files within a folder to see if a format can be loaded.
NOTE: The format identifiers are not included in the constants example above.
Load Example:
File$ = "Test.jpg"
If DI_Check Format For Loading(File$) = DI_JPEG
DI_Load Bitmap File$, 1, JPEG_ACCURATE
EndIf
This function will return a ZERO if the file is not supported. A value of ONE
or greater will determine the file format. Each type will be defined
within the include file.
More to come later. I should be posting in the WIP soon...