8 | 24 |
Function Prototypes
Visual Basic | Declare Function limitlevel Lib "VIC32.DLL" (ByVal limit As Long, srcimg As imgdes, resimg As imgdes) As Long |
C/C++ | int limitlevel(const 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.
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 |
8 |
Function Prototypes
Visual Basic | Declare Function loadbif Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
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 |
1 | 8 | 24 |
Function Prototypes
Visual Basic | Declare Function loadbmp Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
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
1 | 8 | 24 |
Function Prototypes
Visual Basic | Declare Function loadbmpfrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, resimg As imgdes) As Long |
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 |
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
Function Prototypes
Visual Basic | Declare Function loadbmppalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
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 |
Function Prototypes
Visual Basic | Declare Function loadbmppalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, paltab As RGBQUAD) As Long |
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 |
1 | 8 |
Function Prototypes
Visual Basic | Declare Function loadgif Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
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.
Before making the first call to loadgif in an application, unlockLZW should be called to unable reading LZW-compressed files. Otherwise loadgif will only read uncompressed GIF files.
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.
An attempt to load an LZW-compressed file will return the error code LZW_DISABLED unless LZW functionality has been enabled with unlockLZW. The use of LZW compression requires an LZW license from Unisys Corporation. For information concerning licensing the LZW compression and/or decompression capability, please contact:
Unisys Corporation, Welch Licensing Department - C1SW19, Township Line & Union Meeting Roads, P O Box 500, Blue Bell PA 19424.
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
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 |
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
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 |
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
1 | 8 |
Function Prototypes
Visual Basic | Declare Function loadgiffrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, resimg As imgdes) As Long |
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.
Before making the first call to loadgiffrombuffer, unlockLZW should be called to enable reading LZW-compressed files. Otherwise loadgif will only read uncompressed GIF files.
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.
An attempt to load an image from LZW-compressed file data will return the error code LZW_DISABLED unless LZW functionality has been enabled with unlockLZW. The use of LZW compression requires an LZW license from Unisys Corporation. For information concerning licensing the LZW compression and/or decompression capability, please contact: Unisys Corporation, Welch Licensing Department - C1SW19, Township Line & Union Meeting Roads, P O Box 500, Blue Bell PA 19424, www.unisys.com.
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
Function Prototypes
Visual Basic | Declare Function loadgifpalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
C/C++ | 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 |
Function Prototypes
Visual Basic | Declare Function loadgifframepalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD, ByVal framenumber As Long) As Long |
C/C++ | 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 |
Function Prototypes
Visual Basic | Declare Function loadgifframepalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, paltab As RGBQUAD, ByVal framenumber As Long) As Long |
C/C++ | 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 |
Function Prototypes
Visual Basic | Declare Function loadgifglobalpalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
C/C++ | int loadgifglobalpalette(LPCSTR filename, RGBQUAD far *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 |
Function Prototypes
Visual Basic | Declare Function loadgifglobalpalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, paltab As RGBQUAD) As Long |
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 |
Function Prototypes
Visual Basic | Declare Function loadgifpalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, paltab As RGBQUAD) As Long |
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 |
8 | 24 |
Function Prototypes
Visual Basic | Declare Function Declare Function loadjpg Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
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
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 |
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
8 | 24 |
Function Prototypes
Visual Basic | Declare Function loadjpgfrombuffer Lib "VIC32.DLL" (ByVal buffer as Long, resimg As imgdes) As Long |
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
8 | 24 |
Function Prototypes
Visual Basic | Declare Function loadjpgfrombufferex Lib "VIC32.DLL" (ByVal BuffAddr as Long, resimg As imgdes, ByVal mode as long) As Long |
C/C++ | int loadjpgfrombufferex(UCHAR *buffer, imgdes *resimg, int mode); |
Java | int vic.vic32jni.loadjpgfrombufferex(int buffaddr, 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
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 |
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
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 |
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
1 | 8 | 24 |
Function Prototypes
Visual Basic | Declare Function loadpcx Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
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
Function Prototypes
Visual Basic | Declare Function loadpcxpalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
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 |
1 | 8 | 24 |
Function Prototypes
Visual Basic | Declare Function loadpng Lib "VIC32.DLL" (ByVal filename As String, image As imgdes) As Long |
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
1 | 8 | 24 |
Function Prototypes
Visual Basic | Declare Function loadpngfrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, resimg As imgdes) As Long |
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
Function Prototypes
Visual Basic | Declare Function loadpngpalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
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 |
Function Prototypes
Visual Basic | Declare Function loadpngpalettefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, paltab As RGBQUAD) As Long |
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 |
8 | 24 |
Function Prototypes
Visual Basic | Declare Function loadtga Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
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
Function Prototypes
Visual Basic | Declare Function loadtgapalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
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 |
8 | 24 |
Function Prototypes
Visual Basic | Declare Function loadtgawithalpha Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes, alphaimage as imgdes) As Long |
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 mainimage 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 | Mainimage is not 8- or 24-bit, alphaimage is not 8-bit, or mainimage 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
1 | 8 | 16 | 24 |
Function Prototypes
Visual Basic | Declare Function loadtif Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes) As Long |
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- or 16-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 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.
An attempt to load an LZW-compressed TIFF image will return the error code
LZW_DISABLED unless LZW functionality has been enabled with unlockLZW. The use
of LZW compression requires an LZW license from Unisys Corporation. For
information concerning licensing the LZW compression and/or decompression
capability, please contact:
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 is not 1-, 8-, 16-, 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_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
1 | 8 | 16 | 24 |
Function Prototypes
Visual Basic | Declare Function loadtiffrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, resimg As imgdes) As Long |
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 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.
An attempt to load an LZW-compressed TIFF image will return the error code LZW_DISABLED unlessLZW functionality has been enabled with unlockLZW. The use of LZW compression requires an LZW license from Unisys Corporation. For information concerning licensing the LZW compression/decompression capability, please contact: Unisys Corporation, Welch Licensing Department - C1SW19 Township Line & Union Meeting Roads, P O Box 500, Blue Bell PA 19424, www.unisys.com.
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-, 16-, 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_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
1 | 8 | 16 | 24 |
Function Prototypes
Visual Basic | Declare Function loadtifpage Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes, ByVal page As Long) As Long |
C/C++ | int loadtifpage(LPCSTR filename, imgdes *resimg, int page); |
Java | int vic.loadtifpage(String filename, imgdes resimg, int page); |
Function Arguments
filename | Filename to load |
resimg | Result image |
page | page number of page to load |
Description
The loadtifpagebyindex function loads an image from a single or multipage TIFF file into an area in an image buffer. The image area is defined by the image descriptor. The page to load is specified by the tiffPage parameter.
Use loadtifpagebyindex to load an image based on its position in the file. Use loadtifpage to load an image based on the value contained in the page number tag.
Except for being able to load a specific image from a multipage TIFF file, loadtifpagebyindex is identical to the loadtif function.
To determine the number of pages and their page numbers in a multipage TIFF file, use the tiffgetpageinfo function.
Return value
NO_ERROR | Function successful |
BAD_RANGE | Range error, see Appendix A |
BAD_IBUF | Invalid image buffer address |
BAD_BPP | Image is not 1-, 8-, 16-, or 24-bit or image and file do not have compatible bits per pixel |
BAD_MEM | Insufficient local memory |
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 |
TIFF_NOPAGE | TIFF page not found and tiffPage is not -1 |
LZW_DISABLED | LZW functionality not available, see unlockLZW |
See also
loadtif, tiffgetpageinfo, tiffinfopage
1 | 8 | 16 | 24 |
Function Prototypes
Visual Basic | Declare Function loadtifpagebyindex Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes, ByVal pageIndex As Long) As Long |
C/C++ | int loadtifpagebyindex(LPCSTR filename, imgdes *resimg, int pageIndex); |
Java | int vic.vic32jni.loadtifpagebyindex(String filename, imgdes resimg, int pageIndex); |
Function Arguments
filename | Filename to load |
resimg | Result image |
pageIndex | Index of target page to load (0 based) |
Description
The loadtifpagebyindex function loads an image from a single or multipage TIFF
file into an area in an image buffer.
The image area is defined by the image descriptor.
The page to load is specified by the pageIndex parameter,
which is zero-based.
Use loadtifpagebyindex to load an image based on its position in the file. Use loadtifpage to load an image based on its page number tag.
Except for being able to load a specific image from a multipage TIFF file, loadtifpagebyindex is identical to the loadtif function.
To determine the number of pages and their page numbers in a multipage TIFF file, use the tiffgetpageinfo 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-, 8-, 16-, 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_TIFF | File is not a readable TIFF format |
BAD_CMP | Unreadable compression scheme |
TOO_CPLX | File data is too complex to read |
TIFF_NOPAGE | TIFF page not found and pageIndex is not -1 |
LZW_DISABLED | LZW functionality not available, seeunlockLZW |
See also loadtif, loadtifpage, tiffgetpageinfo, tiffinfopagebyindex
1 | 8 | 16 | 24 |
Function Prototypes
Visual Basic | Declare Function loadtifpagebyindexfrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, resimg As imgdes, ByVal pageIndex As Long) As Long |
C/C++ | int loadtifpagebyindexfrombuffer(UCHAR *buffer, imgdes *resimg, int pageIndex); |
Java | int vic.vic32jni.loadtifpagebyindexfrombuffer(int buffer, imgdes resimg, int pageIndex); |
Function Arguments
buffer | Buffer address |
resimg | Result image |
pageIndex | Index of target page to load (0 based) |
Description
The loadtifpagebyindexfrombuffer function loads an image from a single or multipage TIFF
file into an area in an image buffer.
The image area is defined by the image descriptor.
The page to load is specified by the pageIndex parameter,
which is zero-based.
Use loadtifpagebyindexfrombuffer to load an image based on its position in the file.
Except for being able to load a specific image from a multipage TIFF file, loadtifpagebyindexfrombuffer is identical to the loadtif function.
To determine the number of pages and their page numbers in a multipage TIFF file, use the tiffgetpageinfofrombuffer 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-, 8-, 16-, 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_TIFF | File is not a readable TIFF format |
BAD_CMP | Unreadable compression scheme |
TOO_CPLX | File data is too complex to read |
TIFF_NOPAGE | TIFF page not found and pageIndex is not -1 |
LZW_DISABLED | LZW functionality not available, seeunlockLZW |
See also loadtif, loadtifpagebyindex, tiffgetpageinfo, tiffinfopagebyindex
Function Prototypes
Visual Basic | Declare Function loadtifpalette Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD) As Long |
C/C++ | int loadtifpalette(LPCSTR filename, RGBQUAD *paltab); |
Java | int vic.vic32jni.loadtifpalette(String filename, RGBQUAD[] paltab); |
Function Arguments
filename | Filename to load |
paltab | Address of RGBQUAD buffer for palette values |
Description
The loadtifpalette function loads the palette data from a palette color TIFF image file into paltab. Paltab must be an array of 256 RGBQUAD structures (1024 bytes), since a TIFF image may contain up to 256 colors.
When loading a TIFF file, it is not necessary to call this function, because loadtif 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 TIFF format |
Function Prototypes
Visual Basic | Declare Function loadtifpalettefrombuffer Lib "VIC32.DLL" (ByVal buff As Long, paltab As RGBQUAD) As Long |
C/C++ | int loadtifpalettefrombuffer(UCHAR *buffer, RGBQUAD *paltab); |
Java | int vic.vic32jni.loadtifpalettefrombuffer(int buffaddr, RGBQUAD[] paltab); |
Function Arguments
buffer | Buffer address |
paltab | Address of RGBQUAD buffer for palette values |
Description
The loadtifpalettefrombuffer function loads the palette data from a memory
buffer holding TIFF file data into paltab. Paltab must be an array of 256
RGBQUAD structures (1024 bytes), since a TIFF image may contain up to 256
colors.
When loading a TIFF file, it is not necessary to call this function, because loadtiffrombuffer 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_TIFF | File is not a readable TIFF format |
BAD_PTR | Buff points at unreadable memory |
Function Prototypes
Visual Basic | Declare Function loadtifpalettepage Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD, ByVal page As Long) As Long |
C/C++ | int loadtifpalettepage(LPCSTR filename, RGBQUAD *paltab, int page); |
Java | int vic.vic32jni.loadtifpalettepage(String filename, RGBQUAD[] paltab, int page); |
Function Arguments
filename | Filename to load |
paltab | Address of RGBQUAD buffer for palette values |
page | Page number from which to load the palette |
Description
The loadtifpalettepage function loads the palette data from a specified page in a palette color TIFF image file into paltable. Paltable must be an array of 256 RGBQUAD structures (1024 bytes), since a TIFF image may contain up to 256 colors. When loading a TIFF image, it is not necessary to call this function, because loadtifpage 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 TIFF format |
TIFF_NOPAGE | TIFF page not found and tiffPage is not -1 |
Function Prototypes
Visual Basic | Declare Function loadtifpalettepagebyindex Lib "VIC32.DLL" (ByVal filename As String, paltab As RGBQUAD, ByVal pageIndex As Long) As Long |
C/C++ | int loadtifpalettepagebyindex(LPCSTR filename, RGBQUAD *paltab, int pageIndex); |
Java | int vic.vic32jni.loadtifpalettepagebyindex(String filename, RGBQUAD[] paltab, int pageIndex); |
Function Arguments
filename | Filename to load |
paltab | Address of RGBQUAD buffer for palette values |
pageIndex | Index of page from which to load the palette (0 based) |
Description
The loadtifpalettepagebyindex function loads the palette data from a specified
page in a palette color TIFF image file into paltable. Paltable must be an
array of 256 RGBQUAD structures (1024 bytes), since a TIFF image may contain up
to 256 colors.
Use loadtifpalettepagebyindex to load an image palette based on its position in the file. Use loadtifpalettepage to load an image palette based on its page number tag.
When loading a TIFF image, it is not necessary to call this function, because loadtifpagebyindex 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_TIFF | File is not a readable TIFF format |
TIFF_NOPAGE | TIFF page not found and pageIndex is not -1 |
See also
loadtifpalette, loadtifpalettepage
1 | 8 | 16 | 24 |
Function Prototypes
Visual Basic | Declare Function loadtifwithalpha Lib "VIC32.DLL" (ByVal filename As String, resimg As imgdes, alphaimage as imgdes) As Long |
C/C++ | int loadtifwithalpha(LPCSTR afilename, imgdes *resimg, imgdes *alphaimage); |
Java | int vic.vic32jni.loadtifwithalpha(String filename, imgdes resimg, imgdes alphaimage); |
Function Arguments
filename | Filename to load |
resimg | Result image |
alphaimage | Result image to hold alpha channel |
Description
The loadtifwithalpha function loads an image into an area in an image buffer
defined by the image descriptor mainimage 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, loadtifwithalpha is identical to the loadtif 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 | Mainimage is not 1-, 8-, 16-, or 24-bit, alphaimage is not 8-bit, or mainimage and file are not compatible bits per pixel |
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 not available, seeunlockLZW |
See also loadtif
8 | 24 |
Function Prototypes
Visual Basic | Declare Function matchcolorimage Lib "VIC32.DLL" (srcimg As imgdes, resimg As imgdes) As Long |
C/C++ | int matchcolorimage(imgdes *srcimg, imgdes *resimg); |
Java | int vic.vic32jni.matchcolorimage(imgdes srcimg, imgdes resimg); |
Function Arguments
srcimg | Source image |
resimg | Result image |
Description
The matchcolorimage function assigns the pixel values of the result image based on the colors and palette of the 8- or 24-bit source image to match the palette of the 8-bit result image. The source and result image areas are defined by the image descriptors.
This function can be used several ways:
Matchcolorimage uses an octree method to assign palette colors to pixels. Diffusion scatter is used to improve the quality of the result image. (See matchcolorimageex for additional information.)
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 | Source not 8- or 24-bit, or result not 8-bit |
BAD_DIB | Source or result is a compressed DIB |
Example
See matchcolorimageex
8 | 24 |
Function Prototypes
Visual Basic | Declare Function matchcolorimageex Lib "VIC32.DLL" (srcimg As imgdes, resimg As imgdes, ByVal mode As Long) As Long |
C/C++ | int matchcolorimageex(imgdes *srcimg, imgdes *resimg, int mode); |
Java | int vic.vic32jni.matchcolorimageex(imgdes srcimg, imgdes resimg, int mode); |
Function Arguments
srcimg | Source image |
resimg | Result image |
mode | Color matching mode to use |
Description
The matchcolorimageex function assigns the pixel values of the result image based on the colors and palette of the 8- or 24-bit source image to match the palette of the 8-bit result image. The source and result image areas are defined by the image descriptors. This function can be used several ways:
The colmatchmode parameter determines the mode to be used for the assignment of palette colors to pixels:
Table 8. Matchcolorimageex Options | ||||
Mode | Speed | Image quality | Color matching method | Use diffusion? |
CR_OCTREENODIFF | fastest | good | Octree | no |
CR_OCTREEDIFF1 | faster | better | Octree | yes |
CR_TSDNODIFF | faster | better | TSD2 | no |
CR_TSDDIFF | fast | best | TSD2 | yes |
In general, there is a trade-off of speed for quality, mode CR_TSDDIFF gives the best color matching but takes the longest time.
Matchcolorimageex uses either an octree or a through-space-distance (TSD) method to map a pixel to a palette color. The octree method uses an octree to select the palette color, while the TSD method calculates the minimum distance in 3-D RGB space to select the palette color. The TSD method provides a more accurate color match but also takes a little longer.
Matchcolorimageex can also use error diffusion. Error diffusion creates a higher quality image by distributing a pixel's error to its nearest neighbors. Error diffusion should not be used if an image will be sharpened or processed with convolution.
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 | Source is not 8- or 24-bit or result is not 8-bit |
BAD_DIB | Source or result is a compressed DIB |
BAD_FAC | colmatchmode not 0 through 3 |
See also
matchcolorimage
Example C/C++ Example 1 | Example C/C++ Example 2
8 | 24 |
Function Prototypes
Visual Basic | Declare Function matrixconv Lib "VIC32.DLL" (kernel As Byte, srcimg As imgdes, resimg As imgdes) As Long |
C/C++ | int matrixconv(LPCSTR kernel, imgdes *srcimg, imgdes *resimg); |
Java | int vic.vic32jni.matrixconv(byte[] kernel, imgdes srcimg, imgdes resimg); |
Function Arguments
kernel | Convolution matrix |
srcimg | Source image |
resimg | Result image |
Description
The matrixconv function transforms an image area with a 3 x 3 convolution matrix. The source and result image areas are defined by the corresponding image descriptors.
n1 | n2 | n3 |
n4 | n5 | n6 |
n7 | n8 | n9 |
For a source pixel at position (x,y), the corresponding result pixel will have a brightness value calculated as follows:
Result[x,y] = ( | n1 * Source[x-1,y-1] + n2 * Source[x,y-1] + n3 * Source[x+1,y-1] + |
n4 * Source[x-1,y] + n5 * Source[x,y] + n6 * Source[x+1,y] + | |
n7 * Source[x-1,y+1]+ n8 * Source[x,y+1] + n9 * Source[x+1,y+1] | |
) | / n10 |
The function argument kernel is a 10-member array whose elements can range from -127 to 127. The first 9 members are the numerators and the 10th array member is the divisor. For example, to duplicate the blur function you would use the matrix:
1/9 | 1/9 | 1/9 |
1/9 | 1/9 | 1/9 |
1/9 | 1/9 | 1/9 |
by defining the array and calling the function:
char kernel[] = {1,1,1,1,1,1,1,1,1,9 }; matrixconv(kernel, &srcimg, &resimg);
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 | Attempted division by 0 (i.e., 10th element of kernel is 0) |
8 | 24 |
Function Prototypes
Visual Basic | Declare Function matrixconvex Lib "VIC32.DLL" (ByVal ksize As Long, ByRef kernel As byte, ByVal divsr As Long, srcimg As imgdes, resimg As imgdes) As Long |
C/C++ | int matrixconvex(int ksize, LPCSTR kernel, int divsr, imgdes *srcimg, imgdes *resimg); |
Java | int vic.vic32jni.matrixconvex(int ksize, byte[] kernel, int divsr, imgdes srcimg, imgdes resimg); |
Function Arguments
ksize | Width of local area (3 - 63) |
kernel | Convolution matrix |
divsr | Divisor |
srcimg | Source image |
resimg | Result image |
Description
The matrixconvex function transforms an image area with a ksize x ksize
convolution matrix. The source and result image areas are defined by the
corresponding image descriptors.
For more information about matrix convolution, see the matrixconv function.
The function argument kernel is a ksize x ksize array whose elements can range from -127 to 127. Ksize must be in the range 3 to 63. This function differs from matrixconv in that matrixconvex allows using a ksize greater than 3 and the divisor value is not the last element of the kernel array.
As an example, to duplicate the blur function use the kernel:
1/9 | 1/9 | 1/9 |
1/9 | 1/9 | 1/9 |
1/9 | 1/9 | 1/9 |
by defining the array:
char kernel[9] = {1,1,1,1,1,1,1,1,1};
and calling the function:
matrixconvex(3, kernel, 9, &srcimg, &resimg);
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 | Images are not both 8- or 24-bit |
BAD_DIB | Source or result is a compressed DIB |
BAD_FAC | Divisor value is zero or ksize not 3 to 63 |
See also
matrixconv
8 | 24 |
Function Prototypes
Visual Basic | Declare Function medianfilter Lib "VIC32.DLL" (ByVal ksize As Long, srcimg As imgdes, resimg As imgdes) As Long |
C/C++ | int medianfilter(int ksize, imgdes *srcimg, imgdes *resimg); |
Java | int vic.vic32jni.medianfilter(int ksize, imgdes srcimg, imgdes resimg); |
Function Arguments
ksize | Width of local area (3 - 11) |
srcimg | Source image |
resimg | Result image |
Description
The medianfilter function removes random noise from an image area by replacing
a central pixel value with the median of its local area. The local area size is
defined as ksize x ksize pixels.
The source and result image areas are defined by the corresponding image descriptors.
The medianfilter function is identical to the removenoise function if ksize equals 3.
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 | Images are not both 8- or 24-bit |
BAD_DIB | Source or result is a compressed DIB |
BAD_FAC | Ksize not 3 to 11 |
See also removenoise
1 | 8 | 24 |
Function Prototypes
Visual Basic | Declare Function mirrorimage Lib "VIC32.DLL" (srcimg As imgdes, resimg As imgdes) As Long |
C/C++ | int mirrorimage(imgdes *srcimg, imgdes *resimg); |
Java | int vic.vic32jni.mirrorimage(imgdes srcimg, imgdes resimg); |
Function Arguments
srcimg | Source image |
resimg | Result image |
Description
The mirrorimage function reverses an image area left to right to create a mirror image. 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 1-, 8-, or 24-bit |
BAD_DIB | Source or result is a compressed DIB |
8 | 24 |
Function Prototypes
Visual Basic | Declare Function multiply Lib "VIC32.DLL" (ByVal multiplier As Long, srcimg As imgdes, resimg As imgdes) As Long |
C/C++ | int multiply(int multiplier, imgdes *srcimg, imgdes *resimg); |
Java | int vic.vic32jni.multiply(int multiplier, imgdes srcimg, imgdes resimg); |
Function Arguments
multiplier | Multiplier (0 - 255) |
srcimg | Source image |
resimg | Result image |
Description
The multiply function increases the brightness of each pixel in the source image area by multiplying the level value by a factor and placing the product in the result image area.
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 | Multiplier is outside the range 0 to 255 |
8 | 24 |
Function Prototypes
Visual Basic | Declare Function multiplyimage Lib "VIC32.DLL" (srcimg As imgdes, oprimg As imgdes, resimg As imgdes) As Long |
C/C++ | int multiplyimage(imgdes *srcimg, imgdes *oprimg, imgdes *resimg); |
Java | int vic.vic32jni.multiplyimage(imgdes srcimg, imgdes oprimg, imgdes resimg); |
Function Arguments
srcimg | Source image |
oprimg | Operator image |
resimg | Result image |
Description
The multiplyimage function multiplies the value of each pixel in the source image area with the value of the corresponding pixel in the operator image, scales the value, and places the result in the result image area.
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 | Multiplier is outside the range 0 to 255 |
1 | 8 | 24 |
Function Prototypes
Visual Basic | Declare Function negative Lib "VIC32.DLL" (srcimg As imgdes, resimg As imgdes) As Long |
C/C++ | int negative(imgdes *srcimg, imgdes *resimg); |
Java | int vic.vic32jni.negative(imgdes srcimg, imgdes resimg); |
Function Arguments
srcimg | Source image |
resimg | Result image |
Description
The negative function modifies the pixels in an image area to create an effect similar to a photographic negative.
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 1-, 8-, or 24-bit |
BAD_DIB | Source or result is a compressed DIB |
1 | 8 | 24 |
Function Prototypes
Visual Basic | Declare Function orimage Lib "VIC32.DLL" (srcimg As imgdes, oprimg As imgdes, resimg As imgdes) As Long |
C/C++ | int orimage(imgdes *srcimg, imgdes *oprimg, imgdes *resimg); |
Java | int vic.vic32jni.orimage(imgdes srcimg, imgdes oprimg, imgdes resimg); |
Function Arguments
srcimg | Source image |
oprimg | Operator image |
resimg | Result image |
Description
The orimage function ORs the value of each pixel in the source image area with the value of the corresponding pixel in the operator image and places the result in the result image area.
The 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 all 1-, 8-, or 24-bit |
BAD_DIB | Image is a compressed DIB |
8 | 24 |
Function Prototypes
Visual Basic | Declare Function outline Lib "VIC32.DLL" (srcimg As imgdes, resimg As imgdes) As Long |
C/C++ | int outline(imgdes *srcimg, imgdes *resimg); |
Java | int vic.vic32jni.outline(imgdes srcimg, imgdes resimg); |
Function Arguments
srcimg | Source image |
resimg | Result image |
Description
The outline function creates an outline within an image area. This function is an edge detection filter. The brightness of the resulting pixels is proportional to the magnitude of the brightness difference between adjacent pixels. The source and result image areas are defined by the corresponding image descriptors.
This function transforms an image area with a 3 x 3 convolution matrix.
-1 | -1 | -1 |
-1 | 8 | -1 |
-1 | -1 | -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 | Images are not both 8- or 24-bit |
BAD_DIB | Source or result is a compressed DIB |