ImageLibApi.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
10 
12 
13 /*---------------------------------------------------------------------------------**/
40 (
41 byte **imageMapPP, /* <= image map */
42 byte *rgbBufferP, /* => image buffer (RGB) */
43 Point2d *sizeP, /* => image size */
44 byte *redMapP, /* => red palette entries */
45 byte *grnMapP, /* => green palette entries */
46 byte *bluMapP, /* => blue palette entries */
47 int paletteSize, /* => number of palette entries */
48 double gamma /* => gamma correction value */
49 );
50 
51 /*---------------------------------------------------------------------------------**/
77 (
78 byte **imageMapPP, /* <= image map */
79 byte *rgbBufferP, /* => image buffer (RGB) */
80 Point2d *sizeP, /* => image size */
81 byte *redMapP, /* <= red palette entries */
82 byte *grnMapP, /* <= green palette entries */
83 byte *bluMapP, /* <= blue palette entries */
84 int paletteSize /* => number of palette entries */
85 );
86 
87 
88 
89 /*---------------------------------------------------------------------------------**/
108 (
109 void
110 );
111 
112 /*---------------------------------------------------------------------------------**/
143 (
144 int nColors, /* => number of palette entries */
145 byte *redMapP, /* => red palette entries */
146 byte *grnMapP, /* => green palette entries */
147 byte *bluMapP, /* => blue palette entries */
148 int width /* => width of scanlines */
149 );
150 
151 /*---------------------------------------------------------------------------------**/
182 (
183 byte *outputLineP, /* <= color map indices for each pixel */
184 byte *redP, /* => red values for each pixel */
185 byte *grnP, /* => green values for each pixel */
186 byte *bluP, /* => blue values for each pixel */
187 int width /* => number of pixels in scanline */
188 );
189 
190 /*---------------------------------------------------------------------------------**/
216 (
217 byte *redMapP, /* <= red values for optimized palette */
218 byte *grnMapP, /* <= green values for optimized palette */
219 byte *bluMapP, /* <= blue values for optimized palette */
220 int *paletteSizeP, /* <= number of palette entries used */
221 int maxColors, /* => maximum colors in optimized palette */
222 byte *imageBufferP, /* => RGB Values for each image pixel */
223 Point2d *sizeP /* => size of imageBuffer */
224 );
225 
226 
227 /*---------------------------------------------------------------------------------**/
252 (
253 byte **rgbBufferPP, /* <= image buffer (RGB) */
254 byte *mapP, /* => image map */
255 Point2d *sizeP, /* => image size */
256 byte *redMapP, /* => red palette entries */
257 byte *grnMapP, /* => green palette entries */
258 byte *bluMapP /* => blue palette entries */
259 );
260 
261 /*---------------------------------------------------------------------------------**/
287 (
288 byte *rgbBufferP, /* <= image buffer (RGB) */
289 byte *mapP, /* => image map */
290 Point2d *sizeP, /* => image size */
291 byte *redMapP, /* => red palette entries */
292 byte *grnMapP, /* => green palette entries */
293 byte *bluMapP /* => blue palette entries */
294 );
295 
296 /*---------------------------------------------------------------------------------**/
315 int mdlImage_resize
316 (
317 byte **outputImagePP, /* <= resized output image (RGB) */
318 Point2d *outputSizeP, /* => output size */
319 byte *inputImageP, /* => input image (RGB) */
320 Point2d *inputSizeP /* => input size */
321 );
322 
323 /*----------------------------------------------------------------------+
324 | |
325 | File read functions |
326 | |
327 +----------------------------------------------------------------------*/
328 /*---------------------------------------------------------------------------------**/
350 (
351 Point2d *imageSizeP, /* <= image size */
352 DgnPlatform::ImageColorMode *colorModeP, /* <= color mode (from image.h) */
353 int *orientationP, /* <= orientation (from image.h) */
354 WCharCP fileName, /* => file name */
355 DgnPlatform::ImageFileFormat fileType /* => file type */
356 );
357 
358 /*---------------------------------------------------------------------------------**/
391 (
392 byte **imageBufferPP, /* <= map indices for each pixel */
393 Point2d *imageSizeP, /* <= image size */
394 WCharCP name, /* => image file name */
395 DgnPlatform::ImageFileFormat fileType, /* => type of file (from image.h) */
396 Point2d *requestedSizeP /* => size of output image (or NULL) */
397 );
398 
399 
400 /*---------------------------------------------------------------------------------**/
433 (
434 byte **imageMapPP, /* <= image map */
435 Point2d *imageSizeP, /* <= image size */
436 byte *redMapP, /* <= red palette entries */
437 byte *grnMapP, /* <= green palette entries */
438 byte *bluMapP, /* <= palette entries */
439 int *paletteSizeP, /* <= palette size */
440 WCharCP fileName, /* => input file name */
441 DgnPlatform::ImageFileFormat fileType /* => input file type */
442 );
443 
444 /*----------------------------------------------------------------------+
445 | |
446 | File creation functions |
447 | |
448 +----------------------------------------------------------------------*/
449 /*---------------------------------------------------------------------------------**/
480 (
481 WCharCP name, /* => name of file */
482 DgnPlatform::ImageFileFormat type, /* => type of file (from image.h) */
483 DgnPlatform::ImageColorMode colorMode, /* => color mode (from image.h) */
484 Point2d *sizeP, /* => size of image */
485 byte *imageMapP, /* => color map index for each pixel */
486 byte *redPaletteP, /* => red palette values */
487 byte *grnPaletteP, /* => green palette values */
488 byte *bluPaletteP, /* => blue palette values */
489 int paletteSize, /* => number of palette entries */
490 DgnPlatform::CompressionType compressType, /* => compress type (COMPRESSTYPE in image.h) */
491 DgnPlatform::CompressionRatio compressRatio, /* => compress ratio (COMPRESSIONRATIO in image.h) */
492 byte *transparencyP /* => transparent index or RGB */
493 );
494 
495 /*---------------------------------------------------------------------------------**/
521 (
522 WCharCP name, /* => name of file */
523 DgnPlatform::ImageFileFormat type, /* => type of file (from image.h) */
524 DgnPlatform::ImageColorMode colorMode, /* => color mode (from image.h) */
525 Point2d *sizeP, /* => size of image */
526 byte *imageMapP, /* => color map index for each pixel */
527 byte *redPaletteP, /* => red palette values */
528 byte *grnPaletteP, /* => green palette values */
529 byte *bluPaletteP, /* => blue palette values */
530 int paletteSize /* => number of palette entries */
531 );
532 
533 /*---------------------------------------------------------------------------------**/
561 (
562 WCharCP name, /* => name of file */
563 DgnPlatform::ImageFileFormat type, /* => type of file (from image.h) */
564 DgnPlatform::ImageColorMode colorMode, /* => color mode (from image.h) */
565 Point2d *sizeP, /* => size of image */
566 byte *imageBufferP, /* => RGB values for each pixel */
567 DgnPlatform::CompressionType compressType, /* => compress type (COMPRESSTYPE in image.h) */
568 DgnPlatform::CompressionRatio compressRatio, /* => compress ratio (COMPRESSIONRATIO in image.h) */
569 byte *transparencyP /* => transparent index or RGB */
570 );
571 
572 
573 /*---------------------------------------------------------------------------------**/
605 (
606 WCharCP name, /* => name of file */
607 DgnPlatform::ImageFileFormat type, /* => type of file (from image.h) */
608 Point2d *sizeP, /* => size of image */
609 byte *imageBufferP, /* => RGB values for each pixel */
610 DgnPlatform::CompressionType compressType, /* => compress type (COMPRESSTYPE in image.h) */
611 DgnPlatform::CompressionRatio compressRatio, /* => compress ratio (COMPRESSIONRATIO in image.h) */
612 byte *transparencyP, /* => transparent index or RGB */
613 RgbColorDef *backgroundColorP /* => background color used in monochrome mode */
614 );
615 
616 /*---------------------------------------------------------------------------------**/
639 (
640 WCharCP name, /* => name of file */
641 DgnPlatform::ImageFileFormat type, /* => type of file (from image.h) */
642 DgnPlatform::ImageColorMode colorMode, /* => color mode (from image.h) */
643 Point2d *sizeP, /* => size of image */
644 byte *imageBufferP /* => RGB values for each pixel */
645 );
646 
647 
648 /*----------------------------------------------------------------------+
649 | |
650 | Miscellaneous functions |
651 | |
652 +----------------------------------------------------------------------*/
653 /*---------------------------------------------------------------------------------**/
667 (
668 WCharP ext, /* <= default extension (MAXEXTENSIONLENGTH characters) */
669 DgnPlatform::ImageFileFormat type /* => image type (from image.h) */
670 );
671 
672 /*---------------------------------------------------------------------------------**/
687 int mdlImage_getOSFileType /* <= SUCCESS or error. */
688 (
689 UInt32 *osFileTypeP, /* <= O.S. file type. */
690 DgnPlatform::ImageFileFormat imageType /* => image type (from image.h) */
691 );
692 
693 /*---------------------------------------------------------------------------------**/
714 (
715 DgnPlatform::ImageColorMode *defaultModeP, /* <= default color mode */
716 bool *rgbSupportP, /* <= support for 24 bit RGB */
717 bool *palette256SupportP, /* <= support for 256 color palette */
718 bool *palette16SupportP, /* <= support for 16 color palette */
719 bool *greyScaleSupportP, /* <= support for grey scale */
720 bool *monochromeSupportP, /* <= support for monochrome */
721 DgnPlatform::ImageFileFormat imageType /* => image type (from image.h) */
722 );
723 
724 /*---------------------------------------------------------------------------------**/
737 (
738 WCharP formatName,
739 UInt32 formatNameLen,
740 UInt32 formatId
741 );
742 
743 /*---------------------------------------------------------------------------------**/
756 (
757 WCharP formatName,
758 UInt32 formatNameLen,
759 UInt32 formatId
760 );
761 
762 /*---------------------------------------------------------------------------------**/
796 (
797 WCharP formatName, /* <= image format name */
798 DgnPlatform::ImageFileFormat *importTypeP, /* <= IMAGEFILE_ type for returned format */
799 int index /* => index of export array to return */
800 );
801 
802 /*---------------------------------------------------------------------------------**/
836 (
837 WCharP formatName, /* <= image format name */
838 DgnPlatform::ImageFileFormat *importTypeP, /* <= IMAGEFILE_ type for returned format */
839 int index /* => index of import array to return */
840 );
841 
842 
843 /*---------------------------------------------------------------------------------**/
861 (
862 byte *redMapP, /* <= red map */
863 byte *grnMapP, /* <= green map */
864 byte *bluMapP, /* <= blue map */
865 int *numColorsP /* <= number of colors */
866 );
867 
868 /*---------------------------------------------------------------------------------**/
882 (
883 WCharCP fileName /* => image file name */
884 );
885 
886 /*---------------------------------------------------------------------------------**/
899 (
900 byte *pixelP, /* <= 4 bytes to store backround color */
901 WCharCP name
902 );
903 
904 
905 /*---------------------------------------------------------------------------------**/
921 (
922 byte *rgbOutP, /* <= output buffer */
923 byte *rgbInP, /* => input buffer */
924 Point2d *sizeP, /* => buffer size */
925 double gamma /* => gamma value (1.0 == NONE) */
926 );
927 
928 /*---------------------------------------------------------------------------------**/
944 (
945 byte *redMapP, /* <=> red palette values */
946 byte *greenMapP, /* <=> green palette values */
947 byte *blueMapP, /* <=> blue palette values */
948 int paletteSize, /* => number of palette entries */
949 double gamma /* => gamma value */
950 );
951 
952 /*---------------------------------------------------------------------------------**/
965 void mdlImage_negate
966 (
967 byte *rgbOutP, /* <= output buffer */
968 byte *rgbInP, /* => input buffer */
969 Point2d *sizeP /* => buffer size */
970 );
971 
972 /*---------------------------------------------------------------------------------**/
987 (
988 byte *redMapP, /* <=> red palette values */
989 byte *greenMapP, /* <=> green palette values */
990 byte *blueMapP, /* <=> blue palette values */
991 int paletteSize /* => number of palette entries */
992 );
993 
994 
995 
996 /*---------------------------------------------------------------------------------**/
1038 (
1039 byte **imageBitMap, /* <= image bit map */
1040 Point2d *imageSize, /* <= image size */
1041 WCharCP fileName, /* => input file name */
1042 DgnPlatform::ImageFileFormat fileType, /* => input file type */
1043 bool runLengthEncode /* => run length encode data */
1044 );
1045 
1046 
1047 /*---------------------------------------------------------------------------------**/
1086 (
1087 WCharCP nameP, /* => file name */
1088 DgnPlatform::ImageFileFormat type, /* => file type (image.h) */
1089 Point2d *sizeP, /* => image size */
1090 byte *bitMapP, /* => bit map */
1091 bool runLengthEncode, /* => bit map is run length encoded */
1092 RgbColorDef *foregroundColorP, /* => foreground color */
1093 RgbColorDef *backgroundColorP /* => background color */
1094 );
1095 
1096 /*---------------------------------------------------------------------------------**/
1215 (
1216 WCharCP saveAsFileNameP, /* => name of file */
1217 DgnPlatform::ImageFileFormat fileType, /* => type of file (from image.h) */
1218 DgnPlatform::ImageColorMode colorMode, /* => color mode (from image.h) */
1219 Point2d *sizeP, /* => size of image */
1220 byte *imageDataP, /* => image data for each pixel (in various formats) */
1221 int imageFormat, /* => input buffer format */
1222 void *param1P, /* => pointer to parameter 1 */
1223 void *param2P, /* => pointer to parameter 2 */
1224 void *param3P, /* => pointer to parameter 3 */
1225 int paletteSize, /* => number of palette entries */
1226 DgnPlatform::CompressionType compressType, /* => compress type (COMPRESSTYPE in image.h) */
1227 DgnPlatform::CompressionRatio compressRatio /* => compress ratio (COMPRESSIONRATIO in image.h) */
1228 );
1229 
1230 /*---------------------------------------------------------------------------------**/
1256 (
1257 byte *outP, /* <= output rgb image (allocated by caller) */
1258 Point2d *outSizeP, /* => output image size */
1259 byte *inP, /* => input rgb image */
1260 Point2d *inSizeP, /* => input image size */
1261 BSIRect *rectP /* => sub rectangle to extract (or NULL) */
1262 );
1263 
1264 /*---------------------------------------------------------------------------------**/
1290 (
1291 byte *outP, /* <= output rgba image (allocated by caller) */
1292 Point2d *outSizeP, /* => output image size */
1293 byte *inP, /* => input rgba image */
1294 Point2d *inSizeP, /* => input image size */
1295 BSIRect *rectP /* => sub rectangle to extract (or NULL) */
1296 );
1297 
1298 /*---------------------------------------------------------------------------------**/
1326 (
1327 byte **outRowPP, /* <= output pack byte buffer (alloc by caller) */
1328 Point2d *outSizeP, /* => output image size */
1329 byte **inRowPP, /* => input pack byte array */
1330 Point2d *inSizeP, /* => input image size */
1331 BSIRect *rectP, /* => sub rectangle to extract (or NULL) */
1332 byte *mapP /* => redirection map */
1333 );
1334 
1335 /*---------------------------------------------------------------------------------**/
1363 (
1364 byte *outMapP, /* <= output byte map (allocated by caller) */
1365 Point2d *outSizeP, /* => output image size */
1366 byte *inMapP, /* => input byte map */
1367 Point2d *inSizeP, /* => input image size */
1368 BSIRect *rectP, /* => sub rectangle to extract (or NULL) */
1369 byte *mapP /* => redirection map */
1370 );
1371 
1372 /*---------------------------------------------------------------------------------**/
1398 (
1399 byte *outMapP, /* <= output bitmap (allocated by caller) */
1400 Point2d *outSizeP, /* => output image size */
1401 byte *inBitMapP, /* => input bitmap */
1402 Point2d *inSizeP, /* => input image size */
1403 BSIRect *rectP /* => sub rectangle to extract (or NULL) */
1404 );
1405 
1406 /*---------------------------------------------------------------------------------**/
1439 (
1440 byte *outMapP, /* <= output byte map (allocated by caller) */
1441 Point2d *outSizeP, /* => output image size */
1442 byte *inBitMapP, /* => input bit map */
1443 Point2d *inSizeP, /* => input image size */
1444 BSIRect *rectP, /* => sub rectangle to extract (or NULL) */
1445 int foreground, /* => foreground index */
1446 int background, /* => background index */
1447 bool rle /* => map is run length encoded */
1448 );
1449 
1450 /*---------------------------------------------------------------------------------**/
1479 (
1480 byte *outMapP, /* <= output byte map (allocated by caller) */
1481 Point2d *outSizeP, /* => output image size */
1482 UShort **inBitMapPP, /* => input bit map */
1483 Point2d *inSizeP, /* => input image size */
1484 BSIRect *rectP, /* => sub rectangle to extract (or NULL) */
1485 int foreground, /* => foreground index */
1486 int background /* => background index */
1487 );
1488 
1489 /*---------------------------------------------------------------------------------**/
1516 (
1517 byte *outMapP, /* <= output byte map (allocated by caller) */
1518 Point2d *outSizeP, /* => output image size */
1519 byte **inRowPP, /* => input pack byte array */
1520 Point2d *inSizeP, /* => input image size */
1521 BSIRect *rectP, /* => sub rectangle to extract (or NULL) */
1522 byte *mapP /* => redirection map */
1523 );
1524 
1525 /*---------------------------------------------------------------------------------**/
1553 void mdlImage_freeImage
1554 (
1555 void *imageP, /* => pointer of image to free */
1556 Point2d *sizeP, /* => size of image (needed for some formats) */
1557 int imageFormat /* => memory image format from image.h */
1558 );
1559 
1560 /*---------------------------------------------------------------------------------**/
1587 (
1588 byte *outP, /* <= extracted subimage */
1589 Point2d *outSizeP, /* => pixel dimension of subimage */
1590 byte *inP, /* => source image */
1591 Point2d *inSizeP, /* => source image size */
1592 BSIRect *rectP, /* => source subimage rectangle (or NULL) */
1593 int imageFormat /* => format of source image */
1594 );
1595 
1596 /*---------------------------------------------------------------------------------**/
1618 (
1619 UShort ***rlePPP, /* <= run length encoded bitmap buffer */
1620 byte *bitmapP, /* => source bitmap */
1621 Point2d *sizeP /* => image size in pixels */
1622 );
1623 
1624 
1625 /*---------------------------------------------------------------------------------**/
1648 (
1649 byte *redP, /* <=> red palette entry */
1650 byte *grnP, /* <=> green palette entry */
1651 byte *bluP, /* <=> blue palette entry */
1652 int paletteSize, /* => palette size */
1653 RgbColorDef *tintRGBP /* => RGB value of tint color */
1654 );
1655 
1656 /*---------------------------------------------------------------------------------**/
1678 void mdlImage_tintImage
1679 (
1680 byte *imageP, /* <= tinted RGBSeperate image */
1681 Point2d *imageSizeP, /* => image size in pixels */
1682 RgbColorDef *tintRGBP /* => RGB value of tint color */
1683 );
1684 
1685 
1686 /*---------------------------------------------------------------------------------**/
1715 (
1716 byte *dataP, /* <=> image data */
1717 bool *dataModifiedP, /* <= true == changed occurred */
1718 Point2d *sizeP, /* => image size in pixels */
1719 int imageFormat, /* => image format */
1720 DPoint2d *pointP, /* => closed array of points */
1721 int nPoints, /* => number of points in array */
1722 bool outside, /* => true == fill outside with value */
1723 int value /* => fill value */
1724 );
1725 
1726 /*---------------------------------------------------------------------------------**/
1754 (
1755 byte *dataP, /* <=> image data */
1756 bool *dataModifiedP, /* <= true == changed occurred */
1757 Point2d *sizeP, /* => image size in pixels */
1758 DPoint2d *pointP, /* => closed array of points */
1759 int nPoints, /* => number of points in array */
1760 bool outside, /* => true == fill outside with value */
1761 RgbColorDef *colorP /* >= fill value */
1762 );
1763 
1764 /*---------------------------------------------------------------------------------**/
1789 int mdlImage_rotate
1790 (
1791 byte **outBufferPP, /* <= image buffer (rotated) */
1792 Point2d *outSizeP, /* <= image size (after rotate */
1793 byte *inpBufferP, /* => image buffer (original) */
1794 Point2d *imageSizeP, /* => image size (original) */
1795 int imageFormat, /* => IMAGEFORMAT_ (from image.h) */
1796 int rotation /* => 90, 180, 270 */
1797 );
1798 
1799 /*---------------------------------------------------------------------------------**/
1817 int mdlImage_mirror
1818 (
1819 byte *inpBufferP, /* <=> image buffer */
1820 Point2d *imageSizeP, /* => image size */
1821 int imageFormat, /* => IMAGEFORMAT_xxx (from image.h) */
1822 bool vertical /* => IMAGE_FLIP_xxx (from image.h) */
1823 );
1824 
1825 /*---------------------------------------------------------------------------------**/
1861 int mdlImage_warp
1862 (
1863 byte **outPP, /* <= warped image buffer pointer */
1864 Point2d *outSizeP, /* => warped image size in pixels */
1865 byte *inP, /* => input image buffer */
1866 Point2d *inSizeP, /* => input image size in pixesl */
1867 int imageFormat, /* => image format */
1868 TransformP inverseTransformP, /* => transform output to input pixel */
1869 byte *transparentP /* => fill value if no input pixel */
1870 );
1871 
1872 /*---------------------------------------------------------------------------------**/
1891 (
1892 Point2d *sizeP, /* => image size in pixels */
1893 int imageFormat /* => image format from image.h */
1894 );
1895 
1896 /*---------------------------------------------------------------------------------**/
1920 (
1921 WCharCP fileNameP /* => full path name of file to open */
1922 );
1923 
1924 /*---------------------------------------------------------------------------------**/
1950 (
1951 byte *mapP, /* <=> mapped image changed where RGB match occurs */
1952 int value, /* => index to set in mapped image */
1953 byte *rgbP, /* => RGB image from which match is determined */
1954 Point2d *sizeP, /* => size in pixels of both images */
1955 RgbColorDef *matchP, /* => match RGB value */
1956 bool packBytes /* => true == mapped image is packbyte compressed */
1957 );
1958 
1959 /*---------------------------------------------------------------------------------**/
1981 (
1982 byte mapUsed[256], /* <= palette index used or available */
1983 byte *mapP, /* => byte mapped image */
1984 Point2d *sizeP, /* => image size in pixels */
1985 bool packBytes /* => packbytes compression */
1986 );
1987 
1988 /*---------------------------------------------------------------------------------**/
2007 (
2008 byte *greyPaletteP, /* <= greyscale palette */
2009 int *minGreyP, /* <= minimum grey value (or NULL) */
2010 int *maxGreyP, /* <= maximum grey value (or NULL) */
2011 byte *redMapP, /* => red palette entries */
2012 byte *grnMapP, /* => green palette entries */
2013 byte *bluMapP, /* => blue palette entries */
2014 int paletteSize /* => number of palette entries */
2015 );
2016 
2017 /*---------------------------------------------------------------------------------**/
2042 (
2043 byte *greyP, /* <= greyscale image (caller mallocs) */
2044 int *minGreyP, /* <= minimum grey value (or NULL) */
2045 int *maxGreyP, /* <= maximum grey value (or NULL) */
2046 byte *byteMapP, /* => source byte-mapped image */
2047 byte *redMapP, /* => red palette entries */
2048 byte *grnMapP, /* => green palette entries */
2049 byte *bluMapP, /* => blue palette entries */
2050 int paletteSize, /* => number of palette entries */
2051 Point2d *sizeP /* => image size in pixels */
2052 );
2053 
2054 /*---------------------------------------------------------------------------------**/
2079 (
2080 byte *greyP, /* <= greyscale image (caller mallocs) */
2081 int *minGreyP, /* <= minimum grey value (or NULL) */
2082 int *maxGreyP, /* <= maximum grey value (or NULL) */
2083 byte *packByteP, /* => source packbyte image */
2084 byte *redMapP, /* => red palette entries */
2085 byte *grnMapP, /* => green palette entries */
2086 byte *bluMapP, /* => blue palette entries */
2087 int paletteSize, /* => number of palette entries */
2088 Point2d *sizeP /* => image size in pixels */
2089 );
2090 
2091 /*---------------------------------------------------------------------------------**/
2113 (
2114 byte *greyP, /* <= greyscale image (caller mallocs) */
2115 int *minGreyP, /* <= minimum grey value (or NULL) */
2116 int *maxGreyP, /* <= maximum grey value (or NULL) */
2117 byte *rgbP, /* => source RGB data */
2118 Point2d *sizeP /* => image size in pixels */
2119 );
2120 
2121 /*---------------------------------------------------------------------------------**/
2145 (
2146 byte *bitMapP, /* <= bitmap image (caller mallocs) */
2147 byte *greyP, /* => source greyscale image */
2148 Point2d *sizeP, /* => size in pixels */
2149 int minGrey, /* => minimum greyscale value */
2150 int maxGrey, /* => maximum greyscale value */
2151 int ditherMode /* => DITHERMODE_Pattern or _ErrorDiffusion */
2152 );
2153 
2154 /*---------------------------------------------------------------------------------**/
2176 (
2177 byte *bitMapP, /* <= bitmap */
2178 byte *rgbP, /* => rgb image */
2179 Point2d *sizeP, /* => size */
2180 int ditherMode /* => dither mode */
2181 );
2182 
2183 /*---------------------------------------------------------------------------------**/
2211 (
2212 byte *bitMapP, /* <= bitmap */
2213 byte *byteMapP, /* => rgb image */
2214 byte *redMapP, /* => red palette values */
2215 byte *grnMapP, /* => green palette values */
2216 byte *bluMapP, /* => blue palette values */
2217 int paletteSize, /* => number of palette entries */
2218 Point2d *sizeP, /* => size */
2219 int ditherMode /* => dither mode */
2220 );
2221 
2222 /*---------------------------------------------------------------------------------**/
2247 (
2248 byte *bitMapP, /* <= bitmap */
2249 byte *packByteP, /* => pack byte image */
2250 byte *redMapP, /* => red palette values */
2251 byte *grnMapP, /* => green palette values */
2252 byte *bluMapP, /* => blue palette values */
2253 int paletteSize, /* => number of palette entries */
2254 Point2d *sizeP, /* => size */
2255 int ditherMode /* => dither mode */
2256 );
2257 
2258 /*---------------------------------------------------------------------------------**/
2280 (
2281 UShort *outP, /* <= output encoded bitmap */
2282 int *compressedSizeP, /* <= output size */
2283 byte *inP, /* => input bitmap */
2284 int nPixels /* => pixels to encode */
2285 );
2286 
2287 /*---------------------------------------------------------------------------------**/
2302 (
2303 byte *outP, /* <= output bitmap */
2304 UShort *inP, /* => input RLE bitmap */
2305 int nPixels /* => pixels to decode */
2306 );
2307 
2308 /*---------------------------------------------------------------------------------**/
2331 (
2332 byte **imagePP, /* <=> image buffer to be modified */
2333 Point2d *sizeP, /* => size of image in pixels */
2334 int ingrOrientation, /* => INGR_ORIENT from image.h */
2335 int imageFormat /* => IMAGEFORMAT from image.h */
2336 );
2337 
2338 /*---------------------------------------------------------------------------------**/
2372 (
2373 byte **imageMapPP, /* <= image map */
2374 Point2d *imageSizeP, /* <= image size */
2375 byte *redMapP, /* <= red palette entries */
2376 byte *grnMapP, /* <= green palette entries */
2377 byte *bluMapP, /* <= palette entries */
2378 int *paletteSizeP, /* <= palette size */
2379 WCharCP fileNameP, /* => input file name */
2380 DgnPlatform::ImageFileFormat fileType, /* => input file type */
2381 bool packBytes /* => pack bytes (run length encode) */
2382 );
2383 
2384 /*---------------------------------------------------------------------------------**/
2403 (
2404 byte **imagePP, /* <=> pointer to RLE bitmap (which is replaced) */
2405 Point2d *sizeP /* => size of bitmap */
2406 );
2407 
2408 /*---------------------------------------------------------------------------------**/
2433 (
2434 byte **rgbBufferPP, /* <= image buffer (RGB) */
2435 byte *mapP, /* => image map */
2436 Point2d *sizeP, /* => image size */
2437 byte *redMapP, /* => red palette entries */
2438 byte *grnMapP, /* => green palette entries */
2439 byte *bluMapP, /* => blue palette entries */
2440 bool packBytes /* => pack bytes (run length encode) */
2441 );
2442 
2443 /*---------------------------------------------------------------------------------**/
2467 (
2468 byte **imageMapPP, /* <= image map */
2469 byte *rgbBufferP, /* => image buffer (RGB) */
2470 Point2d *sizeP, /* => image size */
2471 byte *redMapP, /* => red palette entries */
2472 byte *grnMapP, /* => green palette entries */
2473 byte *bluMapP, /* => blue palette entries */
2474 int paletteSize /* => number of palette entries */
2475 );
2476 
2477 /*---------------------------------------------------------------------------------**/
2500 (
2501 byte **imageMapPP, /* <= image map to be allocated */
2502 byte *rgbBufferP, /* => image buffer (RGB) */
2503 Point2d *sizeP, /* => image size */
2504 byte *redMapP, /* => red palette entries */
2505 byte *grnMapP, /* => green palette entries */
2506 byte *bluMapP, /* => blue palette entries */
2507 int paletteSize, /* => number of palette entries */
2508 double gamma /* => gamma correction value */
2509 );
2510 
2511 /*---------------------------------------------------------------------------------**/
2539 (
2540 byte **imageMapPP, /* <= image map */
2541 byte *rgbBufferP, /* => image buffer (RGB) */
2542 Point2d *sizeP, /* => image size */
2543 byte *redMapP, /* => red palette entries */
2544 byte *grnMapP, /* => green palette entries */
2545 byte *bluMapP, /* => blue palette entries */
2546 int paletteSize, /* => number of palette entries */
2547 bool packBytes /* => pack bytes (run length encode) */
2548 );
2549 
2550 
2551 /*---------------------------------------------------------------------------------**/
2567 (
2568 byte *outP, /* <= output buffer */
2569 int *encodeSizeP, /* <= encoded size (can be NULL) */
2570 byte *inP, /* => input buffer */
2571 int rawSize /* => input buffer size */
2572 );
2573 
2574 /*---------------------------------------------------------------------------------**/
2591 (
2592 byte *outP, /* <= output buffer */
2593 byte *inP, /* => input buffer */
2594 int numDecode /* => number of bytes to decode */
2595 );
2596 
2597 /*---------------------------------------------------------------------------------**/
2619 (
2620 byte *outMapP, /* <= output image (caller malloc) */
2621 byte *inMapP, /* => source image */
2622 Point2d *sizeP, /* => image size in pixels */
2623 int bytesPerPixel /* => bytes per pixel (1=Map, 3=RGB) */
2624 );
2625 
2626 
2627 
2628 /*---------------------------------------------------------------------------------**/
2648 (
2649 byte **outputImagePP, /* <= resized output image (RGB) */
2650 Point2d *outputSizeP, /* => output size */
2651 int outRowStart, /* => starting output row */
2652 int outRowStop, /* => stopping (last) output row */
2653 byte *inputImageP, /* => input image (RGB) */
2654 Point2d *inputSizeP /* => input size */
2655 );
2656 
2657 /*---------------------------------------------------------------------------------**/
2665 (
2666 void
2667 );
2668 
2669 /*----------------------------------------------------------------------+
2670 | |
2671 | This was in MSIMGDLM.FDF for MSJ Release |
2672 | |
2673 +----------------------------------------------------------------------*/
2674 /*---------------------------------------------------------------------------------**/
2800 (
2801 WCharCP saveAsFileNameP, /* => name of file */
2802 DgnPlatform::ImageFileFormat fileType, /* => type of file (IMAGEFILE in image.h) */
2803 DgnPlatform::ImageColorMode colorMode, /* => color mode (COLORMODE in image.h) */
2804 DgnPlatform::CompressionType compressType, /* => compress type (COMPRESSTYPE in image.h) */
2805 DgnPlatform::CompressionRatio compressRatio, /* => compress ratio (COMPRESSIONRATIO in image.h) */
2806 Point2d *imageSizeP, /* => size of image */
2807 byte *imageDataP, /* => image data for each pixel (in various formats) */
2808 int imageFormat, /* => input buffer format (IMAGEFORMAT in image.h) */
2809 void *param1P, /* => pointer to parameter 1 */
2810 void *param2P, /* => pointer to parameter 2 */
2811 void *param3P, /* => pointer to parameter 3 */
2812 int paletteSize /* => number of palette entries */
2813 );
2814 
2815 /*---------------------------------------------------------------------------------**/
2829 ( /* <= IMAGEFILE_UNKNOWN if not found, otherwise IMAGEFILE_XXX */
2830 DgnPlatform::ImageFileFormat fileType, /* => file type or IMAGEFILE_UNKNOWN to find file type */
2831 WCharCP fileNameP /* => source file name */
2832 );
2833 
2834 
2835 /*---------------------------------------------------------------------------------**/
2852 (
2853 byte *rgbSeparateP, /* <= RRRGGGBBB buffer (can be same as rgbInterlacedP) */
2854 byte *rgbInterlacedP, /* => RGBRGBRGB or RGBARGBARGBA buffer (discard alpha) */
2855 Point2d *imageSizeP, /* => image size */
2856 DgnPlatform::ImageColorMode colorMode /* => either ImageColorMode::RGB or ImageColorMode::RGBA */
2857 );
2858 
2859 /*---------------------------------------------------------------------------------**/
2875 (
2876 byte *rgbInterlacedP, /* <= RGBRGBRGB or RGBARGBARGBA buffer (or NULL) */
2877 byte *rgbSeparateP, /* => RRRGGGBBB buffer (src & dst can be identical) */
2878 Point2d *imageSizeP, /* => image size */
2879 DgnPlatform::ImageColorMode colorMode /* => either ImageColorMode::RGB or ImageColorMode::RGBA */
2880 );
2881 
2882 /*---------------------------------------------------------------------------------**/
2898 (
2899 byte *bgrInterlacedP, /* <= BGRBGRBGR or BGRABGRABGRA buffer (or NULL) */
2900 byte *rgbSeparateP, /* => RRRGGGBBB buffer (src & dst can be identical) */
2901 Point2d *imageSizeP, /* => image size */
2902 DgnPlatform::ImageColorMode colorMode /* => either ImageColorMode::RGB or ImageColorMode::RGBA */
2903 );
2904 
2905 /*---------------------------------------------------------------------------------**/
2926 (
2927 void *dstDataP, /* <= destination data pointer (can be same as source) */
2928 byte *redMapP, /* <=> red palette entries (changed to greyscale if srcP == dstP) */
2929 byte *grnMapP, /* <=> green palette entries(changed to greyscale if srcP == dstP) */
2930 byte *bluMapP, /* <=> blue palette entries (changed to greyscale if srcP == dstP) */
2931 int *paletteSizeP, /* <=> number of palette entries (chged to 256 if srcP == dstP) */
2932 void *srcDataP, /* => source data pointer */
2933 Point2d *imageSizeP, /* => image size */
2934 int imageFormat /* => format of source (and destination) data */
2935 );
2936 
2937 /*---------------------------------------------------------------------------------**/
2962 (
2963 WCharCP fileNameP, /* => name of file */
2964 DgnPlatform::ImageFileFormat fileType, /* => type of file (from image.h) */
2965 Point2d *imageSizeP, /* => size of image */
2966 byte *imageDataP, /* => image data each pixel */
2967 int imageFormat, /* => format of image data */
2968 byte *redMapP, /* => red palette entries (or NULL) */
2969 byte *grnMapP, /* => green palette entries (or NULL) */
2970 byte *bluMapP, /* => blue palette entries (or NULL) */
2971 int paletteSize, /* => palette size */
2972 DgnPlatform::CompressionType compressType, /* => compression type (from image.h) */
2973 DgnPlatform::CompressionRatio compressRatio /* => compress ratio (COMPRESSIONRATIO in image.h) */
2974 );
2975 
2976 /*---------------------------------------------------------------------------------**/
3008 (
3009 int nColors, /* => number of palette entries */
3010 byte *redMapP, /* => red palette entries */
3011 byte *grnMapP, /* => green palette entries */
3012 byte *bluMapP, /* => blue palette entries */
3013 int width, /* => width of scanlines */
3014 double gammaValue /* => gamma correction value */
3015 );
3016 
3017 /*---------------------------------------------------------------------------------**/
3048 (
3049 byte *outputLineP, /* <= color map indices for each pixel */
3050 byte *redP, /* => red values for each pixel */
3051 byte *grnP, /* => green values for each pixel */
3052 byte *bluP, /* => blue values for each pixel */
3053 int width, /* => number of pixels in scanline */
3054 int channelOffset /* => number of bytes between channels */
3055 );
3056 
3057 
3058 
3060 
IMAGELIB_EXPORT int mdlImage_ditherRowWithOffset(byte *outputLineP, byte *redP, byte *grnP, byte *bluP, int width, int channelOffset)
Creates a dithered scanline from a sequence of red, green and blue pixels.
IMAGELIB_EXPORT int mdlImage_extractPackByteSubImage(byte **outRowPP, Point2d *outSizeP, byte **inRowPP, Point2d *inSizeP, BSIRect *rectP, byte *mapP)
Extracts a packbyte subimage from a larger image and stretches or decimates it to fit a user-defined ...
IMAGELIB_EXPORT void mdlImage_tintImage(byte *imageP, Point2d *imageSizeP, RgbColorDef *tintRGBP)
Tints an RGB image in format IMAGEFORMAT_RGBSeparate by adjusting values as defined below...
IMAGELIB_EXPORT int mdlImage_setMapPolygon(byte *dataP, bool *dataModifiedP, Point2d *sizeP, int imageFormat, DPoint2d *pointP, int nPoints, bool outside, int value)
Masks a polygonal area within an image.
IMAGELIB_EXPORT int mdlImage_ditherInitialize(int nColors, byte *redMapP, byte *grnMapP, byte *bluMapP, int width)
Initialization for dithering.
IMAGELIB_EXPORT int mdlImage_convertToUpperLeftHorizontal(byte **imagePP, Point2d *sizeP, int ingrOrientation, int imageFormat)
Converts an image to upper-left-horizontal orientation, so the first image pixel is the upper-left co...
IMAGELIB_EXPORT int mdlImage_rgbToBitMap(byte *bitMapP, byte *rgbP, Point2d *sizeP, int ditherMode)
Converts an RGB image to an uncompressed bitmap by dithering the color image.
IMAGELIB_EXPORT void mdlImage_paletteToGreyScale(byte *greyPaletteP, int *minGreyP, int *maxGreyP, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize)
Computes a greyscale palette from a color palette using the formula:
IMAGELIB_EXPORT StatusInt mdlImage_getExportFormatString(WCharP formatName, UInt32 formatNameLen, UInt32 formatId)
Get the corresponding string for a given ImageFileFormat.
IMAGELIB_EXPORT StatusInt mdlImage_RGBToRGBSeparate(byte *rgbSeparateP, byte *rgbInterlacedP, Point2d *imageSizeP, DgnPlatform::ImageColorMode colorMode)
Converts the specified image from RBG interlaced to RGB separated format.
wchar_t * WCharP
Definition: Bentley.h:225
#define Public
Definition: Bentley.h:161
IMAGELIB_EXPORT int mdlImage_RGBToPackByte(byte **imageMapPP, byte *rgbBufferP, Point2d *sizeP, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize)
Converts an RGB image to a packbyte compressed byte-mapped image.
IMAGELIB_EXPORT int mdlImage_extractRGBSubImage(byte *outP, Point2d *outSizeP, byte *inP, Point2d *inSizeP, BSIRect *rectP)
Extracts an RGB subimage from a larger image and stretches or decimates it to fit a user-defined outp...
IMAGELIB_EXPORT int mdlImage_stretchRLEToBitMap(byte **imagePP, Point2d *sizeP)
Replaces a run-length encoded (RLE) bitmap representation of an image with its corresponding bitmap r...
IMAGELIB_EXPORT void mdlImage_negate(byte *rgbOutP, byte *rgbInP, Point2d *sizeP)
Returns an RGB image that is the negated version of the input RGB image.
IMAGELIB_EXPORT int mdlImage_extractBitMapSubImage(byte *outMapP, Point2d *outSizeP, byte *inBitMapP, Point2d *inSizeP, BSIRect *rectP)
Extracts a bitmapped subimage from a larger image and stretches or decimates it to fit a user-defined...
IMAGELIB_EXPORT int mdlImage_subByteMapFromPackByte(byte *outMapP, Point2d *outSizeP, byte **inRowPP, Point2d *inSizeP, BSIRect *rectP, byte *mapP)
Converts a packbyte image to a byte mapped image and stretches or decimates it to fit a user-defined ...
IMAGELIB_EXPORT void mdlImage_getMapUsage(byte mapUsed[256], byte *mapP, Point2d *sizeP, bool packBytes)
Determines which palette entries are used or available in an image.
IMAGELIB_EXPORT int mdlImage_mapToRGB(byte **rgbBufferPP, byte *mapP, Point2d *sizeP, byte *redMapP, byte *grnMapP, byte *bluMapP)
Converts a mapped image to an RGB image.
IMAGELIB_EXPORT int mdlImage_extRGBToMap(byte **imageMapPP, byte *rgbBufferP, Point2d *sizeP, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize, bool packBytes)
Converts from an RGB image with format IMAGEFORMAT_RGBSeparate to a byte-mapped image with format IMA...
IMAGELIB_EXPORT int mdlImage_extractByteMapSubImage(byte *outMapP, Point2d *outSizeP, byte *inMapP, Point2d *inSizeP, BSIRect *rectP, byte *mapP)
Extracts a byte mapped subimage from a larger image and stretches or decimates it to fit a user-defin...
struct Transform * TransformP
Definition: msgeomstructs_typedefs.h:134
IMAGELIB_EXPORT int mdlImage_createRasterFile(WCharCP saveAsFileNameP, DgnPlatform::ImageFileFormat fileType, DgnPlatform::ImageColorMode colorMode, DgnPlatform::CompressionType compressType, DgnPlatform::CompressionRatio compressRatio, Point2d *imageSizeP, byte *imageDataP, int imageFormat, void *param1P, void *param2P, void *param3P, int paletteSize)
Creates a raster file of the specified name and type using the given raster data. ...
IMAGELIB_EXPORT int mdlImage_rotate(byte **outBufferPP, Point2d *outSizeP, byte *inpBufferP, Point2d *imageSizeP, int imageFormat, int rotation)
Rotates the image about the origin in a counter clockwise direction by a specified number of degrees...
IMAGELIB_EXPORT int mdlImage_extCreateFileFromRGB(WCharCP name, DgnPlatform::ImageFileFormat type, DgnPlatform::ImageColorMode colorMode, Point2d *sizeP, byte *imageBufferP, DgnPlatform::CompressionType compressType, DgnPlatform::CompressionRatio compressRatio, byte *transparencyP)
Creates the image file specified by fileName, fileType and colorMode from an RGB image, allowing compression type and transparency to be set.
IMAGELIB_EXPORT void mdlImage_tintPalette(byte *redP, byte *grnP, byte *bluP, int paletteSize, RgbColorDef *tintRGBP)
Tints each entry of an image palette by adjusting values as defined below.
IMAGELIB_EXPORT void mdlImage_setMapIfRGBMatch(byte *mapP, int value, byte *rgbP, Point2d *sizeP, RgbColorDef *matchP, bool packBytes)
Modifies a corresponding byte mapped image every time pixels in a corresponding RGB image match a spe...
IMAGELIB_EXPORT int mdlImage_byteMapToBitMap(byte *bitMapP, byte *byteMapP, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize, Point2d *sizeP, int ditherMode)
Converts an uncompressed byte-mapped color image to an uncompressed bitmap by dithering the color ima...
IMAGELIB_EXPORT StatusInt mdlImage_getImportFormatString(WCharP formatName, UInt32 formatNameLen, UInt32 formatId)
Get the corresponding string for a given ImageFileFormat.
IMAGELIB_EXPORT DgnPlatform::ImageFileFormat mdlImage_fileType(DgnPlatform::ImageFileFormat fileType, WCharCP fileNameP)
Determines the format of the specified image file.
IMAGELIB_EXPORT void mdlImage_freeImage(void *imageP, Point2d *sizeP, int imageFormat)
Frees the memory buffer identified by imageP.
IMAGELIB_EXPORT int mdlImage_extractRGBASubImage(byte *outP, Point2d *outSizeP, byte *inP, Point2d *inSizeP, BSIRect *rectP)
Extracts an RGBA subimage from a larger image and stretches or decimates it to fit a user-defined out...
IMAGELIB_EXPORT int mdlImage_readFileToRGB(byte **imageBufferPP, Point2d *imageSizeP, WCharCP name, DgnPlatform::ImageFileFormat fileType, Point2d *requestedSizeP)
Reads the image file specified by filename and fileType and returns an RGB image. ...
IMAGELIB_EXPORT int mdlImage_getExportSupport(DgnPlatform::ImageColorMode *defaultModeP, bool *rgbSupportP, bool *palette256SupportP, bool *palette16SupportP, bool *greyScaleSupportP, bool *monochromeSupportP, DgnPlatform::ImageFileFormat imageType)
For a specified image format, returns the default color mode, and whether each of the various color m...
wchar_t const * WCharCP
Definition: Bentley.h:224
IMAGELIB_EXPORT int mdlImage_createFileFromBitMap(WCharCP nameP, DgnPlatform::ImageFileFormat type, Point2d *sizeP, byte *bitMapP, bool runLengthEncode, RgbColorDef *foregroundColorP, RgbColorDef *backgroundColorP)
creates an image file from a memory bitmap.
uint32_t UInt32
Definition: Bentley.r.h:128
IMAGELIB_EXPORT int mdlImage_getExportFormat(WCharP formatName, DgnPlatform::ImageFileFormat *importTypeP, int index)
Determines if the specified image file format is supported for export.
IMAGELIB_EXPORT int mdlImage_createFileFromBuffer(WCharCP saveAsFileNameP, DgnPlatform::ImageFileFormat fileType, DgnPlatform::ImageColorMode colorMode, Point2d *sizeP, byte *imageDataP, int imageFormat, void *param1P, void *param2P, void *param3P, int paletteSize, DgnPlatform::CompressionType compressType, DgnPlatform::CompressionRatio compressRatio)
Creates a file from an image buffer by using the imageFormat to determine how to best write the file...
IMAGELIB_EXPORT void mdlImage_runLengthDecodeBitMapRow(byte *outP, UShort *inP, int nPixels)
Decodes a bitmap row from an array of UShort integers into a row in format IMAGEFORMAT_BitMap.
CompressionRatio
Definition: image.h:159
IMAGELIB_EXPORT int mdlImage_setRGBPolygon(byte *dataP, bool *dataModifiedP, Point2d *sizeP, DPoint2d *pointP, int nPoints, bool outside, RgbColorDef *colorP)
Masks a polygonal area within an image.
IMAGELIB_EXPORT int mdlImage_ditherInitializeWithGamma(int nColors, byte *redMapP, byte *grnMapP, byte *bluMapP, int width, double gammaValue)
Initialization for dithering with gamma corrected pixels.
IMAGELIB_EXPORT int mdlImage_readFileToBitMap(byte **imageBitMap, Point2d *imageSize, WCharCP fileName, DgnPlatform::ImageFileFormat fileType, bool runLengthEncode)
Reads a bitmapped image file into an image buffer and optionally run length encodes the bitmap...
IMAGELIB_EXPORT void mdlImage_negatePalette(byte *redMapP, byte *greenMapP, byte *blueMapP, int paletteSize)
Returns a negated version of the supplied color palette.
IMAGELIB_EXPORT StatusInt mdlImage_RGBSeparateToRGB(byte *rgbInterlacedP, byte *rgbSeparateP, Point2d *imageSizeP, DgnPlatform::ImageColorMode colorMode)
Converts the specified image from RBG separate to RGB interlaced format.
#define IMAGELIB_EXPORT
Definition: DgnPlatform/ExportMacros.h:82
IMAGELIB_EXPORT int mdlImage_RGBToMapWithGamma(byte **imageMapPP, byte *rgbBufferP, Point2d *sizeP, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize, double gamma)
Converts an RGB image to a mapped image, applying gamma correction to each pixel as it is converted...
IMAGELIB_EXPORT int mdlImage_getOptimizedPalette(byte *redMapP, byte *grnMapP, byte *bluMapP, int *paletteSizeP, int maxColors, byte *imageBufferP, Point2d *sizeP)
Calculates an optimized color palette for an RGB image.
IMAGELIB_EXPORT void mdlImage_applyGamma(byte *rgbOutP, byte *rgbInP, Point2d *sizeP, double gamma)
Applies gamma correction to the input RGB buffer and places the result in the output RGB buffer...
IMAGELIB_EXPORT void mdlImage_runLengthEncodeBitMapRow(UShort *outP, int *compressedSizeP, byte *inP, int nPixels)
Encodes a bitmap row in format IMAGEFORMAT_BitMap into any array of UShort integers.
IMAGELIB_EXPORT void mdlImage_applyGammaToPalette(byte *redMapP, byte *greenMapP, byte *blueMapP, int paletteSize, double gamma)
Applies gamma correction to an existing palette.
IMAGELIB_EXPORT int mdlImage_runLengthEncodeBitMap(UShort ***rlePPP, byte *bitmapP, Point2d *sizeP)
Converts a bitmap in format IMAGEFORMAT_BitMap to its run-length-encoded format IMAGEFORMAT_RLEBitMap...
IMAGELIB_EXPORT int mdlImage_memorySize(Point2d *sizeP, int imageFormat)
Returns the amount of memory initially required to hold the image in the specified image format...
IMAGELIB_EXPORT DgnPlatform::ImageFileFormat mdlImage_typeFromFile(WCharCP fileNameP)
Attempts to determine the type of file from header information within the file itself.
IMAGELIB_EXPORT int mdlImage_ditherRow(byte *outputLineP, byte *redP, byte *grnP, byte *bluP, int width)
Creates a dithered scanline from a sequence of red, green and blue pixels.
IMAGELIB_EXPORT int mdlImage_extMapToRGB(byte **rgbBufferPP, byte *mapP, Point2d *sizeP, byte *redMapP, byte *grnMapP, byte *bluMapP, bool packBytes)
Converts a byte-mapped image from IMAGEFORMAT_ByteMap or IMAGEFORMAT_PackByte format to an RGB image ...
IMAGELIB_EXPORT StatusInt mdlImage_getImageBgColor(byte *pixelP, WCharCP name)
Retrieves the background color information from the specified image file.
IMAGELIB_EXPORT int mdlImage_byteMapToGreyScale(byte *greyP, int *minGreyP, int *maxGreyP, byte *byteMapP, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize, Point2d *sizeP)
Converts an uncompressed byte-mapped color image with format IMAGFORMAT_ByteMap to a greyscale image ...
IMAGELIB_EXPORT int mdlImage_extCreateFileFromMap(WCharCP name, DgnPlatform::ImageFileFormat type, DgnPlatform::ImageColorMode colorMode, Point2d *sizeP, byte *imageMapP, byte *redPaletteP, byte *grnPaletteP, byte *bluPaletteP, int paletteSize, DgnPlatform::CompressionType compressType, DgnPlatform::CompressionRatio compressRatio, byte *transparencyP)
Creates the image file specified by fileName, fileType and colorMode from a mapped image...
IMAGELIB_EXPORT int mdlImage_resize(byte **outputImagePP, Point2d *outputSizeP, byte *inputImageP, Point2d *inputSizeP)
Compresses or expands the RGB buffer specified by inputImageP and inputSizeP to the size specified by...
unsigned short UShort
Definition: Bentley.r.h:133
#define BEGIN_EXTERN_C
Definition: Bentley.h:164
IMAGELIB_EXPORT int mdlImage_readFileInfo(Point2d *imageSizeP, DgnPlatform::ImageColorMode *colorModeP, int *orientationP, WCharCP fileName, DgnPlatform::ImageFileFormat fileType)
Returns information about the image file specified by fileName and fileType.
IMAGELIB_EXPORT StatusInt mdlImage_createMonochromeFile(WCharCP fileNameP, DgnPlatform::ImageFileFormat fileType, Point2d *imageSizeP, byte *imageDataP, int imageFormat, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize, DgnPlatform::CompressionType compressType, DgnPlatform::CompressionRatio compressRatio)
Creates a monochrome file from the specified image data.
IMAGELIB_EXPORT void mdlImage_doubleImage(byte *outMapP, byte *inMapP, Point2d *sizeP, int bytesPerPixel)
Doubles the size of the source image to produce the output image.
IMAGELIB_EXPORT int mdlImage_getOSFileType(UInt32 *osFileTypeP, DgnPlatform::ImageFileFormat imageType)
Returns the operating system file type for the specified image type.
unsigned char byte
Definition: Bentley.r.h:144
IMAGELIB_EXPORT int mdlImage_readFileToMap(byte **imageMapPP, Point2d *imageSizeP, byte *redMapP, byte *grnMapP, byte *bluMapP, int *paletteSizeP, WCharCP fileName, DgnPlatform::ImageFileFormat fileType)
Reads the mapped image file specified by fileName and fileType.
IMAGELIB_EXPORT void mdlImage_ditherCleanup(void)
Frees the internal buffers allocated during the dithering process.
IMAGELIB_EXPORT void mdlImage_unpackByteBuffer(byte *outP, byte *inP, int numDecode)
Unpacks a buffer in packbyte format to a sequence of bytes.
IMAGELIB_EXPORT void mdlImage_packByteBuffer(byte *outP, int *encodeSizeP, byte *inP, int rawSize)
Encodes a sequence of byte-mapped data into packbyte format.
#define END_EXTERN_C
Definition: Bentley.h:165
IMAGELIB_EXPORT int mdlImage_warp(byte **outPP, Point2d *outSizeP, byte *inP, Point2d *inSizeP, int imageFormat, TransformP inverseTransformP, byte *transparentP)
Warps an image by using an inverse transform from each pixel of the output image to find the correspo...
int StatusInt
Definition: Bentley.h:222
IMAGELIB_EXPORT StatusInt mdlImage_RGBSeparateToBGR(byte *bgrInterlacedP, byte *rgbSeparateP, Point2d *imageSizeP, DgnPlatform::ImageColorMode colorMode)
Converts the specified image from RBG separate to BGR interlaced format.
IMAGELIB_EXPORT int mdlImage_subByteMapFromRLEBitMap(byte *outMapP, Point2d *outSizeP, UShort **inBitMapPP, Point2d *inSizeP, BSIRect *rectP, int foreground, int background)
Converts a RLE bitmapped image to a byte mapped image and stretches or decimates it to fit a user-def...
IMAGELIB_EXPORT int mdlImage_createFileFromMap(WCharCP name, DgnPlatform::ImageFileFormat type, DgnPlatform::ImageColorMode colorMode, Point2d *sizeP, byte *imageMapP, byte *redPaletteP, byte *grnPaletteP, byte *bluPaletteP, int paletteSize)
Creates the image file specified by fileName, fileType and colorMode from a mapped image...
IMAGELIB_EXPORT void mdlImage_getBalancedPalette(byte *redMapP, byte *grnMapP, byte *bluMapP, int *numColorsP)
Calculates a balanced color palette.
ImageColorMode
Definition: DgnPlatform.r.h:1911
IMAGELIB_EXPORT int mdlImage_createFileFromRGB(WCharCP name, DgnPlatform::ImageFileFormat type, DgnPlatform::ImageColorMode colorMode, Point2d *sizeP, byte *imageBufferP)
Creates the image file specified by fileName, fileType and colorMode from an RGB image.
IMAGELIB_EXPORT int mdlImage_extractSubImage(byte *outP, Point2d *outSizeP, byte *inP, Point2d *inSizeP, BSIRect *rectP, int imageFormat)
Extracts a subimage from a larger image and stretches or decimates it to fit a user-defined output im...
IMAGELIB_EXPORT int mdlImage_subByteMapFromBitMap(byte *outMapP, Point2d *outSizeP, byte *inBitMapP, Point2d *inSizeP, BSIRect *rectP, int foreground, int background, bool rle)
Converts a bitmapped image to a byte mapped image and stretches or decimates it to fit a user-defined...
ImageFileFormat
Definition: image.h:41
IMAGELIB_EXPORT int mdlImage_extCreateMonoFileFromRGB(WCharCP name, DgnPlatform::ImageFileFormat type, Point2d *sizeP, byte *imageBufferP, DgnPlatform::CompressionType compressType, DgnPlatform::CompressionRatio compressRatio, byte *transparencyP, RgbColorDef *backgroundColorP)
Creates the monochrome image file specified by fileName, fileType from an RGB image, allowing compression type.
IMAGELIB_EXPORT int mdlImage_rgbToGreyScale(byte *greyP, int *minGreyP, int *maxGreyP, byte *rgbP, Point2d *sizeP)
Converts an RGB image to a byte-per-pixel greyscale image based on the formula:
IMAGELIB_EXPORT int mdlImage_packByteToBitMap(byte *bitMapP, byte *packByteP, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize, Point2d *sizeP, int ditherMode)
Converts a compressed byte-mapped color image to an uncompressed bitmap by dithering the color image...
IMAGELIB_EXPORT int mdlImage_getExtension(WCharP ext, DgnPlatform::ImageFileFormat type)
Returns the default three character file extension for the specified image format.
IMAGELIB_EXPORT int mdlImage_mapToRGBBuffer(byte *rgbBufferP, byte *mapP, Point2d *sizeP, byte *redMapP, byte *grnMapP, byte *bluMapP)
Converts a mapped image to an RGB image.
IMAGELIB_EXPORT int mdlImage_getImportFormat(WCharP formatName, DgnPlatform::ImageFileFormat *importTypeP, int index)
Determines if the specified image file format is supported for import.
IMAGELIB_EXPORT int mdlImage_RGBToPackByteWithGamma(byte **imageMapPP, byte *rgbBufferP, Point2d *sizeP, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize, double gamma)
Converts an RGB image to a packbyte compressed byte-mapped image and applies the supplied gamma value...
IMAGELIB_EXPORT Public void mdlImage_resizeCleanup(void)
Clean up after resizing operations performed by calling ~mmdlImage_resizeBand.
IMAGELIB_EXPORT int mdlImage_RGBToMap(byte **imageMapPP, byte *rgbBufferP, Point2d *sizeP, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize)
Converts an RGB image to a mapped image.
IMAGELIB_EXPORT int mdlImage_greyScaleToBitMap(byte *bitMapP, byte *greyP, Point2d *sizeP, int minGrey, int maxGrey, int ditherMode)
Converts an uncompressed byte-per-pixel greyscale image to an uncompressed bitmap by dithering the gr...
IMAGELIB_EXPORT int mdlImage_extReadFileToMap(byte **imageMapPP, Point2d *imageSizeP, byte *redMapP, byte *grnMapP, byte *bluMapP, int *paletteSizeP, WCharCP fileNameP, DgnPlatform::ImageFileFormat fileType, bool packBytes)
Reads a file which contains a byte-mapped image with no more than 265 color palette entries...
IMAGELIB_EXPORT Public int mdlImage_resizeBand(byte **outputImagePP, Point2d *outputSizeP, int outRowStart, int outRowStop, byte *inputImageP, Point2d *inputSizeP)
Resizes a portion of the specified image to the given size.
IMAGELIB_EXPORT DgnPlatform::ImageFileFormat mdlImage_typeFromExtension(WCharCP fileName)
Returns the file type of the specified image file.
IMAGELIB_EXPORT int mdlImage_packByteToGreyScale(byte *greyP, int *minGreyP, int *maxGreyP, byte *packByteP, byte *redMapP, byte *grnMapP, byte *bluMapP, int paletteSize, Point2d *sizeP)
Converts a compressed byte-mapped color image with format IMAGEFORMAT_PackByte to a greyscale image b...
CompressionType
Definition: image.h:175
IMAGELIB_EXPORT int mdlImage_convertToGreyScale(void *dstDataP, byte *redMapP, byte *grnMapP, byte *bluMapP, int *paletteSizeP, void *srcDataP, Point2d *imageSizeP, int imageFormat)
Converts the specified image to greyScale.
IMAGELIB_EXPORT int mdlImage_mirror(byte *inpBufferP, Point2d *imageSizeP, int imageFormat, bool vertical)
Mirrors an image by reversing the pixels, either horizontally or vertically.

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.