darker
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function darker Lib "VICFX.DLL" (srcimg As imgdes, oprimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.darker Lib "VICFX.DLL" (ByRef srcimg As imgdes, ByRef oprimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.darker(ref imgdes srcimg, ref imgdes oprimg, ref imgdes resimg); |
| C/C++ | int darker(imgdes *srcimg, imgdes *oprimg, imgdes *resimg); |
| Java | int vic.vic32jni.darker(imgdes srcimg,imgdes oprimg, imgdes resimg); |
Function Arguments
| srcimg | Source image |
| oprimg | Operator image |
| resimg | Result image |
Description
The darker function places the darker 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 |
ddbtoimage
| 1 | 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function ddbtoimage Lib "VIC32.DLL" (ByVal hbitmap As Long, ByVal hpal As Long, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.ddbtoimage Lib "VIC32.DLL" (ByVal hBitmap As Integer, ByVal hPal As Integer, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.ddbtoimage(int hbitmap, int hPal, ref imgdes resimg); |
| C/C++ | int ddbtoimage(HBITMAP hbitmap, HPALETTE hPal, imgdes *resimg); |
| Java | int vic.vic32jni.ddbtoimage(int hbitmap, int hPal, imgdes resimg); |
Function Arguments
| hbitmap | Device dependent bitmap handle |
| hPal | Palette handle or NULL |
| resimg | Result image |
Description
The ddbtoimage function creates a Victor-compatible image from a
device dependent bitmap and palette. If hPal is NULL the Windows
default palette will be used. If the function is successful
the image descriptor resimg is filled in.
Ddbtoimage allocates memory to hold the image, so freeimage must be called when this memory is no longer needed.
Return value
| NO_ERROR | Function successful |
| BAD_MEM | Insufficient memory |
| BAD_HANDLE | Invalid bitmap handle |
See also
dibtoimage
defaultpalette
| 8 |
Function Prototypes
| Visual Basic | Declare Function defaultpalette Lib "VIC32.DLL" (resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.defaultpalette Lib "VIC32.DLL" (ByRef resimg As imgdes) As Integer |
| C# | int vicwin.defaultpalette(ref imgdes resimg); |
| C/C++ | int defaultpalette(imgdes *resimg); |
| Java | int vic.vic32jni.defaultpalette(imgdes resimg); |
Function Arguments
| resimg | Image which is to receive the new palette |
Description
The defaultpalette function creates a 16-color palette consisting of the Windows default (or static) colors. This palette is stored in the palette location defined in the image descriptor element palette. The red, green, and blue contributions for each color are shown in Table 6. The function enters 16 into the image descriptor element colors. Defaultpalette is for use with 8-bit images. Defaultpalette creates an all-purpose palette for displaying color images. It can be used with matchcolorimage to force an 8-or 24-bit image to use a standard palette. When limited to using 16 colors use defaultpalette with matchcolorimage to display a 24-bit RGB image as an 8-bit palette color image and to display multiple 8-bit images using the same palette.
| Table 6. The 16-color Default Palette | |||
| Color number |
Red |
Green |
Blue |
|
0 |
0 |
0 | 0 |
| 1 | 128 | 0 | 0 |
| 2 | 0 | 0 | 128 |
| 3 | 128 | 0 | 128 |
| 4 | 0 | 128 | 0 |
| 5 | 128 | 128 | 0 |
| 6 | 0 | 128 | 128 |
| 7 | 192 | 192 | 192 |
| 8 | 128 | 128 | 128 |
| 9 | 255 | 0 | 0 |
| 10 | 0 | 0 | 255 |
| 11 | 255 | 0 | 255 |
| 12 | 0 | 255 | 0 |
| 13 | 255 | 255 | 0 |
| 14 | 0 | 255 | 255 |
| 15 | 255 | 255 | 255 |
Return value
Returns number of colors placed in the palette, 0 - 16.
See also
rainbowpalette
dibsecttoimage
| 1 | 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function dibsecttoimage Lib "VIC32.DLL" (ByVal hBitmap As Long, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.dibsecttoimage Lib "VIC32.DLL" (ByVal hBitmap As Integer, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.dibsecttoimage(int hBitmap, ref imgdes resimg); |
| C/C++ | int dibsecttoimage(HBITMAP hBitmap, imgdes *resimg); |
| Java | int vic.vic32jni.dibsecttoimage(int hBitmap, imgdes resimg); |
Function Arguments
| hBitmap | DIB section handle |
| resimg | Result image |
Description
The dibsecttoimage function creates a Victor-compatible image from a DIB-section
(WIN32 device independent bitmap). This function is useful when a DIB is imported
from another source to allow Victor functions to operate on it.
Although Windows allows the palette data of a DIB to be indexes into the currently realized logical palette, dibsecttoimage assumes explicit RGB values. If the function is successful the image descriptor resimg is filled in.
Dibsecttoimage allocates memory to hold the image, so freeimage must be called when this memory is no longer needed. Dibsecttoimage is available only in the Victor Library for 32-bit Windows, excluding Windows NT versions earlier than 3.51.
Return value
| NO_ERROR | Function successful |
| BAD_MEM | Insufficient memory |
| BAD_HANDLE | HBitmap is not a DIB section bitmap handle |
| BAD_DIB | DIB is compressed |
| BAD_BPP | Bits per pixel is not 1, 8, or 24 |
See also
dibtoimage
dibtobitmap
Function Prototypes
| Visual Basic | Declare Function dibtobitmap Lib "VIC32.DLL" (ByVal hdc As Long, ByVal dib As Long, hBitmap As Long) As Long |
| VB.NET | gvicwin.dibtobitmap Lib "VIC32.DLL" (ByVal hdc As Integer, ByVal dib As Integer, ByRef hBitmap As Integer) As Integer |
| C# | int vicwin.dibtobitmap(int hdc, int dib, ref int hBitmap); |
| C/C++ | int dibtobitmap(HDC hdc, byte *dib, HBITMAP *hBitmap); |
| Java | int vic.vic32jni.dibtobitmap(int hdc, int dib, refvar hBitmap); |
Function Arguments
| hdc | Device context handle |
| dib | Address of packed DIB |
| hBitmap | Bitmap handle to be filled in |
Description
The dibtobitmap function creates a device dependent bitmap based on an existing packed device independent bitmap (DIB). In the Victor Library for 32-bit Windows this function is generally unneeded because the allocimage function enters a handle to a bitmap in the image descriptor element hBitmap. If dibtobitmap must be used, then the original DIB must be allocated with the allocdib function instead of allocimage.
Although Windows allows the palette data of a DIB to be indexes into the currently realized logical palette, dibtobitmap assumes explicit RGB values, not palette indexes.
If the function successfully creates the device dependent bitmap, the bitmap handle is placed in the hBitmap variable. This handle must be released with the Windows DeleteObject function when no longer needed.
Return value
| NO_ERROR | Function successful |
| BAD_MEM | Insufficient global memory |
See also
Converting a Victor Image to a Device Dependent Bitmap, in the Victor User's Guide.
dibtoimage
| Visual Basic | Declare Function dibtoimage Lib "VIC32.DLL" (ByVal dib As Long, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.dibtoimage Lib "VIC32.DLL" (ByVal dib As Integer, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.dibtoimage(int dib, ref imgdes resimg); |
| C/C++ | int dibtoimage(UCHAR *dib, imgdes *resimg); |
| Java | int vic.vic32jni.dibtoimage(int dib, imgdes resimg); |
Function Arguments
| dib | Address of source packed dib |
| resimg | Result image |
Description
The dibtoimage function creates a Victor-compatible image from a source packed device independent bitmap (DIB). This function is useful when a DIB is imported from the clipboard or other source, to allow Victor functions to operate on it.
Although Windows allows the palette data of a DIB to be indexes into the currently realized logical palette, dibtoimage assumes explicit RGB values.
If the function is successful the image descriptor resimg is filled in.
Note: this function allocates global memory to hold the image, this memory must be released with freeimage when no longer needed.
Return value
| NO_ERROR | Function successful |
| BAD_BPP | Bits per pixel of DIB not 1, 4, 8, 16, 24, or 32 |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient global memory |
| BAD_LOCK | Global memory could not be locked |
| BAD_CMP | Unreadable compression scheme |
See also
setupimgdes
difference
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function difference Lib "VICFX.DLL" (srcimg As imgdes, oprimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.difference Lib "VICFX.DLL" (ByRef srcimg As imgdes, ByRef oprimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.difference(ref imgdes srcimg, ref imgdes oprimg, ref imgdes resimg); |
| C/C++ | int difference(imgdes *srcimg, imgdes *oprimg, imgdes *resimg); |
| Java | int vic.vic32jni.difference(imgdes srcimg,imgdes oprimg, imgdes resimg); |
Function Arguments
| srcimg | Source image |
| oprimg | Operator image |
| resimg | Result image |
Description
The difference function subtracts the brightness level of each pixel in the operator image area from the brightness level of the corresponding pixel in the source image area, adds 128, and places the resulting value in the result image area. Result values greater than 255 are set to 255. Result values less than zero are set to zero.
-
Result = Source - Operator + 128
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 |
differenceabs
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function differenceabs Lib "VICFX.DLL" (srcimg As imgdes, oprimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.differenceabs Lib "VICFX.DLL" (ByRef srcimg As imgdes, ByRef oprimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.differenceabs(ref imgdes srcimg, ref imgdes oprimg, ref imgdes resimg); |
| C/C++ | int differenceabs(imgdes *srcimg, imgdes *oprimg, imgdes *resimg); |
| Java | int vic.vic32jni.differenceabs(imgdes srcimg,imgdes oprimg, imgdes resimg); |
Function Arguments
| srcimg | Source image |
| oprimg | Operator image |
| resimg | Result image |
Description
The differenceabs function subtracts the brightness level of each pixel in the operator image area from the brightness level of the corresponding pixel in the source image area and places the absolute value of the difference in the result image area. Result values greater than 255 are set to 255. Result values less than zero are set to zero.
-
Result = | Source - 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 |
dilate
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function dilate Lib "VIC32.DLL" (ByVal amount As Long, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.dilate Lib "VIC32.DLL" (ByVal amount As Integer, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.dilate(int amount, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int dilate(int amount, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.dilate(int amount, imgdes srcimg, imgdes resimg); |
Function Arguments
| amount | Amount of dilation (0 - 255) |
| srcimg | Source image |
| resimg | Result image |
Description
The dilate function darkens an image area by enlarging the dark regions of the image.
The variable amount determines the extent of the darkening. Maximum dilation is obtained
when amount set to 255 and no dilation occurs if amount is set to zero.
If the average brightness of a pixel's 3 x 3 local area
is darker than amount, the pixel is replaced by its darkest neighbor.
-
If 3 x 3 local area average brightness < amount
then Result = darkest pixel in 3 x 3 area
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error (see Appendix A) or image area is less than 3 x 3 pixels |
| 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 | Amount is outside range of 0 - 255 |
displace
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function displace Lib "VIC32.DLL" (ByVal tile As Long, srcimg As imgdes, oprimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.displace Lib "VIC32.DLL" (ByVal tile As Integer, ByRef srcimg As imgdes, ByRef oprimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.displace(int tile, ref imgdes srcimg, ref imgdes oprimg, ref imgdes resimg); |
| C/C++ | int displace(int tile, imgdes *srcimg, imgdes *oprimg, imgdes *resimg); |
| Java | int vic.vic32jni.displace(int tile, imgdes srcimg, imgdes oprimg, imgdes resimg); |
Function Arguments
| tile | Tile mode, 0=off, 1=on |
| srcimg | Source image |
| oprimg | Operator image |
| resimg | Result image |
Description
The displace function copies pixel values into new positions in the result image based on the corresponding values in the operator image. If the operator is an 8-bit grayscale image the horizontal and vertical displacements are equal and are shifted up and left. If the operator is a 24-bit image, the horizontal displacement is equal to the operator red value, the vertical displacement is equal to the operator green value.
The tile mode is used if the operator image is smaller than the result image area. If the tile mode is on, the operator will be used repeatedly until the result image area is filled to capacity. If the tile mode is off, the operator will only be used once and then the function will return.
The source, operator, 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 | Source and result are not both 8- or 24-bit or operator is not 8 or 24-bit |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_FAC | Planeno is outside the range 0 to 2 |
divide
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function divide Lib "VIC32.DLL" (ByVal divisor As Long, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.divide Lib "VIC32.DLL" (ByVal divisor As Integer, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.divide(int divisor, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int divide(int divisor, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.divide(int divisor, imgdes srcimg, imgdes resimg); |
Function Arguments
| divisor | Divisor (1 - 32767) |
| srcimg | Source image |
| resimg | Result image |
Description
The divide function decreases the brightness level of each pixel in the source image area by dividing the level value by a factor and placing the quotient in the result image area.
Result = Source / divisor
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 | Divisor is outside the range 1 to 32767 |
divideimage
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function divideimage Lib "VICFX.DLL" (srcimg As imgdes, oprimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.divideimage Lib "VICFX.DLL" (ByRef srcimg As imgdes, ByRef oprimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.divideimage(ref imgdes srcimg, ref imgdes oprimg, ref imgdes resimg); |
| C/C++ | int divideimage(imgdes *srcimg, imgdes *oprimg, imgdes *resimg); |
| Java | int vic.vic32jni.divideimage(imgdes srcimg,imgdes oprimg, imgdes resimg); |
Function Arguments
| srcimg | Source image |
| oprimg | Operator image |
| resimg | Result image |
Description
The divideimage function divides the brightness level of each pixel in the source image area by the brightness level of the corresponding pixel in the operator image area and places the quotient in the result image area. Result values greater than 255 are set to 255. Result values less than zero are set to zero.
-
Result = Source / 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 |
drawhisto
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function drawhisto Lib "VIC32.DLL" (ByVal hdc As Long, rect As RECT, ByVal bppixel As Long, redtab As Long, grntab As Long, blutab As Long) As Long |
| VB.NET | Declare Function vicwin.drawhisto Lib "VIC32.DLL" (ByVal hdc As Integer, ByRef rect As RECT, ByVal bppixel As Integer, ByRef redtab As Integer, ByRef grntab As Integer, ByRef blutab As Integer) As Integer |
| C# | int vicwin.drawhisto(int hdc, ref RECT rect, int bppixel, ref int redtab, ref int grntab, ref int blutab); |
| C/C++ | int drawhisto(HDC hdc, RECT *rect, int bppixel, long *redtab, long *grntab, long *blutab); |
| Java | int vic.vic32jni.drawhisto(int hdc, RECT rect, int bppixel, int[] redtab, int[] grntab, int[] blutab); |
Function Arguments
| hdc | Device context handle |
| rect | Size and location of histogram in device pixels |
| bppixel | Bits per pixel (8 or 24) |
| redtab | Red histogram data to display |
| grntab | Green histogram data to display) |
| blutab | Blue histogram data to display |
Description
The drawhisto function creates a graph of the histogram data on a device context. The vertical axis is frequency and the horizontal axis is brightness level. The histogram data are taken from arrays of 256 long integers.
The rect structure defines the size and location of the histogram transferred to the device context.
If bppixel is 8 the redtab data is plotted as a single graph. If bppixel is 24 the redtab, grntab, and blutab data is plotted as three stacked graphs.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error (see Appendix A) or bits per pixel and number of histogram tables are incompatible |
| BAD_IBUF | Invalid image buffer address |
| BAD_MEM | Insufficient local memory |
| BAD_BPP | Image is not 8- or 24-bit |
| BAD_DIB | Source or result is a compressed DIB |
dropbits
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function dropbits Lib "VIC32.DLL" (ByVal nbits As Long, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.dropbits Lib "VIC32.DLL" (ByVal nbits As Integer, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.dropbits(int nbits, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int dropbits(int nbits, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.dropbits(int nbits, imgdes srcimg, imgdes resimg); |
Function Arguments
| nbits | nbits to drop (0 to 7) |
| srcimg | Source image |
| resimg | Result image |
Description
The dropbits function reduces noise in the image by zeroing the least significant bits in the pixel values. The number of bits to zero is specified by the value of nbits.
-
Result = Source XOR ((1 << nbits) - 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 |
| BAD_FAC | Value of nbits is outside the range 0 to 7 |
emboss
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function emboss Lib "VIC32.DLL" (srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.emboss Lib "VIC32.DLL" (ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.emboss(ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int emboss(imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.emboss(imgdes srcimg, imgdes resimg); |
Function Arguments
| srcimg | Source image |
| resimg | Result image |
Description
The emboss function creates the appearance of embossed edges in 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 diagonally 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.
-
Result = convolution of Source with
| 1 | 1 | 0 |
| 1 | 1 | -1 |
| 0 | -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 |
embossongray
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function embossongray Lib "VIC32.DLL" (srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.embossongray Lib "VIC32.DLL" (ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.embossongray(ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int embossongray(imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.embossongray(imgdes srcimg, imgdes resimg); |
Function Arguments
| srcimg | Source image |
| resimg | Result image |
Description
The embossongray function creates the appearance of embossed edges of an image area placed on a uniform gray area. This function is an edge detection filter. The brightness of the resulting pixels is proportional to the magnitude of the brightness difference between diagonally 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.
-
Result = 128 + convolution of Source with
| 1 | 1 | 0 |
| 1 | 0 | -1 |
| 0 | -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 |
erode
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function erode Lib "VIC32.DLL" (ByVal amount As Long, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.erode Lib "VIC32.DLL" (ByVal amount As Integer, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.erode(int amount, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int erode(int amount, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.erode(int amount, imgdes srcimg, imgdes resimg); |
Function Arguments
| amount | Amount of erosion (0 - 255) |
| srcimg | Source image |
| resimg | Result image |
Description
The erode function brightens an image area by enlarging the bright regions
of the image. The variable amount determines the extent of the brightening.
Maximum erosion is obtained with amount set to 255 and no erosion
occurs if amount is set to zero.
Erode examines a pixel's 3 x 3 local area. If the average brightness of the local area is brighter than 255 minus amount, the central pixel is replaced by its brightest neighbor.
-
If 3 x 3 local area average brightness > (255 - amount)
then Result = brightest pixel in 3 x 3 area
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error (see Appendix A) or image area is less than 3 x 3 pixels |
| 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 | Amount is outside range of 0 - 255 |
exchangelevel
| 8 | 24 |
Function Prototypes
| Visual Basic | exchangelevel Lib "VIC32.DLL" (ByVal min As Long, ByVal max As Long, ByVal newval As Long, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.exchangelevel Lib "VIC32.DLL" (ByVal min As Integer, ByVal max As Integer, ByVal newval As Integer, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.exchangelevel(int min, int max, int newval, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int exchangelevel(int min, int max, int newval, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.exchangelevel(int min, int max, int newval, imgdes srcimg, imgdes resimg); |
Function Arguments
| min | Low end of pixel values to change (0-255) |
| max | High end of pixel values to change (0-255) |
| newval | Replacement value (0-255) |
| srcimg | Source image |
| resimg | Result image |
Description
The exchangelevel function selectively changes a range of brightness levels within an image area to a new value.
-
if Source >= min and Source <= max
-
Result = newval
-
Result = Source
For an RGB image the source red, green, and blue components all must be between min and max for the result pixel to be set to newval. 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 | Min, max, or newval is outside the range 0 - 255 |
expandcontrast
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function expandcontrast Lib "VIC32.DLL" (ByVal min As Long, ByVal max As Long, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.expandcontrast Lib "VIC32.DLL" (ByVal min As Integer, ByVal max As Integer, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.expandcontrast(int min, int max, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int expandcontrast(int min, int max, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.expandcontrast(int min, int max, imgdes srcimg, imgdes resimg); |
Function Arguments
| min | Low end of pixel values to expand (0-255) |
| max | High end of pixel values to expand (0-255) |
| srcimg | Source image |
| resimg | Result image |
Description
The expandcontrast function increases the contrast of the source image area by expanding the brightness range. The value for the lower level is set to 0 (black) and the value for the upper level is set to 255 (white). Values between lower and upper are rescaled.
-
Result = 255 * (source - lower) / (upper - lower)
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 | Lower or upper is outside the range 0 to 255 |
extractcolorrange
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function extractcolorrange Lib "VIC32.DLL" (ByRef rgbcolor As RGBTRIPLE, ByVal extent As Long, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.extractcolorrange Lib "VIC32.DLL" (ByRef rgbcolor As RGBTRIPLE, ByVal extent As Integer, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.extractcolorrange(ref RGBTRIPLE rgbcolor, int extent, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int extractcolorrange(RGBTRIPLE *rgbcolor, int extent, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.extractcolorrange(RGBTRIPLE *rgbcolor, int extent, imgdes srcimg, imgdes resimg); |
Function Arguments
| rgbcolor | Variable of type RGBTRIPLE defining the color value to find |
| extent | Extent of the color range (0 to 255) |
| srcimg | Source image |
| resimg | Result image |
Description
The extractcolorrange function finds all pixels in an image area that are within a color range and sets them equal to 255 in the result image area. This result is a black and white image where the extracted color range is set to white and all other pixels are black.
The RGBTRIPLE structure elements are defined as follows:
| rgbtBlue | Blue value |
| rgbtGreen | Green value |
| rgbtRed | Red value |
-
if Source red value = rgbcolor.rgbtRed + or - extent AND
Source green value = rgbcolor.rgbtGreen + or - extent AND
Source blue value = rgbcolor.rgbtBlue + or - extent
-
Result = white (255)
-
Result = black (0)
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 | Extent is outside the range 0 to 255 |
extractplane
| 8 | 24 | 32 |
Function Prototypes
| Visual Basic | Declare Function extractplane Lib "VIC32.DLL" (ByVal planeno As Long, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.extractplane Lib "VIC32.DLL" (ByVal planeno As Integer, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.extractplane(int planeno, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int extractplane(int planeno, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.extractplane(int planeno, imgdes srcimg, imgdes resimg); |
Function Arguments
| planeno | Plane number to extract |
| srcimg | Source image |
| resimg | Result image |
Description
The extractplane function copies the values in an image area corresponding to the specified plane and puts them into the result image area.
The source image can be 8-, 24-, or 32-bit the result image must be 8-bits per pixel. The plane numbers are:
| Plane | 24-bit RGB Image | 24-bit HSV Image | 32-bit CMYK Image |
| 0 | Red | Hue | Cyan |
| 1 | Green | Saturation | Magenta |
| 2 | Blue | Value | Yellow |
| 3 | -- | -- | Black |
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 | Source image is not 8-,24-, or 32-bit or result is not 8-bit |
| BAD_DIB | Source or result is a compressed DIB |
| BAD_FAC | Planeno is not present in source |
flipimage
| 1 | 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function flipimage Lib "VIC32.DLL" (srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.flipimage Lib "VIC32.DLL" (ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.flipimage(ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int flipimage(imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.flipimage(imgdes srcimg, imgdes resimg); |
Function Arguments
| srcimg | Source image |
| resimg | Result image |
Description
The flipimage function flips an image area top to bottom. 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 |
freebuffer
Function Prototypes
| Visual Basic | Declare Function freebuffer Lib "VIC32.DLL" (ByVal buffaddr As Long) As Long |
| VB.NET | Declare Function vicwin.freebuffer Lib "VIC32.DLL" (ByVal buffaddr As Integer) As Integer |
| C# | int vicwin.freebuffer(int buffaddr); |
| C/C++ | int freebuffer(byte *buffaddr); |
| Java | int vic.vic32jni.freebuffer(int buffaddr); |
Function Arguments
| buffaddr | Buffer address |
Description
The freebuffer function frees the memory previously allocated by one of the savefiletobuffer functions. If the function fails, the return value is equal to a handle to the memory buffer.
Return value
| NO_ERROR | Function successful |
freeimage
| 1 | 8 | 16 | 24 |
Function Prototypes
| Visual Basic | Declare Sub freeimage Lib "VIC32.DLL" (image As imgdes) |
| VB.NET | Declare Sub freeimage Lib "VIC32.DLL" (ByRef image As imgdes) |
| C# | void vicwin.freeimage(ref imgdes image); |
| C/C++ | void freeimage(imgdes *image); |
| Java | void vic.vic32jni.freeimage(imgdes image); |
Function Arguments
| image | Image |
Description
The freeimage function releases the global memory associated with the image descriptor and sets all image descriptor elements to zero. Use freeimage to release memory allocated with allocimage, allocDIB, clienttoimage, ddbtoimage, dibtoimage, dibsecttoimage, windowtoimage, and all of the TWscanxxxx functions.
Return value
There is no return value
See also
allocimage, dibtoimage
gammabrighten
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function gammabrighten Lib "VIC32.DLL" (ByVal gamma As Double, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.gammabrighten Lib "VIC32.DLL" (ByVal gamma As Double, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.gammabrighten(double gamma, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int gammabrighten(double gamma, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.gammabrighten(double gamma, imgdes srcimg, imgdes resimg); |
Function Arguments
| gamma | Gamma factor |
| srcimg | Source image |
| resimg | Result image |
Description
The gammabrighten function increases or decreases the brightness level of each pixel in the source image area and places the result in the result image area. The new pixel value is calculated as
-
Result = ((Source / 255)gamma ) * 255
To brighten an image use a gamma value between 0.0 and 1.0. The lower the value, the brighter the resulting image. To darken an image enter a value above 1.0. The higher the value, the darker the resulting image.
To reverse a gamma operation, call gammabrighten a second time and set the gamma value to the inverse of the previous gamma correction factor. For example, brighten an image with gamma of 0.5, and restore it to its original appearance with gamma of 2.0.
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 |
gaussianblur
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function gaussianblur Lib "VIC32.DLL" (ByVal ksize As Long, srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.gaussianblur Lib "VIC32.DLL" (ByVal ksize As Integer, ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.gaussianblur(int ksize, ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int gaussianblur(int ksize, imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.gaussianblur(int ksize,imgdes srcimg, imgdes resimg); |
Function Arguments
| ksize | Width of local area (3 - 63) |
| srcimg | Source image |
| resimg | Result image |
Description The gaussianblur function blurs an image area with a ksize x ksize convolution matrix. The matrix elements are defined by a standard normal distribution. The source and result image areas are defined by the corresponding image descriptors.
-
Result = convolution of Source with kernel
For more information about a standard normal distribution, see any introductory statistics textbook.
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 | Ksize is outside the range 3 to 63 |
getbuffersize
Function Prototypes
| Visual Basic | Declare Function getbuffersize Lib "VIC32.DLL" (ByVal buffaddr As Long) As Long |
| VB.NET | Declare Function vicwin.getbuffersize Lib "VIC32.DLL" (ByVal buffaddr As Integer) As Integer |
| C# | int vicwin.getbuffersize(int buffaddr); |
| C/C++ | int getbuffersize(byte *buffaddr); |
| Java | int vic.vic32jni.getbuffersize(int buffaddr); |
Function Arguments
| buffaddr | Buffer address |
Description
The getbuffersize function returns the size of the memory previously allocated by one of the savefiletobuffer functions. If the function fails, the return value is zero.
Return value
| 0 - 268435455
(0 - 0x0fffffff) | Buffer size |
getgifcomment
Function Prototypes
| Visual Basic | Declare Function getgifcomment Lib "VIC32.DLL" (ByVal filename As String, ByVal commentstring As String, ByVal commentstringsize As Long) As Long |
| VB.NET | Declare Function vicwin.getgifcomment Lib "VIC32.DLL" (ByVal filename As String, ByVal commentstring As String, ByVal commentstringsize As Integer) As Integer |
| C# | int vicwin.getgifcomment(string filename, ref byte commentstring, int commentstringsize); |
| C/C++ | int getgifcomment(LPCSTR filename, char *commentstring, int commentstringsize); |
| Java | int vic.vic32jni.getgifcomment(String filename, char[] commentstring, int commentstringsize); |
Function Arguments
| filename | Filename to read |
| commentstring | Buffer to receive comment |
| commentstringsize | Number of characters buffer can hold |
Description
The getgifcomment function copies a comment string (if present) from a GIF file to a buffer. If the number of characters in the comment exceeds commentstringsize, the string is truncated to fit into the buffer. To determine the size of the buffer to allocate to hold the string, call getgifcomment with the commentstring value equal NULL (see example).
Return value
| 0 to 32768 | Actual number of characters copied into buffer |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a valid GIF file |
See also
setgifcomment
getpixelcolor
| 1 | 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function getpixelcolor Lib "VIC32.DLL" (srcimg As imgdes, ByVal xcoord As Long, ByVal ycoord As Long) As Long |
| VB.NET | Declare Function vicwin.getpixelcolor Lib "VIC32.DLL" (ByRef srcimg As imgdes, ByVal xcoord As Integer, ByVal ycoord As Integer) As Integer |
| C# | int vicwin.getpixelcolor(ref imgdes srcimg, int xcoord, int ycoord); |
| C/C++ | long getpixelcolor(imgdes *srcimg, int xcoord, int ycoord); |
| Java | int vic.vic32jni.getpixelcolor(imgdes srcimg, int xcoord, int ycoord); |
Function Arguments
| srcimg | Source image |
| xcoord | Pixel x-coordinate |
| ycoord | Pixel y-coordinate |
Description
The getpixelcolor function returns the value of a pixel in the image buffer at (xcoord,ycoord). A negative return value indicates an error.
The source image is defined by the image descriptor.
For a 1-bit image, the value returned is either 0 or 1. For an 8-bit image, the value returned is between 0 and 255. For a 24-bit image, RGB values are returned as long integers that can be decomposed as follows:
blue = (return_value / 65536) & 255
green = (return_value / 256) & 255
red = return_value & 255
Return value
| 0 - 0xFFFFFF | Pixel value |
| BAD_RANGE | Xcoord is greater or equal to image.bmh.biWidth or ycoord is greater or equal to image.bmh.biHeight |
| BAD_BPP | Source image is not 1-, 8-, or 24-bit |
getpngcomment |
| Visual Basic | Declare Function getpngcomment Lib "VIC32.DLL" (ByVal filename As String, ByVal commenttype As String, ByVal commentstring As String, ByVal commentstringsize As Long) As Long |
| VB.NET | Declare Function vicwin.getpngcomment Lib "VIC32.DLL" (ByVal filename As String, ByVal commenttype As String, ByVal buffer As String, ByVal buffermax As Integer) As Integer |
| C# | int vicwin.getpngcomment(string filename, ref byte commenttype, ref byte commentstring, int commentstringsize); |
| C/C++ | int getpngcomment(LPCSTR filename, char * commenttype, char * commentstring, int commentstringsize); |
| Java | int vic.vic32jni.getpngcomment(String filename, String commenttype, char[] commentstring, int commentstringsize); |
Function Arguments
| filename | Filename to read |
| commenttype | Type of comment to receive |
| commentstring | Buffer to receive comment |
| commentstringsize | Number of characters buffer can hold |
Description
The getpngcomment function copies a comment string (if present) from a PNG file to a buffer. If
the number of characters in the comment exceeds commentstringsize, the string is truncated to fit into
the buffer. To determine the size of the buffer to allocate to hold the string, call getpngcomment
with the commentstring value equal 0 (see example).
Only uncompressed comments can be retrieved with getpngcomment. The defined comment type values are "Title", "Author", "Description", "Copyright", "Creation Time", "Software", "Disclaimer", "Warning", "Source", and "Comment."
Return value
| 0 to 32768 | Actual number of characters copied into buffer |
| BAD_OPN | Filename not found |
| BAD_PNG | File is not a valid PNG file |
gifframecount
| Visual Basic | Declare Function gifframecount Lib "VIC32.DLL" (ByVal filenameAs String, ByRef totalframes As Long) As Long |
| VB.NET | Declare Function vicwin.gifframecount Lib "VIC32.DLL" (ByVal filename As String, ByRef totalFrames As Integer) As Integer |
| C# | int vicwin.gifframecount(string filename, ref int totalframes); |
| C/C++ | int gifframecount(LPCSTR filename, int *totalframes); |
| Java | int vic.vic32jni.gifframecount(String filename, refvar totalframes); |
Function Arguments
| filename | Filename to read |
| totalframes | Variable to receive the number of frames in the file |
Description
The gifframecount function determines the number of frames in a multiframe GIF file and places the value in the totalframes parameter.
Return value
| NO_ERROR | Function successful |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a valid GIF file |
gifframecountfrombuffer
| Visual Basic | Declare Function gifframecountfrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, ByRef totalframes As Long) As Long |
| VB.NET | Declare Function vicwin.gifframecountfrombuffer Lib "VIC32.DLL" (ByVal buff As Integer, ByRef totalFrames As Integer) As Integer |
| C# | int vicwin.gifframecountfrombuffer(int buffer, ref int totalframes); |
| C/C++ | int gifframecountfrombuffer(UCHAR *buffer, int *totalframes); |
| Java | int vic.vic32jni.gifframecountfrombuffer(int buffer, refvar totalframes); |
Function Arguments
| buffer | Buffer address |
| totalframes | Variable to receive the number of frames in the file |
Description
The gifframecountfrombuffer function determines the number of frames in a multiframe GIF file stored in memory at buffer address buffer and places the value in the totalframes parameter.
Return value
| NO_ERROR | Function successful |
| BAD_PTR | Cannot read memory buffer |
| BAD_GIF | File is not a valid GIF file |
gifinfo
| Visual Basic | Declare Function gifinfo Lib "VIC32.DLL" (ByVal filenameAs String, gdat As GifData) As Long |
| VB.NET | Declare Function vicwin.gifinfo Lib "VIC32.DLL" (ByVal filename As String, ByRef gdat As GifData) As Integer |
| C# | int vicwin.gifinfo(string filename, ref GifData gdat); |
| C/C++ | int gifinfo(LPCSTR filename, GifData *gdat); |
| Java | int vic.vic32jni.gifinfo(String filename, GifData gdat); |
Function Arguments
| filename | Filename to read |
| gdat | Variable of type GifData to receive the data |
Description
The gifinfo function reads the header of a GIF file and places the image information in the ginfo structure. The structure is defined in the header file VICDEFS.H.
The GifData structure elements are defined as follows:
| width | Image width in pixels |
| length | Image length in pixels |
| BitsColRes | Number of bits of color resolution |
| BitsPPixel | Number of bits per pixe |
| TransColor | Transparent color |
| Laceflag | Interlace flag |
| Codesize | LZW code size |
| GIFvers | GIF version 87 or 89 |
| vbitcount | Victor bits per pixel (used to allocate an imagebuffer with allocimage) |
The purpose of the gifinfo function is to determine if a GIF file is readable and permit allocating enough memory to load the file. The GIF file format specification is available on Compuserve.
If a GIF file contains a transparent color, 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_OPN | Filename not found |
| BAD_GIF | File is not a valid GIF file |
See also
loadgif, savegif
gifinfoallframes
| Visual Basic | Declare Function gifinfoallframes Lib "VIC32.DLL" (ByVal filename As String, gdata As GifGlobalData, fdatarray As GifFrameData, ByVal frameElem As Long) As Long |
| VB.NET | Declare Function vicwin.gifinfoallframes Lib "VIC32.DLL" (ByVal filename As String, ByRef gdata As GifGlobalData, ByRef fdata As GifFrameData, ByVal frameElem As Integer) As Integer |
| C# | int vicwin.gifinfoallframes(string filename, ref GifGlobalData gdata, ref GifFrameData fdatarray, int frameElem); |
| C/C++ | int gifinfoallframes(LPCSTR filename, GifGlobalData *gdata, GifFrameData *fdatarray, int frameElem); |
| Java | int vic.vic32jni.gifinfoallframes(String filename, GifGlobalData gdata, GifFrameData[] fdatarray, int frameElem); |
Function Arguments
| filename | Filename to read |
| gdata | GifGlobalData structure to be filled in |
| fdatarray | Array of GifFrameData structures to be filled in |
| frameElem | Number of GifFrameData structures in fdatarray |
Description
The gifinfoallframes function reads through an entire multiframe GIF file and places the file and the frame information for frameElem number of frames in the data structures.
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 |
This function should be preceded by a call to gifframecount to determine the number of frames in the file.
Return value
| NO_ERROR | Function successful |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a valid GIF file |
| BAD_DATA | File has been corrupted |
See also
loadgif, savegif
gifinfoallframesfrombuffer
| Visual Basic | Declare Function gifinfoallframesfrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, gdata As GifGlobalData, fdatarray As GifFrameData, ByVal frameElem As Long) As Long |
| VB.NET | Declare Function vicwin.gifinfoallframesfrombuffer Lib "VIC32.DLL" (ByVal buffer As Integer, ByRef gdata As GifGlobalData, ByRef fdatarray As GifFrameData, ByVal frameElem As Integer) As Integer |
| C# | int vicwin.gifinfoallframesfrombuffer(ref byte buffer, ref GifGlobalData gdata, ref GifFrameData fdata, int frameElem); |
| C/C++ | int gifinfoallframesfrombuffer(unsigned char *buffer, GifGlobalData *gdata, GifFrameData *fdata, int frameElem); |
| Java | int vic.vic32jni.gifinfoallframesfrombuffer(int buffer, GifGlobalData gdata, GifFrameData[] fdatarray, int frameElem); |
Function Arguments
| buffer | Buffer address |
| gdata | GifGlobalData structure to be filled in |
| fdatarray | Array of GifFrameData structures to be filled in |
| frameElem | Number of GifFrameData structures in fdatarray |
Description
The gifinfoallframesfrombuffer function reads through an entire multiframe GIF file and places the file and the frame information for frameElem number of frames in the data structures.
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 |
This function should be preceded by a call to gifframecount to determine the number of frames in the file.
Return value
| NO_ERROR | Function successful |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a valid GIF file |
| BAD_DATA | File has been corrupted |
See also
loadgif, savegif
gifinfoframe
| Visual Basic | Declare Function gifinfoframe Lib "VIC32.DLL" (ByVal filename As String, ginfo As GifData, gdata As GifGlobalData, fdata As GifFrameData, ByVal frameTarget As Long) As Long |
| VB.NET | Declare Function vicwin.gifinfoframe Lib "VIC32.DLL" (ByVal filename As String, ByRef ginfo As GifData, ByRef gdata As GifGlobalData, ByRef fdata As GifFrameData, ByVal frameTarget As Integer) As Integer |
| C# | int vicwin.gifinfoframe(string filename, ref GifData ginfo, ref GifGlobalData gdata, ref GifFrameData fdata, int frameTarget); |
| C/C++ | int gifinfoframe(LPCSTR filename, GifData *ginfo, GifGlobalData *gdata, GifFrameData *fdata, int frameTarget); |
| Java | int vic.vic32jni.gifinfoframe(String filename, GifData ginfo, GifGlobalData gdata, GifFrameData fdata, int frameTarget); |
Function Arguments
| filename | Filename to read |
| ginfo | GifData structure to be filled in |
| gdata | GifGlobalData structure to be filled in |
| fdata | GifFrameData structure to be filled in |
| frameTarget | Frame number (zero-based) |
Description
The gifinfoframe function reads the header of a GIF file and the frame header of a specified frame and places the file and image information in the data structures. The first frame in a file is frame number zero.
The GifData structure elements are defined as follows:
| width | Image width in pixels |
| length | Image length in pixels |
| BitsColRes | Number of bits of color resolution |
| BitsPPixel | Number of bits per pixe |
| TransColor | Transparent color |
| Laceflag | Interlace flag |
| Codesize | LZW code size |
| GIFvers | GIF version 87 or 89 |
| vbitcount | Victor bits per pixel (used to allocate an imagebuffer with allocimage) |
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 |
Return value
| NO_ERROR | Function successful |
| BAD_OPN | Filename not found |
| BAD_GIF | File is not a valid GIF file |
See also
loadgif, savegif
gifinfoframefrombuffer
| Visual Basic | Declare Function gifinfoframefrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, ginfo As GifData, gdata As GifGlobalData, fdata As GifFrameData, ByVal frameTarget As Long) As Long |
| VB.NET | Declare Function vicwin.gifinfoframefrombuffer Lib "VIC32.DLL" (ByVal buff As Integer, ByRef ginfo As GifData, ByRef gdata As GifGlobalData, ByRef fdata As GifFrameData, ByVal frameTarget As Integer) As Integer |
| C# | int vicwin.gifinfoframefrombuffer(ref byte buffer, ref GifData ginfo, ref GifGlobalData gdata, ref GifFrameData fdata, int frameTarget); |
| C/C++ | int gifinfoframefrombuffer(UCHAR *buffer, GifData *ginfo, GifGlobalData *gdata, GifFrameData *fdata, int frameTarget); |
| Java | int vic.vic32jni.gifinfoframefrombuffer(int buffer, GifData ginfo, GifGlobalData gdata, GifFrameData fdata, int frameTarget); |
Function Arguments
| buffer | Buffer address |
| ginfo | GifData structure to be filled in |
| gdata | GifGlobalData structure to be filled in |
| fdata | GifFrameData structure to be filled in |
| frameTarget | Frame number (zero-based) |
Description
The gifinfoframefrombuffer function reads from a GIF file in memory and places the file and frame image information in the data structures. The first frame in a file is frame number zero.
The GifData structure elements are defined as follows:
| width | Image width in pixels |
| length | Image length in pixels |
| BitsColRes | Number of bits of color resolution |
| BitsPPixel | Number of bits per pixe |
| TransColor | Transparent color |
| Laceflag | Interlace flag |
| Codesize | LZW code size |
| GIFvers | GIF version 87 or 89 |
| vbitcount | Victor bits per pixel (used to allocate an imagebuffer with allocimage) |
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 |
Return value
| NO_ERROR | Function successful |
| BAD_GIF | File is not a valid GIF file |
| BAD_PTR | Buffer does not point to readable memory |
See also
loadgif, savegif
gifinfofrombuffer
| Visual Basic | Declare Function gifinfofrombuffer Lib "VIC32.DLL" (ByVal buffer As Long, ginfo As GifData) As Long |
| VB.NET | Declare Function vicwin.gifinfofrombuffer Lib "VIC32.DLL" (ByVal buff As Integer, ByRef gdat As GifData) As Integer |
| C# | int vicwin.gifinfofrombuffer(ref byte buffer, ref GifData ginfo); |
| C/C++ | int gifinfofrombuffer(UCHAR *buffer, GifData *ginfo); |
| Java | int vic.vic32jni.gifinfofrombuffer(int buffer, GifData ginfo); |
Function Arguments
| buffer | Buffer address |
| ginfo | Variable of type GifData to receive the data |
Description
The gifinfofrombuffer function reads the header information from memory holding GIF file data and places the image information in the ginfo structure.
The GifData structure elements are defined as follows:
| width | Image width in pixels |
| length | Image length in pixels |
| BitsColRes | Number of bits of color resolution |
| BitsPPixel | Number of bits per pixe |
| TransColor | Transparent color |
| Laceflag | Interlace flag |
| Codesize | LZW code size |
| GIFvers | GIF version 87 or 89 |
| vbitcount | Victor bits per pixel (used to allocate an imagebuffer with allocimage) |
The purpose of the gifinfofrombuffer function is to identify the type and size of the image and permit allocating enough memory to load the image.
If a GIF file contains a transparent color, 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_OPN | Memory handle not available |
| BAD_GIF | File is not a valid GIF file |
| BAD_PTR | Buff does not point to readable memory |
See also
gifinfo
histobrighten
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function histobrighten Lib "VIC32.DLL" (srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.histobrighten Lib "VIC32.DLL" (ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.histobrighten(ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int histobrighten(imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.histobrighten(imgdes srcimg, imgdes resimg); |
Function Arguments
| srcimg | Source image |
| resimg | Result image |
Description
The histobrighten function brightens an image area by reassigning brightness levels so that the integral of the resulting histogram increases quadratically with brightness level. The source and result image areas are defined by the corresponding image descriptors.
Histogram brightening generally reduces the number of brightness levels present in the image. Contrast is improved, but details may be lost. Histogram brightening is sometimes very effective in bringing out the details of an image when the subject of interest is hidden in shadows.
Return value
| NO_ERROR | Function successful |
| BAD_RANGE | Range error (see Appendix A) or image area is less than 16 pixels |
| 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 |
See also
histoequalize
histoequalize
| 8 | 24 |
Function Prototypes
| Visual Basic | Declare Function histoequalize Lib "VIC32.DLL" (srcimg As imgdes, resimg As imgdes) As Long |
| VB.NET | Declare Function vicwin.histoequalize Lib "VIC32.DLL" (ByRef srcimg As imgdes, ByRef resimg As imgdes) As Integer |
| C# | int vicwin.histoequalize(ref imgdes srcimg, ref imgdes resimg); |
| C/C++ | int histoequalize(imgdes *srcimg, imgdes *resimg); |
| Java | int vic.vic32jni.histoequalize(imgdes srcimg, imgdes resimg); |
Function Arguments
| srcimg | Source image |
| resim |