lighter
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function lighter Lib "VICFX.DLL" (srcimg As imgdes, oprimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.lighter Lib "VICFX.DLL" (ByRef srcimg As imgdes, ByRef oprimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.lighter(ref imgdes srcimg, ref imgdes oprimg, ref imgdes resimg); |
| C/C++ | int lighter(imgdes srcimg, imgdes *oprimg, imgdes *resimg); |
| Java | int vic.vic32jni.lighter(imgdes srcimg,imgdes oprimg, imgdes resimg); |
Function Arguments
| srcimg | Source image |
| oprimg | Operator image |
| resimg | Result image |
Description
The lighter function places the lighter of the source and operator pixels in the result image area.
-
if (Source > Operator) then
-
Result = Source
-
Result = Operator
The image areas are defined by the corresponding image descriptors. Download the combine images module vicfx.
Import library for MSVC: vicfx.lib
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Images are not all 8- or 24-bit |
| BAD_DIB | One of the images is a compressed DIB |
limitlevel
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function limitlevel Lib "VIC32.DLL" (ByVal limit As Long, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.limitlevel Lib "VIC32.DLL" (ByVal limit As Integer, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.limitlevel(int limit, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int limitlevel(int limit, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.limitlevel(int limit, imgdes srcimg, imgdes resimg); |
Function Arguments
| limit | Maximum brightness level (0-255) |
| srcimg | Source image |
| resimg | Result image |
Description
The limitlevel function sets any brightness levels within an image area that are greater than limit to limit.
-
if Source >= limit
-
Result = limit
-
Result = Source
For an RGB image the source red, green, and blue components all must be greater than or equal to limit for the result pixel to be set to limit. The source and result image areas are defined by the corresponding image descriptors.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Images are not both 8- or 24-bit |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_FAC | Limit is outside the range 0 to 255 |
loadbif
| 8 |
Function Prototypes
| Visual Basic | Declare Function loadbif Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadbif Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadbif(ref string filename, ref imgdes resimg); |
| C/C++ | int loadbif(LPCSTR filename, imgdes *resimg); |
| Java | int vic.vic32jni.loadbif(String filename, imgdes resimg); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
Description
The loadbif function loads an 8-bit binary image file (BIF) into an area in an image buffer. The image area is defined by the image descriptor.
BIF files contain only brightness level data stored as one byte per pixel. Level data can range from 0 to 255. The image data is stored in rows where the first row of data corresponds to the topof the image. There is no palette data associated with a BIF file. When a BIF image is loaded, bit 0 of the image descriptor member imgtype is set to 1.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Image is not 8-bit |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Filename not found |
loadbmp
| 1 | 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadbmp Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadbmp Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadbmp(ref string filename, ref imgdes resimg); |
| C/C++ | int loadbmp(LPCSTR filename, imgdes *resimg); |
| Java | int vic.vic32jni.loadbmp(String filename, imgdes resimg); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
Description
The loadbmp function loads image data from a BMP file into an area in an image buffer defined by the image descriptor. Palette data is loaded into the buffer defined by the image descriptor member palette.
The BMP file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file. Loadbmp will enter into the image descriptor member colors the number of palette colors loaded. Loadbmp loads 1-, 4-, 8-, 16-, 24-, or 32-bit BMP files. When 4-bit BMP files are loaded, they are expanded into 8-bit image buffers and when 16- or 32-bit BMP files are loaded they are stored in 24-bit image buffers.
A BMP file contains a BITMAPFILEHEADER followed by a device independent bitmap (DIB) consisting of a BITMAPINFO structure, which describes the dimensions and colors of the bitmap, and an array of bytes defining the pixels of the bitmap. The bits in the array are packed together, but each scan line must be zero-padded to end on a LONG boundary. The origin of the bitmap is the lower-left corner.
DIBs are discussed in the Victor User's Guide in the DIB Review section. The BMP file format data structures are discussed in Microsoft Windows SDK Programmer's Reference .
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Image is not 1-, 8-, or 24-bit or image and file are not compatible bits per pixel |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Filename not found |
| BAD_BMP | File is not a readable BMP format |
| BAD_CMP | Unreadable compression scheme |
See also
bmpinfo, savebmp
loadbmpfrombuffer
| 1 | 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadbmpfrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadbmpfrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadbmpfrombuffer(ref byte buffer_firstelem, ref imgdes resimg); |
| C/C++ | int loadbmpfrombuffer(UCHAR *buffer, imgdes *resimg); |
| Java | int vic.vic32jni.loadbmpfrombuffer(int buffer, imgdes resimg); |
Function Arguments
| buffer | Buffer address |
| resimg | Result image |
Description
The loadbmpfrombuffer function loads BMP file data from a memory buffer into an area in an image buffer defined by the image descriptor. Palette data is loaded into the buffer defined by the image descriptor member palette.
The BMP file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file. Loadbmpfrombuffer will enter into the image descriptor member colors the number of palette colors loaded.
Loadbmpfrombuffer loads 1-, 4-, 8-, 16-, 24-, or 32-bit BMP files. When 4-bit BMP files are loaded, they are expanded into 8-bit image buffers and when 16- or 32-bit BMP files are loaded they are stored in 24-bit image buffers.
BMP file data contains a BITMAPFILEHEADER followed by a device independent bitmap (DIB) consisting of a BITMAPINFO structure, which describes the dimensions and colors of the bitmap, and an array of bytes defining the pixels of the bitmap. The bits in the array are packed together, but each scan line must be zero-padded to end on a LONG boundary. The origin of the bitmap is the lower-left corner.
DIBs are discussed in the Victor User's Guide. The BMP file format data structures are discussed in Microsoft Windows SDK Programmer's Reference .
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient memory |
| BAD_BPP | Image is not 1-, 8-, or 24-bit or image and file are not compatible bits per pixel |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Memory handle not available |
| BAD_BMP | File is not a readable BMP format |
| BAD_CMP | Unreadable compression scheme |
| BAD_PTR | Buff points at unreadable memory |
See also bmpinfo, savebmp
loadbmppalette
Function Prototypes
| Visual Basic | Declare Function loadbmppalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
| VB.NET | Declare Function vicwin.loadbmppalette Lib "VIC32.DLL" (ByVal filename As String, ByRef paltab As RGBQUAD) As Integer |
| C# | int vicwin.loadbmppalette(ref string filename, ref RGBQUAD paltab); |
| C/C++ | int loadbmppalette(LPCSTR filename, RGBQUAD *paltab); |
| Java | int vic.vic32jni.loadbmppalette(String filename, RGBQUAD[] paltab); |
Function Arguments
| filename | Filename to load |
| paltab | Address of RGBQUAD buffer for palette values |
Description
The loadbmppalette function loads the palette data from a BMP image file into paltab. Paltab must be large enough to hold all of the palette data:
biBitCount |
Number of RGBQUAD elements |
Palette table size (bytes) |
1 |
2 | 8 |
| 4 | 16 | 64 |
| 8 | 256 | 1024 |
| 24 | 0 | 0 |
When loading a BMP file, it is not necessary to explicitly call this function, because loadbmp automatically loads any palette data available if the image descriptor member palette is nonzero.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient local memory |
| BAD_OPN | Filename not found |
| BAD_BMP | File is not a readable BMP format |
loadbmppalettefrombuffer
Function Prototypes
| Visual Basic | Declare Function loadbmppalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, paltab As RGBQUAD) As Long |
| VB.NET | Declare Function vicwin.loadbmppalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef paltab As RGBQUAD) As Integer |
| C# | int vicwin.loadbmppalettefrombuffer(ref byte buffer_firstelem, ref RGBQUAD paltab); |
| C/C++ | int loadbmppalettefrombuffer(UCHAR *buffer, RGBQUAD *paltab); |
| Java | int vic.vic32jni.loadbmppalettefrombuffer(int buffer, RGBQUAD[] paltab); |
Function Arguments
| buffer | Buffer address |
| paltab | Address of RGBQUAD buffer for palette values |
Description
The loadbmppalettefrombuffer function loads the palette data from a memory
buffer holding BMP file data into paltable. Paltable must be large enough to
hold all of the palette data:
biBitCount |
Number of RGBQUAD elements |
Palette table size (bytes) |
1 |
2 | 8 |
| 4 | 16 | 64 |
| 8 | 256 | 1024 |
| 24 | 0 | 0 |
When loading a BMP file, it is not necessary to call this function, because loadbmpfrombuffer automatically loads any palette data available if the image descriptor member palette is nonzero.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient memory |
| BAD_OPN | Memory handle not available |
| BAD_BMP | File is not a readable BMP format |
| BAD_PTR | Buffer points at unreadable memory |
loadgif
| 1 | 8 |
Function Prototypes
| Visual Basic | Declare Function loadgif Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadgif Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadgif(ref string filename, ref imgdes resimg); |
| C/C++ | int loadgif(LPCSTR filename, imgdes *resimg); |
| Java | int vic.vic32jni.loadgif(String filename, imgdes resimg); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
Description
The loadgif function loads image data from a GIF file into an area in an image buffer defined by the image descriptor. Palette data is loaded into the buffer defined by the image descriptor member palette.
The GIF file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file.
Loadgif will enter into the image descriptor member colors the number of palette colors loaded. Loadgif loads 1- to 8-bit GIF images. 1-Bit GIF images are loaded into 1-bit image buffers and 2-to 8-bit GIF images are loaded into 8-bit image buffers.
The transparent color in a GIF file can be obtained using the gifinfo function. If a transparent color is present, gifinfo will return it in the structure element TransColor. If a transparent color is not present, TransColor is set to -1.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local or global memory |
| BAD_BPP | Image is not 1- or 8-bit |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a readable GIF format |
| LZW_DISABLED | LZW functionality locked, see unlockLZW |
See also
gifinfo, loadgifpalette, savegif, savegifex
loadgifframe
| 1 | 8 |
Function Prototypes
| Visual Basic | Declare Function loadgifframe Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes, gdata As GifGlobalData, fdata As GifFrameData) As Long |
| VB.NET | Declare Function vicwin.loadgifframe Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes, ByRef gdata As GifGlobalData, ByRef fdata As GifFrameData) As Integer |
| C# | int vicwin.loadgifframe(ref string filename, ref imgdes resimg, ref GifGlobalData gdata, ref GifFrameData fdata); |
| C/C++ | int loadgifframe(LPCSTR filename, imgdes *resimg, GifGlobalData *gdata, GifFrameData *fdata); |
| Java | int vic.vic32jni.loadgifframe(String filename, imgdes resimg, GifGlobalData gdata, GifFrameData fdata); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
| gdata | Address of global-file data structuree |
| fdata | Address of frame-specific data structure |
Description
The loadgifframe function loads image data from an individual frame in a GIF file into an area in an image buffer defined by the image descriptor. Palette data is loaded into the buffer defined by the image descriptor member palette. The specific frame is defined by the GifFrameData structure fdata. Before calling this function the data structures must be completed by calling the gifinfoframe or gifinfoallframes function.
The GifGlobalData structure elements are defined as follows:
| saveData | Global data of type GifGlobalSaveData
| ||||||||||
| BitsPPixel | Bitcount | ||||||||||
| colorRes | int pixelAspectRatio; | ||||||||||
| commentOffset | Bytes from file start to first comment extension | ||||||||||
| colors | Number of colors in global color table | ||||||||||
| colorMapOffset | Global color table offset in file |
The GifFrameData structure elements are defined as follows:
| saveData | Frame data of type GifFrameSaveData
| ||||||||||||||
| vbitcount | Victor bits per pixel | ||||||||||||||
| width | GIF image width, length | ||||||||||||||
| length | GIF image width, length | ||||||||||||||
| frame | Frame number the data describes | ||||||||||||||
| interlace | Interlaced image | ||||||||||||||
| codesize | Code size | ||||||||||||||
| colors | Number of colors in local color table | ||||||||||||||
| colorMapOffset | Local color table offset in file | ||||||||||||||
| rasterDataOffset | Bytes from file start to start of raster data |
Refer to the description of loadgif for information about the gif format and lzw compression restrictions.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local or global memory |
| BAD_BPP | Image is not 1- or 8-bit |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a readable GIF format |
| GIF_NOFRAME | GIF frame not found |
| BAD_DATA | File contains invalid data |
| LZW_DISABLED | LZW functionality locked, see unlockLZW |
See also
loadgif, gifinfoframe, gifframecount, gifinfoallframes, savegifframe
loadgifframefrombuffer
| 1 | 8 |
Function Prototypes
| Visual Basic | Declare Function loadgifframefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, resimg As imgdes, gdata As GifGlobalData, fdata As GifFrameData) As Long |
| VB.NET | Declare Function vicwin.loadgifframefrombuffer Lib "VIC32.DLL" (ByVal buff As Integer, ByRef resimg As imgdes, ByRef gdata As GifGlobalData, ByRef fdata As GifFrameData) As Integer |
| C# | int vicwin.loadgifframefrombuffer(ref byte buffer_firstelem, ref imgdes resimg, ref GifGlobalData gdata, ref GifFrameData fdata); |
| C/C++ | int loadgifframefrombuffer(UCHAR *buffer, imgdes *resimg, GifGlobalData *gdata, GifFrameData *fdata); |
| Java | int vic.vic32jni.loadgifframefrombuffer(int buffer, imgdes resimg, GifGlobalData gdata, GifFrameData fdata); |
Function Arguments
| buffer | Buffer address |
| resimg | Result image |
| gdata | Address of global-file data structuree |
| fdata | Address of frame-specific data structure |
Description
The loadgifframefrombuffer function loads image data from an individual frame in a GIF file in memory into an area in an image buffer defined by the image descriptor. Palette data is loaded into the buffer defined by the image descriptor member palette. The specific frame is defined by the GifFrameData structure fdata. Before calling this function the data structures must be completed by calling the gifinfoframefrombuffer or gifinfoallframesfrombuffer function.
The GifGlobalData structure elements are defined as follows:
| saveData | Global data of type GifGlobalSaveData
| ||||||||||
| BitsPPixel | Bitcount | ||||||||||
| colorRes | int pixelAspectRatio; | ||||||||||
| commentOffset | Bytes from file start to first comment extension | ||||||||||
| colors | Number of colors in global color table | ||||||||||
| colorMapOffset | Global color table offset in file |
The GifFrameData structure elements are defined as follows:
| saveData | Frame data of type GifFrameSaveData
| ||||||||||||||
| vbitcount | Victor bits per pixel | ||||||||||||||
| width | GIF image width, length | ||||||||||||||
| length | GIF image width, length | ||||||||||||||
| frame | Frame number the data describes | ||||||||||||||
| interlace | Interlaced image | ||||||||||||||
| codesize | Code size | ||||||||||||||
| colors | Number of colors in local color table | ||||||||||||||
| colorMapOffset | Local color table offset in file | ||||||||||||||
| rasterDataOffset | Bytes from file start to start of raster data |
Refer to the description of loadgif for information about the gif format and lzw compression restrictions.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local or global memory |
| BAD_BPP | Image is not 1- or 8-bit |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Memory handle not available |
| BAD_GIF | File is not a readable GIF format |
| GIF_NOFRAME | GIF frame not found |
| BAD_DATA | File contains invalid data |
| BAD_PTR | Buff points at unreadable memory |
| LZW_DISABLED | LZW functionality locked, see unlockLZW |
See also
loadgif, gifinfoframe, gifframecount, gifinfoallframes, savegifframe
loadgiffrombuffer
| 1 | 8 |
Function Prototypes
| Visual Basic | Declare Function loadgiffrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadgiffrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadgiffrombuffer(ref byte buffer_firstelem, ref imgdes resimg); |
| C/C++ | int loadgiffrombuffer(UCHAR *buffer, imgdes resimg); |
| Java | int vic.vic32jni.loadgiffrombuffer(int buffer, imgdes resimg); |
Function Arguments
| buffer | Buffer address |
| resimg | Result image |
Description
The loadgiffrombuffer function loads image data from a memory buffer holding
GIF file data into an area in an image buffer defined by the image descriptor.
Palette data is loaded into the buffer defined by the image descriptor member
palette.
The GIF file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file.
Loadgiffrombuffer will enter into the image descriptor member colors the number
of palette colors loaded. Loadgiffrombuffer loads 1- to 8-bit GIF images. 1-Bit
GIF images are loaded into 1-bit image buffers and 2- to 8-bit GIF images are
loaded into 8-bit image buffers.
The transparent color in a GIF file can be obtained using the gifinfofrombuffer
function.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient memory |
| BAD_BPP | Image is not 1- or 8-bit |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Memory handle not available |
| BAD_GIF | File is not a readable GIF format |
| LZW_DISABLED | LZW functionality not available, see unlockLZW |
| BAD_PTR | Buff points at unreadable memory |
See also gifinfofrombuffer, loadgifpalettefrombuffer, savegiftobufferex
loadgifpalette
Function Prototypes
| Visual Basic | Declare Function loadgifpalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
| VB.NET | Declare Function vicwin.loadgifpalette Lib "VIC32.DLL" (ByVal filename As String, ByRef paltab As RGBQUAD) As Integer |
| C# | int vicwin.loadgifpalette(ref string filename, ref RGBQUAD paltab); |
| C/C++ | int loadgifpalette(LPCSTR filename, RGBQUAD far *paltab); |
| Java | int vic.vic32jni.loadgifpalette(String filename, RGBQUAD[] paltab); |
Function Arguments
| filename | Filename to load |
| paltab | Address of RGBQUAD buffer for palette values |
Description
The loadgifpalette function loads the palette data from a GIF image file into paltable. Paltable must be an array of 256 RGBQUAD structures (1024 bytes). A GIF image may contain up to 256 colors.
When loading a GIF file, it is not necessary to call this function, because loadgif automatically loads any palette data available if the image descriptor member palette is nonzero.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient local memory |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a readable GIF format |
loadgifframepalette
Function Prototypes
| Visual Basic | Declare Function loadgifframepalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD, ByVal framenumber As Long) As Long |
| VB.NET | Declare Function vicwin.loadgifframepalette Lib "VIC32.DLL" (ByVal filename As String, ByRef paltab As RGBQUAD, ByVal framenumber As Integer) As Integer |
| C# | int vicwin.loadgifframepalette(ref string filename, ref RGBQUAD paltab, int framenumber); |
| C/C++ | int loadgifframepalette(LPCSTR filename, RGBQUAD *paltab, int framenumber); |
| Java | int vic.loadgifframepalette(String filename, RGBQUAD[] paltab, int framenumber); |
Function Arguments
| filename | Filename to load |
| paltab | Address of RGBQUAD buffer for palette values |
| framenumber | Frame number whose palette is requested, zero-based |
Description
The loadgifframepalette function loads the palette data used by the specified frame number from a GIF image file into paltable. If there is no local palette for the frame the global palette will be retrieved. Paltab must be an array of 256 RGBQUAD structures (1024 bytes). A GIF image may contain up to 256 colors.
When loading a GIF frame, it is not necessary to call this function, because loadgifframe automatically loads the correct palette data.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient local memory |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a readable GIF format |
loadgifframepalettefrombuffer
Function Prototypes
| Visual Basic | Declare Function loadgifframepalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, paltab As RGBQUAD, ByVal framenumber As Long) As Long |
| VB.NET | Declare Function vicwin.loadgifframepalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef paltab As RGBQUAD, ByVal framenumber As Integer) As Integer |
| C# | int vicwin.loadgifframepalettefrombuffer(byte buffer_firstelem, ref RGBQUAD paltab, int framenumber); |
| C/C++ | int loadgifframepalettefrombuffer(UCHAR *buffer, RGBQUAD *paltab, int framenumber); |
| Java | int vic.loadgifframepalettefrombuffer(int buffer, RGBQUAD[] paltab, int framenumber); |
Function Arguments
| buffer | Buffer address |
| paltab | Address of RGBQUAD buffer for palette values |
| framenumber | Frame number whose palette is requested, zero-based |
Description
The loadgifframepalettefrombuffer function loads the palette data used by the specified frame number from a GIF image file into paltab. If there is no local palette for the frame the global palette will be retrieved. Paltab must be an array of 256 RGBQUAD structures (1024 bytes). A GIF image may contain up to 256 colors.
When loading a GIF frame, it is not necessary to call this function, because loadgifframefrombuffer automatically loads the correct palette data.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient local memory |
| BAD_OPN | Memory handle not available |
| BAD_GIF | File is not a readable GIF format |
| BAD_PTR | Buff points at unreadable memory |
loadgifglobalpalette
Function Prototypes
| Visual Basic | Declare Function loadgifglobalpalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
| VB.NET | Declare Function vicwin.loadgifglobalpalette Lib "VIC32.DLL" (ByVal filename As String, ByRef paltab As RGBQUAD) As Integer |
| C# | int vicwin.loadgifglobalpalette(ref string filename, ref RGBQUAD paltab); |
| C/C++ | int loadgifglobalpalette(LPCSTR filename, RGBQUAD *paltab); |
| Java | int vic.vic32jni.loadgifglobalpalette(String filename, RGBQUAD[] paltab); |
Function Arguments
| filename | Filename to load |
| paltab | Address of RGBQUAD buffer for palette values |
Description
The loadgifglobalpalette function loads the global palette data from a GIF image file into paltable. Paltable must be an array of 256 RGBQUAD structures (1024 bytes). A GIF image may contain up to 256 colors.
When loading a GIF file, it is not necessary to call this function, because loadgif automatically loads any palette data available if the image descriptor member palette is nonzero.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient local memory |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a readable GIF format |
loadgifglobalpalettefrombuffer
Function Prototypes
| Visual Basic | Declare Function loadgifglobalpalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, paltab As RGBQUAD) As Long |
| VB.NET | Declare Function vicwin.loadgifglobalpalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef paltab As RGBQUAD) As Integer |
| C# | int vicwin.loadgifglobalpalettefrombuffer(ref byte buffer_firstelem, ref RGBQUAD paltab); |
| C/C++ | int loadgifglobalpalettefrombuffer(UCHAR *buffer, RGBQUAD far *paltab); |
| Java | int vic.vic32jni.loadgifglobalpalettefrombuffer(int buffer, RGBQUAD[] paltab); |
Function Arguments
| buffer | Buffer address |
| paltab | Address of RGBQUAD buffer for palette values |
Description
The loadgifglobalpalettefrombuffer function loads the global palette data from a GIF image file into paltable. Paltable must be an array of 256 RGBQUAD structures (1024 bytes). A GIF image may contain up to 256 colors.
When loading a GIF file, it is not necessary to call this function, because loadgiffrombuffer automatically loads any palette data available if the image descriptor member palette is nonzero.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient local memory |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a readable GIF format |
loadgifpalettefrombuffer
Function Prototypes
| Visual Basic | Declare Function loadgifpalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, paltab As RGBQUAD) As Long |
| VB.NET | Declare Function vicwin.loadgifpalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef paltab As RGBQUAD) As Integer |
| C# | int vicwin.loadgifpalettefrombuffer(ref byte buffer_firstelem, ref RGBQUAD paltab); |
| C/C++ | int loadgifpalettefrombuffer(UCHAR *buffer, RGBQUAD *paltab); |
| Java | int vic.vic32jni.loadgifpalettefrombuffer(int buffer, RGBQUAD[] paltab); |
Function Arguments
| buffer | Buffer address |
| paltab | Address of RGBQUAD buffer for palette values |
Description
The loadgifpalettefrombuffer function loads the palette data from a memory
buffer holding GIF file data into paltable. Paltable must be an array of 256
RGBQUAD structures (1024 bytes). A GIF image may contain up to 256 colors.
When loading a GIF file, it is not necessary to call this function, because loadgiffrombuffer automatically loads any palette data available if the image descriptor member palette is nonzero.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient memory |
| BAD_OPN | Memory handle not available |
| BAD_GIF | File is not a readable GIF format |
| BAD_PTR | Buff points at unreadable memory |
loadjpg
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadjpg Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadjpg Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadjpg(ref string filename, ref imgdes resimg); |
| C/C++ | int loadjpg(LPCSTR filename, imgdes *resimg); |
| Java | int vic.vic32jni.loadjpg(String filename, imgdes resimg); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
Description
The loadjpg function loads image data from a JPEG file into an area in an image buffer defined by the image descriptor. The JPEG file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file.
Loadjpg loads 24-bit color or 8-bit grayscale images in the JPEG File Interchange Format (JFIF). Loadjpg reads baseline and extended DCT sequential and progressive files that are Huffman encoded (file types SOF0, SOF1, SOF2). The JPEG lossless mode format is not supported.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Image is not 8- or 24-bit or image and file are not compatible bits per pixel |
| BAD_DIB | Image is a compressed DIB |
| BAD_OPN | Filename not found |
| BAD_JPEG | File is not a readable JPEG format |
| BAD_CMP | Unreadable compression scheme |
See also
jpeginfo, savejpg
loadjpgex
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadjpgex Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes, ByVal mode as long) As Long |
| VB.NET | Declare Function vicwin.loadjpgex Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes, ByVal mode As Integer) As Integer |
| C# | int vicwin.loadjpgex(ref string filename, ref imgdes resimg, int mode); |
| C/C++ | int loadjpgex(LPCSTR filename, imgdes *resimg, int mode); |
| Java | int vic.vic32jni.loadjpgex(String filename, imgdes resimg, int mode); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
| mode | Conversion mode
0 = standard conversion of ycc to rgb 2 = no conversion |
Description
The loadjpgex function loads image data from a JPEG file into an area in an image buffer defined by the image descriptor. The JPEG file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file.
Loadjpgex loads 24-bit color or 8-bit grayscale images in the JPEG File Interchange Format (JFIF). Loadjpgex reads baseline and extended DCT sequential and progressive files that are Huffman encoded (file types SOF0, SOF1, SOF2). The JPEG lossless mode format is not supported.
When the mode parameter is set to two, the image will be loaded without conversion from YCbCr color space to RGB color space.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Image is not 8- or 24-bit or image and file are not compatible bits per pixel |
| BAD_DIB | Image is a compressed DIB |
| BAD_OPN | Filename not found |
| BAD_JPEG | File is not a readable JPEG format |
| BAD_CMP | Unreadable compression scheme |
See also
loadjpg
loadjpgfrombuffer
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadjpgfrombuffer Lib "VIC32.DLL" (ByVal buffer as Long, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadjpgfrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadjpgfrombuffer(ref byte buffer_firstelem, ref imgdes resimg); |
| C/C++ | int loadjpgfrombuffer(UCHAR *buffer, imgdes *resimg); |
| Java | int vic.vic32jni.loadjpgfrombuffer(int buffer, imgdes resimg); |
Function Arguments
| buffer | Buffer address |
| resimg | Result image |
Description
The loadjpgfrombuffer function loads image data from memory holding JPEG file data into an area in an image buffer defined by the image descriptor. The JPEG file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file.
Loadjpgfrombuffer loads 24-bit color or 8-bit grayscale images in the JPEG File Interchange Format (JFIF). Loadjpgfrombuffer reads baseline and extended DCT sequential and progressive files that are Huffman encoded (file types SOF0, SOF1, SOF2). The JPEG lossless mode format is not supported.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Image is not 8- or 24-bit or image and file are not compatible bits per pixel |
| BAD_DIB | Image is a compressed DIB |
| BAD_OPN | Memory handle not available |
| BAD_PTR | Buffer does not point to readable memory |
| BAD_JPEG | File is not a readable JPEG format |
| BAD_CMP | Unreadable compression scheme |
See also
loadjpg, jpeginfofrombuffer
loadjpgfrombufferex
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadjpgfrombufferex Lib "VIC32.DLL" (ByVal buffer as Long, resimg As imgdes, ByVal mode as long) As Long |
| VB.NET | Declare Function vicwin.loadjpgfrombufferex Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef resimg As imgdes, ByVal mode As Integer) As Integer |
| C# | int vicwin.loadjpgfrombufferex(ref byte buffer_firstelem, ref imgdes resimg, int mode); |
| C/C++ | int loadjpgfrombufferex(UCHAR *buffer, imgdes *resimg, int mode); |
| Java | int vic.vic32jni.loadjpgfrombufferex(int buffer, imgdes resimg, int mode); |
Function Arguments
| buffer | Buffer address |
| resimg | Result image |
| mode | Conversion mode
0 = standard conversion of ycc to rgb 2 = no conversion |
Description
The loadjpgfrombufferex function loads image data from memory holding JPEG file data into an area in an image buffer defined by the image descriptor. The JPEG file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file.
Loadjpgfrombufferex loads 24-bit color or 8-bit grayscale images in the JPEG File Interchange Format (JFIF). Loadjpgfrombufferex reads baseline and extended DCT sequential and progressive files that are Huffman encoded (file types SOF0, SOF1, SOF2). The JPEG lossless mode format is not supported.
When the mode parameter is set to two, the image will be loaded without conversion from YCbCr color space to RGB color space.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Image is not 8- or 24-bit or image and file are not compatible bits per pixel |
| BAD_DIB | Image is a compressed DIB |
| BAD_OPN | Memory handle not available |
| BAD_PTR | Buff does not point to readable memory |
| BAD_JPEG | File is not a readable JPEG format |
| BAD_CMP | Unreadable compression scheme |
See also
loadjpgfrombuffer
loadjpgthumbnail
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function Declare Function loadjpgthumbnail Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes, ByVal createThumbNail as Long) As Long |
| VB.NET | Declare Function vicwin.loadjpgthumbnail Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes, ByVal createThumbNail As Integer) As Integer |
| C# | int vicwin.loadjpgthumbnail(ref string filename, ref imgdes resimg, int createThumbNail); |
| C/C++ | int loadjpgthumbnail(LPCSTR filename, imgdes *resimg, BOOL createThumbNail); |
| Java | int vic.vic32jni.loadjpgthumbnail(String filename, imgdes resimg, int createThumbNail); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
| createThumbNail | Create thumbnail flag
nonzero = TRUE zero = FALSE |
The loadjpgthumbnail function loads or creates thumbnail image data from a JPEG image file into an area in an image buffer defined by the image descriptor.
This function is similar to loadjpg. But instead of loading a full size image, a smaller "thumbnail" version of the image is loaded.
Use the jpeginfoex function to obtain information about the main image and the thumbnail image. If an embedded thumbnail does not exist in the file, a thumbnail image will be created from the main image. The thumbnail image (embedded or created) will be resized to fit the area specified by the image descriptor while maintaining the aspect ratio. The resulting image will not, however, be resized larger than the main image contained in the file.
As an example, if a thumbnail is created from a 640 x 480 main image (4:3 aspect ratio) and the image area is 100 x 100, the resulting image dimensions will be 100 x 75.
A JPEG file may have an embedded thumbnail in the header information. The createThumbNail flag determines whether a new thumbnail image is to be created regardless of the presence of an existing embedded thumbnail.
CreateThumbNail can have the following values:
TRUE Create thumbnail from main image
FALSE Load embedded thumbnail if present, otherwise create thumbnail from main image
Loadjpgthumbnail loads a 24-bit color, 8-bit palette color, or grayscale thumbnail image. If an embedded JPEG-encoded thumbnail is in the file, loadjpgthumbnail will create a thumbnail based on the main image.
For the fastest loading of a thumbnail, set CreateThumbNail to FALSE. Setting CreateThumbNail to TRUE will probably result in a clearer image if the dimensions of image are much larger that those of the embedded thumbnail.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient memory |
| BAD_BPP | Image is not 8- or 24-bit or image and file are not compatible bits per pixel |
| BAD_DIB | Image is a compressed DIB |
| BAD_OPN | Filename not found |
| BAD_JPEG | File is not a readable JPEG format |
| BAD_CMP | Unreadable compression scheme |
jpeginfoex, savejpgex
loadjpgthumbnailfrombuffer
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadjpgthumbnailfrombuffer Lib "VIC32.DLL" (ByVal buffer as Long, resimg As imgdes, ByVal createThumbNail as Long) As Long |
| VB.NET | Declare Function vicwin.loadjpgthumbnailfrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef resimg As imgdes, ByVal createThumbNail As Integer) As Integer |
| C# | int vicwin.loadjpgthumbnailfrombuffer(ref byte buffer_firstelem, ref imgdes resimg, int createThumbNail); |
| C/C++ | int loadjpgthumbnailfrombuffer(UCHAR *buffer, imgdes *resimg, BOOL createThumbNail); |
| Java | int vic.vic32jni.loadjpgthumbnailfrombuffer(int buffer, imgdes resimg, int createThumbNail); |
Function Arguments
| buffer | Buffer address |
| resimg | Result image |
| createThumbNail | Create thumbnail flag
nonzero = TRUE zero = FALSE |
The loadjpgthumbnailfrombuffer function loads or creates thumbnail image data from memory holding JPEG file data into an area in an image buffer defined by the image descriptor.
This function is similar to loadjpgfrombuffer. But instead of loading a full size image, a smaller "thumbnail" version of the image is loaded.
Use the jpeginfofrombufferex function to obtain information about the main image and the thumbnail image. If an embedded thumbnail does not exist, a thumbnail image will be created from the main image. The thumbnail image (embedded or created) will be resized to fit the area specified by the image descriptor while maintaining the aspect ratio. The resulting image will not, however, be resized larger than the main image.
As an example, if a thumbnail is created from a 640 x 480 main image (4:3 aspect ratio) and the image area is 100 x 100, the resulting image dimensions will be 100 x 75.
A JPEG file may have an embedded thumbnail in the header information. The createThumbNail flag determines whether a new thumbnail image is to be created regardless of the presence of an existing embedded thumbnail.
CreateThumbNail can have the following values:
TRUE Create thumbnail from main image
FALSE Load embedded thumbnail if present, otherwise create thumbnail from main image
Loadjpgthumbnailfrombuffer loads a 24-bit color, 8-bit palette color, or grayscale thumbnail image. If an embedded JPEG-encoded thumbnail is in the file, loadjpgthumbnailfrombuffer will create a thumbnail based on the main image.
For the fastest loading of a thumbnail, set CreateThumbNail to FALSE. Setting CreateThumbNail to TRUE will probably result in a clearer image if the dimensions of image are much larger than those of the embedded thumbnail,
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient memory |
| BAD_BPP | Image is not 8- or 24-bit or image and file are not compatible bits per pixel |
| BAD_DIB | Image is a compressed DIB |
| BAD_OPN | Memory handle not available |
| BAD_PTR | Buff does not point to readable memory |
| BAD_JPEG | File is not a readable JPEG format |
| BAD_CMP | Unreadable compression scheme |
jpeginfofrombufferex, loadjpgthumbnail
loadpcx
| 1 | 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadpcx Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadpcx Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadpcx(ref string filename, ref imgdes resimg); |
| C/C++ | int loadpcx(LPCSTR filename, imgdes *resimg); |
| Java | int vic.vic32jni.loadpcx(String filename, imgdes resimg); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
Description
The loadpcx function loads an image from a PCX file into an area in the image buffer. The image area is defined by the image descriptor. Palette data is loaded into the buffer defined by the image descriptor member palette.
The PCX file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file.
Loadpcx will enter into the image descriptor member colors the number of palette colors loaded. Loadpcx loads a 1-, 4-, 8-, or 24-bit PCX file. (When a 4-bit PCX file is loaded, it is expanded into an 8-bit image buffer.)
When an 8-bit PCX image without palette data is loaded, a grayscale palette is created and bit 0 of the image descriptor member imgtype is set to 1. When a 4-bit PCX image without palette data is loaded, a palette is created that corresponds to the default EGA colors.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Image is not 1-, 8-, or 24-bit or image and file are not compatible bits per pixel |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Filename not found |
| BAD_PCX | File is not a readable PCX format |
See also
loadpcxpalette, savepcx
loadpcxpalette
Function Prototypes
| Visual Basic | Declare Function loadpcxpalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
| VB.NET | Declare Function vicwin.loadpcxpalette Lib "VIC32.DLL" (ByVal filename As String, ByRef paltab As RGBQUAD) As Integer |
| C# | int vicwin.loadpcxpalette(ref string filename, ref RGBQUAD paltab); |
| C/C++ | int loadpcxpalette(LPCSTR filename, RGBQUAD *paltab); |
| Java | int vic.loadpcxpalette(String filename, RGBQUAD[] paltab); |
Function Arguments
| filename | Filename to load |
| paltab | Address of RGBQUAD buffer for palette value |
Description
The loadpcxpalette function loads the palette data from a PCX image file into paltab. Paltab must be large enough to hold all of the palette data:
| BPPixel | Planes | Number of RGBQUAD elements | Palette table size (bytes) |
| 1 | 1 | 2 | 8 |
| 1 | 4 | 16 | 64 |
| 4 | 1 | 16 | 64 |
| 8 | 1 | 256 | 1024 |
When loading a PCX file, it is not necessary to explicitly call this function, because loadpcx automatically loads any palette data available if the image descriptor member palette is nonzero.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient local memory |
| BAD_OPN | Filename not found |
| BAD_PCX | File is not a readable PCX format |
loadpng
| 1 | 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadpng Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadpng Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadpng(ref string filename, ref imgdes resimg); |
| C/C++ | int loadpng(LPCSTR filename, imgdes *resimg); |
| Java | int vic.vic32jni.loadpng(String filename, imgdes resimg); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
Description
The loadpng function loads image data from a PNG file into an area in an image
buffer defined by the image descriptor. Palette data is loaded into the buffer
defined by the image descriptor member palette.
The PNG file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file.
Loadpng will enter into the image descriptor member colors the number of palette colors loaded. Loadpng loads all PNG images. 1-Bit PNG images are loaded into 1-bit image buffers and 2- to 8-bit PNG images are loaded into 8-bit image buffers. All grayscale PNG images are loaded into 8-bit buffers. All RGB images are loaded into 24-bit buffers. Alpha channel data is ignored. Supported pixel depth is 1- to 64-bit.
The transparent color(s) in a PNG file can be obtained using the pnginfo function. If a transparent color is present, pnginfo will return it in the structure element TransData. If a transparent color is not present, the isPresent element of TransData is set to FALSE.
The Victor loadpng function is based on the source code for the ZLIB compression library by Jean-loup Gailly and Mark Adler. PNG stands for Portable Network Graphics. This format is intended to be a patent-free replacement for GIF and uses the LZ77 compression rather than LZW.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient memory |
| BAD_BPP | Image is not 1-, 8-, or 24-bit |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Filename not found |
| BAD_PNG | File is not a readable Png format |
See also
pnginfo, loadpngpalette, savepng, pnggeterror
loadpngfrombuffer
| 1 | 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadpngfrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadpngfrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadpngfrombuffer(ref byte buffer_firstelem, ref imgdes resimg); |
| C/C++ | int loadpngfrombuffer(UCHAR *buffer, imgdes *resimg); |
| Java | int vic.vic32jni.loadpngfrombuffer(int buffer, imgdes resimg); |
Function Arguments
| buffer | Buffer address |
| resimg | Result image |
Description
The loadpngfrombuffer function loads PNG file data from a memory buffer into an
area in an image buffer defined by the image descriptor. Palette data is loaded
into the buffer defined by the image descriptor member palette.
The PNG file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used to load the file.
Loadpngfrombuffer will enter into the image descriptor member colors the number of palette colors loaded. Loadpngfrombuffer loads all PNG images. 1-Bit PNG images are loaded into 1-bit image buffers and 2- to 8-bit PNG images are loaded into 8-bit image buffers. All grayscale PNG images are loaded into 8-bit buffers. All RGB images are loaded into 24-bit buffers. Alpha channel data is ignored. Supported pixel depth is 1- to 64-bit.
The Victor loadpngfrombuffer function is based on the source code for the ZLIB compression library by Jean-loup Gailly and Mark Adler. PNG stands for Portable Network Graphics. This format is intended to be a patent-free replacement for GIF. It uses the LZ77 compression rather than LZW.
Return value
| O_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient memory |
| BAD_BPP | Image is not 1-, 8-, or 24-bit or image and file are not compatible bits per pixel |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Memory handle not available |
| BAD_PNG | File is not a readable PNG format |
| BAD_PTR | Buff points at unreadable memory |
See also
pnginfofrombuffer, loadpngpalettefrombuffer, savepngtobuffer, pnggeterror
loadpngpalette
Function Prototypes
| Visual Basic | Declare Function loadpngpalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
| VB.NET | Declare Function vicwin.loadpngpalette Lib "VIC32.DLL" (ByVal filename As String, ByRef paltab As RGBQUAD) As Integer |
| C# | int vicwin.loadpngpalette(ref string filename, ref RGBQUAD paltab); |
| C/C++ | int loadpngpalette(LPCSTR filename, RGBQUAD *paltab); |
| Java | int vic.vic32jni.loadpngpalette(String filename, RGBQUAD[] paltab); |
Function Arguments
| filename | Filename to load |
| paltab | Address of RGBQUAD buffer for palette value |
Description
The loadpngpalette function loads the palette data from a PNG image file into
paltab.
Paltab must be an array of 256 RGBQUAD structures (1024 bytes) since a PNG image may contain up to 256 colors. When loading a PNG file, it is not necessary to call this function, because loadpng automatically loads any palette data available if the image descriptor member palette is nonzero.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient memory |
| BAD_OPN | Filename not found |
| BAD_PNG | File is not a readable PNG format |
loadpngpalettefrombuffer
Function Prototypes
| Visual Basic | Declare Function loadpngpalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, paltab As RGBQUAD) As Long |
| VB.NET | Declare Function vicwin.loadpngpalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef paltab As RGBQUAD) As Integer |
| C# | int vicwin.loadpngpalettefrombuffer(ref byte buffer_firstelem, ref RGBQUAD paltab); |
| C/C++ | int loadpngpalettefrombuffer(UCHAR *buffer, RGBQUAD *paltab); |
| Java | int vic.vic32jni.loadpngpalettefrombuffer(int buffer, RGBQUAD[] paltab); |
Function Arguments
| buffer | Buffer address |
| paltab | Address of RGBQUAD buffer for palette values |
Description
The loadpngpalettefrombuffer function loads the palette data from a memory
buffer holding PNG file data into paltable. Paltable must be an array of 256
RGBQUAD structures (1024 bytes). A PNG image may contain up to 256 colors.
When loading a PNG file, it is not necessary to call this function, because loadpngfrombuffer automatically loads any palette data available if the image descriptor member palette is nonzero.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient local memory |
| BAD_OPN | Memory handle not available |
| BAD_PNG | File is not a readable PNG format |
| BAD_PTR | Buffer points at unreadable memory |
loadtga
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadtga Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadtga Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadtga(ref string filename, ref imgdes resimg); |
| C/C++ | int loadtga(LPCSTR filename, imgdes *resimg); |
| Java | int vic.vic32jni.loadtga(String filename, imgdes resimg); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
Description
The loadtga function loads an image from a Targa True Color, color mapped, or grayscale image file into an area in an 8- or 24-bit image buffer. The image area is defined by the image descriptor. This function reads uncompressed or run length encoded 16-, 24-, or 32-bits per pixel true color images (types 2 and 10). 16- and 32-bit images are stored as 24-bit RGB images in the image buffer. Loadtga reads uncompressed (type 1 and 3) or run length encoded (type 9 and 11) 8-bit color mapped or grayscale images.
The TGA file header includes the image width and length. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller will be used.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Image is not 8- or 24-bit or image and file do not have compatible bits per pixel |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Filename not found |
| BAD_TGA | File is not a readable Targa format |
| BAD_CMP | Unreadable compression scheme |
See also
savetga, tgainfo
loadtgapalette
Function Prototypes
| Visual Basic | Declare Function loadtgapalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
| VB.NET | Declare Function vicwin.loadtgapalette Lib "VIC32.DLL" (ByVal filename As String, ByRef paltab As RGBQUAD) As Integer |
| C# | int vicwin.loadtgapalette(ref string filename, ref RGBQUAD paltab); |
| C/C++ | int loadtgapalette(LPCSTR filename, RGBQUAD *paltab); |
| Java | int vic.vic32jni.loadtgapalette(String filename, RGBQUAD[] paltab); |
Function Arguments
| filename | Filename to load |
| paltab | Address of RGBQUAD buffer for palette value |
Description
The loadtgapalette function loads the palette data from a palette color TGA image file into paltable. Paltable must be an array of 256 RGBQUAD structures (1024 bytes), since a TGA image may contain up to 256 colors.
When loading a TGA file, it is not necessary to call this function, because loadtga automatically loads any palette data available if the image descriptor member palette is nonzero.
Return value
| 0 - 256 | Number of palette colors read |
| BAD_MEM | Insufficient local memory |
| BAD_OPN | Filename not found |
| BAD_TIFF | File is not a readable Targa format |
loadtgawithalpha
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function loadtgawithalpha Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes, alphaimage as imgdes) As Long |
| VB.NET | Declare Function vicwin.loadtgawithalpha Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes, ByRef alphaimage As imgdes) As Integer |
| C# | int vicwin.loadtgawithalpha(ref string afilename, ref imgdes resimg, ref imgdes alphaimage); |
| C/C++ | int loadtgawithalpha(LPCSTR afilename, imgdes *resimg, imgdes *alphaimage); |
| Java | int vic.vic32jni.loadtgawithalpha(String filename, imgdes resimg, imgdes alphaimage); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
| alphaimage | Result image to hold alpha channel |
Description
The loadtgawithalpha function loads an image into an area in an image buffer
defined by the image descriptor resimg and an alpha channel image
into an area in an image buffer defined by the image descriptor alphaimage
from a TIFF file. The alphaimage
must describe an 8-bit image buffer to successfully receive the alpha channel
data.
Except for being able to load an alpha channel, if present, loadtgawithalpha is identical to the loadtga function.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient memory |
| BAD_BPP | resimg is not 8- or 24-bit, alphaimage is not 8-bit, or resimg and file are not compatible bits per pixel |
| BAD_OPN | Filename not found |
| BAD_TGA | File is not a readable TGA format |
| BAD_CMP | Unreadable compression scheme |
| TOO_CPLX | File data is too complex to read |
| LZW_DISABLED | LZW functionality not available, seeunlockLZW |
See also loadtga
loadtif
| 1 | 8 | 16 | 24 | 32 |
Function Prototypes
| Visual Basic | Declare Function loadtif Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadtif Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadtif(ref string filename, ref imgdes resimg); |
| C/C++ | int loadtif(LPCSTR filename, imgdes *resimg); |
| Java | int vic.vic32jni.loadtif(String filename, imgdes resimg); |
Function Arguments
| filename | Filename to load |
| resimg | Result image |
Description
The loadtif function loads an image from a bilevel, 8-, 16-, or 32-bit grayscale, palette color, CMYK, or RGB TIFF file into an area in an image buffer. The image area is defined by the image descriptor. Palette data, if present in the file, is loaded into the buffer defined by the image descriptor member palette. This function reads the formats shown in Table 7.
The TIFF file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used. Loadtif will enter into the image descriptor member colors the number of palette colors loaded. When a 4-bit TIFF file is it is expanded into an 8-bit image buffer and a 32-bit color file is placed into a 24-bit buffer. When a grayscale TIFF image is loaded, bit 0 of the image descriptor member imgtype is set to 1.
| Table 7. TIFF File formats Read by loadtif | ||
| Image type | Bits per pixel | Compression |
| Bilevel | 1 | none |
| 1 | PackBits | |
| 1 | LZW | |
| 1 | Group 3 | |
| 1 | Group 4 | |
| Grayscale or palette color | 4 through 8 | none |
| 4 | PackBits | |
| 8 | LZW | |
| 8 | PackBits | |
| 16 (grayscale) | none | |
| RGB | 24 | none |
| 24 | LZW | |
| 32 | none | |
| CMYK | 32 | none |
| 32 | LZW | |
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local or global memory |
| BAD_BPP | Image and file are not compatible bits per pixel |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Filename not found |
| BAD_TIFF | File is not a readable TIFF format |
| BAD_CMP | Unreadable compression scheme |
| TOO_CPLX | File data is too complex to read |
| LZW_DISABLED | LZW functionality locked, see unlockLZW |
See also
tiffinfo, savetif
loadtiffrombuffer
| 1 | 8 | 16 | 24 | 32 |
Function Prototypes
| Visual Basic | Declare Function loadtiffrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.loadtiffrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.loadtiffrombuffer(ref byte buffer_firstelem, ref imgdes resimg); |
| C/C++ | int loadtiffrombuffer(UCHAR *buffer, imgdes *resimg); |
| Java | int vic.vic32jni.loadtiffrombuffer(int buffer, imgdes resimg); |
Function Arguments
| buffer | Buffer address |
| resimg | Result image |
Description
The loadtiffrombuffer function loads TIFF file data from a memory buffer into
an area in an image buffer. The image area is defined by the image descriptor.
Palette data, if present in the file, is loaded into the buffer defined by the
image descriptor member palette. For a list of all the formats read by this
function refer to loadtif.
The TIFF file header includes the image dimensions. If these dimensions do not match the dimensions of the area defined by the image descriptor, the smaller of the two will be used. Loadtiffrombuffer will enter into the image descriptor member colors the number of palette colors loaded. When a 4-bit TIFF file is it is expanded into an 8-bit image buffer and a 32-bit color image is placed into a 24-bit buffer. When a grayscale TIFF image is loaded, bit 0 of the image descriptor member imgtype is set to 1.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error, see Appendix A |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient memory |
| BAD_BPP | Image and file are not compatible bits per pixel |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_OPN | Memory handle not available |
| BAD_TIFF | File is not a readable TIFF format |
| BAD_CMP | Unreadable compression scheme |
| TOO_CPLX | File data is too complex to read |
| LZW_DISABLED | LZW functionality not available, seeunlockLZW |
| BAD_PTR | Buff points at unreadable memory |
See also loadtif, tiffinfofrombuffer, savetiftobuffer
loadtifpage
| 1 | 8 | 16 | 24 | 32 |
Function Prototypes
| Visual Basic | Declare Function loadtifpage Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes, ByVal page As Long) As Long |
| VB.NET | Declare Function vicwin.loadtifpage Lib "VIC32.DLL" (ByVal filename As String, ByRef resimg As imgdes, ByVal page As Integer) As Integer |
| C# | int vicwin.loadtifpage(ref string filename, ref imgdes resimg, int page); |