示例#1
0
        public static int pixcmapAddRGBA(this PixColormap cmap, int rval, int gval, int bval, int aval)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapAddRGBA((HandleRef)cmap, rval, gval, bval, aval));
        }
示例#2
0
        public static int pixcmapGetDistanceToColor(this PixColormap cmap, int index, int rval, int gval, int bval, out int pdist)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapGetDistanceToColor((HandleRef)cmap, index, rval, gval, bval, out pdist));
        }
示例#3
0
        public static int pixcmapCountGrayColors(this PixColormap cmap, out int pngray)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapCountGrayColors((HandleRef)cmap, out pngray));
        }
示例#4
0
        public static int pixcmapGetRankIntensity(this PixColormap cmap, float rankval, out int pindex)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapGetRankIntensity((HandleRef)cmap, rankval, out pindex));
        }
示例#5
0
        public static int pixcmapHasColor(this PixColormap cmap, out int pcolor)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapHasColor((HandleRef)cmap, out pcolor));
        }
示例#6
0
        public static int pixcmapIsBlackAndWhite(this PixColormap cmap, out int pblackwhite)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapIsBlackAndWhite((HandleRef)cmap, out pblackwhite));
        }
示例#7
0
        public static int pixcmapGetRGBA32(this PixColormap cmap, int index, out int pval32)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapGetRGBA32((HandleRef)cmap, index, out pval32));
        }
示例#8
0
        public static int pixcmapSetAlpha(this PixColormap cmap, int index, int aval)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapSetAlpha((HandleRef)cmap, index, aval));
        }
示例#9
0
        public static int pixcmapGetMinDepth(this PixColormap cmap, out int pmindepth)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapGetMinDepth((HandleRef)cmap, out pmindepth));
        }
示例#10
0
        public static int pixcmapGetFreeCount(this PixColormap cmap)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapGetFreeCount((HandleRef)cmap));
        }
示例#11
0
        public static int pixcmapAddBlackOrWhite(this PixColormap cmap, int color, out int pindex)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapAddBlackOrWhite((HandleRef)cmap, color, out pindex));
        }
示例#12
0
        public static int pixcmapUsableColor(this PixColormap cmap, int rval, int gval, int bval, out int pusable)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapUsableColor((HandleRef)cmap, rval, gval, bval, out pusable));
        }
示例#13
0
        public static int pixcmapConvertHSVToRGB(this PixColormap cmap)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null.");
            }

            return(Native.DllImports.pixcmapConvertHSVToRGB((HandleRef)cmap));
        }
示例#14
0
        // Get filled octcube table from colormap
        public static IntPtr pixcmapToOctcubeLUT(PixColormap cmap, int level, int metric)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null.");
            }

            return(Native.DllImports.pixcmapToOctcubeLUT((HandleRef)cmap, level, metric));
        }
示例#15
0
        public static int pixcmapGetNearestGrayIndex(this PixColormap cmap, int val, out int pindex)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapGetNearestGrayIndex((HandleRef)cmap, val, out pindex));
        }
示例#16
0
        public static int pixcmapShiftByComponent(this PixColormap cmap, uint srcval, uint dstval)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapShiftByComponent((HandleRef)cmap, srcval, dstval));
        }
示例#17
0
        public static int pixcmapGetRangeValues(this PixColormap cmap, int select, out int pminval, out int pmaxval, out int pminindex, out int pmaxindex)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapGetRangeValues((HandleRef)cmap, select, out pminval, out pmaxval, out pminindex, out pmaxindex));
        }
示例#18
0
        public static int pixcmapContrastTRC(this PixColormap cmap, float factor)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapContrastTRC((HandleRef)cmap, factor));
        }
示例#19
0
        public static int pixcmapShiftIntensity(this PixColormap cmap, float fraction)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapShiftIntensity((HandleRef)cmap, fraction));
        }
示例#20
0
        public static int pixcmapSerializeToMemory(this PixColormap cmap, int cpc, out int pncolors, out IntPtr pdata)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapSerializeToMemory((HandleRef)cmap, cpc, out pncolors, out pdata));
        }
示例#21
0
        // Colormap transforms
        public static int pixcmapGammaTRC(this PixColormap cmap, float gamma, int minval, int maxval)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapGammaTRC((HandleRef)cmap, gamma, minval, maxval));
        }
示例#22
0
        public static int pixcmapToRGBTable(this PixColormap cmap, out IntPtr ptab, out int pncolors)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapToRGBTable((HandleRef)cmap, out ptab, out pncolors));
        }
示例#23
0
        // Extract colormap arrays and serialization
        public static int pixcmapToArrays(this PixColormap cmap, out IntPtr prmap, out IntPtr pgmap, out IntPtr pbmap, out IntPtr pamap)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapToArrays((HandleRef)cmap, out prmap, out pgmap, out pbmap, out pamap));
        }
示例#24
0
        public static int pixcmapWriteMem(out IntPtr pdata, out IntPtr psize, PixColormap cmap)
        {
            if (null == cmap)
            {
                throw new ArgumentNullException("cmap cannot be null");
            }

            return(Native.DllImports.pixcmapWriteMem(out pdata, out psize, (HandleRef)cmap));
        }
示例#25
0
        public static int pixcmapWriteStream(IntPtr fp, PixColormap cmap)
        {
            if (IntPtr.Zero == fp ||
                null == cmap)
            {
                throw new ArgumentNullException("fp, cmap cannot be null");
            }

            return(Native.DllImports.pixcmapWriteStream(fp, (HandleRef)cmap));
        }
示例#26
0
        public static int pixcmapWrite(string filename, PixColormap cmap)
        {
            if (string.IsNullOrWhiteSpace(filename) ||
                null == cmap)
            {
                throw new ArgumentNullException("filename, cmap cannot be null");
            }

            return(Native.DllImports.pixcmapWrite(filename, (HandleRef)cmap));
        }
示例#27
0
        /// <summary>
        ///      (1) Unlike with the pix data field, pixSetColormap() destroys
        /// any existing colormap before assigning the new one.
        ///          Because colormaps are not ref counted, it is important that
        /// the new colormap does not belong to any other pix.
        /// </summary>
        /// <param name="pix"></param>
        /// <param name="colormap">to be assigned</param>
        /// <returns>false if OK, true on error</returns>
        public static bool pixSetColormap(this Pix pix, PixColormap colormap)
        {
            if (null == pix ||
                null == colormap)
            {
                throw new ArgumentNullException("pix, colormap cannot be null");
            }

            return(Native.DllImports.pixSetColormap((HandleRef)pix, (HandleRef)colormap));
        }
示例#28
0
        public static int cmapEqual(this PixColormap cmap1, PixColormap cmap2, int ncomps, out int psame)
        {
            if (null == cmap1 ||
                null == cmap2)
            {
                throw new ArgumentNullException("cmap1, pix2 cannot be null.");
            }

            return(Native.DllImports.cmapEqual((HandleRef)cmap1, (HandleRef)cmap2, ncomps, out psame));
        }
示例#29
0
        public static void pixcmapDestroy(this PixColormap pcmap)
        {
            if (null == pcmap)
            {
                throw new ArgumentNullException("pcmap cannot be null");
            }

            var pointer = (IntPtr)pcmap;

            Native.DllImports.pixcmapDestroy(ref pointer);
        }
示例#30
0
        // Find the most "populated" colors in the image(and quantize)
        public static int pixGetMostPopulatedColors(this Pix pixs, int sigbits, int factor, int ncolors, out IntPtr parray, out PixColormap pcmap)
        {
            if (null == pixs)
            {
                throw new ArgumentNullException("pixs cannot be null.");
            }

            IntPtr pcmapPtr;
            var    result = Native.DllImports.pixGetMostPopulatedColors((HandleRef)pixs, sigbits, factor, ncolors, out parray, out pcmapPtr);

            pcmap = new PixColormap(pcmapPtr);

            return(result);
        }