Example #1
0
        //グラディエント(一次微分)エッジ検出
        public static Bitmap Gradient(Bitmap bmp, COLORMODE cmode)
        {
            float[,] ope1 = new float[3, 3] {
                { -1, 0, 1 },
                { -1, 0, 1 },
                { -1, 0, 1 }
            };
            float[,] ope2 = new float[3, 3] {
                { -1, -1, -1 },
                { 0, 0, 0 },
                { 1, 1, 1 }
            };
            switch (cmode)
            {
            case COLORMODE.BRIGHTNESS:
                return(_filtering(bmp, ope1, ope2));

            case COLORMODE.RGB:
                return(_filteringRGB(bmp, ope1, ope2));

            case COLORMODE.HSV:
                return(_filteringHSV(bmp, ope1, ope2));

            default:
                throw new Exception();
            }
        }
Example #2
0
        public MultipassBitmap AddLayer(MultipassBitmap insertafter, COLORMODE colormode, bool hidden)
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.MultipassBitmap_AddLayer__SWIG_0(swigCPtr, MultipassBitmap.getCPtr(insertafter), (int)colormode, hidden);
            MultipassBitmap       ret  = (cPtr == global::System.IntPtr.Zero) ? null : new MultipassBitmap(cPtr, false);

            return(ret);
        }
Example #3
0
        public static MultipassBitmap Alloc(int bx, int by, COLORMODE mode)
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.MultipassBitmap_Alloc(bx, by, (int)mode);
            MultipassBitmap       ret  = (cPtr == global::System.IntPtr.Zero) ? null : new MultipassBitmap(cPtr, false);

            return(ret);
        }
Example #4
0
        //ラプラシアン(二次微分)エッジ検出
        public static Bitmap Laplacian(Bitmap bmp, COLORMODE cmode)
        {
            float[,] ope = new float[3, 3] {
                { 1, 1, 1 },
                { 1, -8, 1 },
                { 1, 1, 1 }
            };
            switch (cmode)
            {
            case COLORMODE.BRIGHTNESS:
                return(_filtering(bmp, ope));

            case COLORMODE.RGB:
                return(_filteringRGB(bmp, ope));

            case COLORMODE.HSV:
                return(_filteringHSV(bmp, ope));

            default:
                throw new Exception();
            }
        }
Example #5
0
 public static MultipassBitmap Alloc(int bx, int by, COLORMODE mode) {
   IntPtr cPtr = C4dApiPINVOKE.MultipassBitmap_Alloc(bx, by, (int)mode);
   MultipassBitmap ret = (cPtr == IntPtr.Zero) ? null : new MultipassBitmap(cPtr, false);
   return ret;
 }
Example #6
0
        public COLORMODE GetColorMode()
        {
            COLORMODE ret = (COLORMODE)C4dApiPINVOKE.BaseBitmap_GetColorMode(swigCPtr);

            return(ret);
        }
Example #7
0
 public void GetPixelCnt(int x, int y, int cnt, SWIGTYPE_p_UChar buffer, int inc, COLORMODE dstmode, PIXELCNT flags)
 {
     C4dApiPINVOKE.BaseBitmap_GetPixelCnt__SWIG_1(swigCPtr, x, y, cnt, SWIGTYPE_p_UChar.getCPtr(buffer), inc, (int)dstmode, (int)flags);
 }
Example #8
0
 public void GetPixelCnt(int x, int y, int cnt, SWIGTYPE_p_UChar buffer, int inc, COLORMODE dstmode, PIXELCNT flags, ColorProfileConvert conversion)
 {
     C4dApiPINVOKE.BaseBitmap_GetPixelCnt__SWIG_0(swigCPtr, x, y, cnt, SWIGTYPE_p_UChar.getCPtr(buffer), inc, (int)dstmode, (int)flags, ColorProfileConvert.getCPtr(conversion));
 }
Example #9
0
 public bool CheckColorMode(COLORMODE colormode) {
   bool ret = C4dApiPINVOKE.ColorProfile_CheckColorMode(swigCPtr, (int)colormode);
   return ret;
 }
Example #10
0
 public bool PrepareTransform(COLORMODE srccolormode, ColorProfile srcprofile, COLORMODE dstcolormode, ColorProfile dstprofile, bool bgr) {
   bool ret = C4dApiPINVOKE.ColorProfileConvert_PrepareTransform(swigCPtr, (int)srccolormode, ColorProfile.getCPtr(srcprofile), (int)dstcolormode, ColorProfile.getCPtr(dstprofile), bgr);
   return ret;
 }
Example #11
0
 public void SetColorMode(COLORMODE mode)
 {
     C4dApiPINVOKE.MultipassBitmap_SetColorMode(swigCPtr, (int)mode);
 }
Example #12
0
 public void GetPixelCnt(int x, int y, int cnt, SWIGTYPE_p_UCHAR buffer, int inc, COLORMODE dstmode, PIXELCNT flags) {
   C4dApiPINVOKE.BaseBitmap_GetPixelCnt__SWIG_1(swigCPtr, x, y, cnt, SWIGTYPE_p_UCHAR.getCPtr(buffer), inc, (int)dstmode, (int)flags);
 }
Example #13
0
 public void GetPixelCnt(int x, int y, int cnt, SWIGTYPE_p_UCHAR buffer, int inc, COLORMODE dstmode, PIXELCNT flags, ColorProfileConvert conversion) {
   C4dApiPINVOKE.BaseBitmap_GetPixelCnt__SWIG_0(swigCPtr, x, y, cnt, SWIGTYPE_p_UCHAR.getCPtr(buffer), inc, (int)dstmode, (int)flags, ColorProfileConvert.getCPtr(conversion));
 }
Example #14
0
 public bool SetPixelCnt(int x, int y, int cnt, SWIGTYPE_p_UCHAR buffer, int inc, COLORMODE srcmode, PIXELCNT flags) {
   bool ret = C4dApiPINVOKE.BaseBitmap_SetPixelCnt(swigCPtr, x, y, cnt, SWIGTYPE_p_UCHAR.getCPtr(buffer), inc, (int)srcmode, (int)flags);
   return ret;
 }
Example #15
0
 public MultipassBitmap AddLayer(MultipassBitmap insertafter, COLORMODE colormode) {
   IntPtr cPtr = C4dApiPINVOKE.MultipassBitmap_AddLayer__SWIG_1(swigCPtr, MultipassBitmap.getCPtr(insertafter), (int)colormode);
   MultipassBitmap ret = (cPtr == IntPtr.Zero) ? null : new MultipassBitmap(cPtr, false);
   return ret;
 }
Example #16
0
        public bool SetPixelCnt(int x, int y, int cnt, SWIGTYPE_p_UChar buffer, int inc, COLORMODE srcmode, PIXELCNT flags)
        {
            bool ret = C4dApiPINVOKE.BaseBitmap_SetPixelCnt(swigCPtr, x, y, cnt, SWIGTYPE_p_UChar.getCPtr(buffer), inc, (int)srcmode, (int)flags);

            return(ret);
        }
Example #17
0
        public bool CheckColorMode(COLORMODE colormode)
        {
            bool ret = C4dApiPINVOKE.ColorProfile_CheckColorMode(swigCPtr, (int)colormode);

            return(ret);
        }
Example #18
0
        public bool PrepareTransform(COLORMODE srccolormode, ColorProfile srcprofile, COLORMODE dstcolormode, ColorProfile dstprofile, bool bgr)
        {
            bool ret = C4dApiPINVOKE.ColorProfileConvert_PrepareTransform(swigCPtr, (int)srccolormode, ColorProfile.getCPtr(srcprofile), (int)dstcolormode, ColorProfile.getCPtr(dstprofile), bgr);

            return(ret);
        }