Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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);
        }
Example #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);
        }