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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
public static int pixcmapGetFreeCount(this PixColormap cmap) { if (null == cmap) { throw new ArgumentNullException("cmap cannot be null"); } return(Native.DllImports.pixcmapGetFreeCount((HandleRef)cmap)); }
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)); }
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)); }
public static int pixcmapConvertHSVToRGB(this PixColormap cmap) { if (null == cmap) { throw new ArgumentNullException("cmap cannot be null."); } return(Native.DllImports.pixcmapConvertHSVToRGB((HandleRef)cmap)); }
// 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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
// 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)); }
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)); }
// 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)); }
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)); }
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)); }
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)); }
/// <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)); }
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)); }
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); }
// 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); }