Beispiel #1
0
        bool isThisInside(ref iRectangle2D otherPoint)
        {
            iPoint2D br1 = getBottomRight();
            iPoint2D br2 = otherPoint.getBottomRight();

            return(pos.x >= otherPoint.pos.x && pos.y >= otherPoint.pos.y && br1.x <= br2.x && br1.y <= br2.y);
        }
Beispiel #2
0
        iRectangle2D getOverlap(ref iRectangle2D other)
        {
            iRectangle2D overlap = new iRectangle2D();
            iPoint2D     br1     = getBottomRight();
            iPoint2D     br2     = other.getBottomRight();

            overlap.setAbsolute(Math.Max(pos.x, other.pos.x), Math.Max(pos.y, other.pos.y), Math.Min(br1.x, br2.x), Math.Min(br1.y, br2.y));
            return(overlap);
        }
Beispiel #3
0
        iRectangle2D combine(ref iRectangle2D other)
        {
            iRectangle2D combined = new iRectangle2D();
            iPoint2D     br1      = getBottomRight();
            iPoint2D     br2      = other.getBottomRight();

            combined.setAbsolute(Math.Min(pos.x, other.pos.x), Math.Min(pos.y, other.pos.y), Math.Max(br1.x, br2.x), Math.Max(br2.y, br2.y));
            return(combined);
        }
Beispiel #4
0
 RawImage create(iPoint2D dim, RawImageType type, UInt32 componentsPerPixel)
 {
     switch (type)
     {
         case TYPE_USHORT16:
             return new RawImageDataU16(dim, componentsPerPixel);
         default:
             Debug.Write("RawImage::create: Unknown Image type!\n");
             break;
     }
     return null;
 }
Beispiel #5
0
        public RawImageData(iPoint2D _dim, UInt32 _bpc, UInt32 _cpp)
        {

            dim = (_dim); isCFA = (_cpp == 1); cfa = (new iPoint2D(0, 0));
            blackLevel = (-1); whitePoint = (65536);
            cpp = (_cpp); bpp = (_bpc * _cpp);
            blackLevelSeparate[0] = blackLevelSeparate[1] = blackLevelSeparate[2] = blackLevelSeparate[3] = -1;
            mBadPixelMap = null;
            mDitherScale = true;
            createData();
            pthread_mutex_init(&mymutex, null);
            pthread_mutex_init(&errMutex, null);
            pthread_mutex_init(&mBadPixelMutex, null);
        }
Beispiel #6
0
        public RawImageData()
        {

            dim = new iPoint2D(0, 0);
            isCFA = (true);
            cfa = (new iPoint2D(0, 0));
            blackLevel = (-1);
            whitePoint = (65536);
            blackLevelSeparate[0] = blackLevelSeparate[1] = blackLevelSeparate[2] = blackLevelSeparate[3] = -1;
            pthread_mutex_init(&mymutex, null);
            mBadPixelMap = null;
            pthread_mutex_init(&errMutex, null);
            pthread_mutex_init(&mBadPixelMutex, null);
            mDitherScale = true;
        }
Beispiel #7
0
        /* This will make sure that offset is positive, and make the area smaller if needed */
        /* This will return true if there is any area left */
        bool cropOffsetToZero()
        {
            iPoint2D crop_pixels = new iPoint2D();

            if (pos.x < 0)
            {
                crop_pixels.x = -(pos.x);
                pos.x         = 0;
            }
            if (pos.y < 0)
            {
                crop_pixels.y = -pos.y;
                pos.y         = 0;
            }
            dim -= crop_pixels;
            return(cropArea());
        }
Beispiel #8
0
 /* Set BR  */
 void setBottomRightAbsolute(iPoint2D bottom_right)
 {
     dim = new iPoint2D(bottom_right) - pos;
 }
Beispiel #9
0
 void offset(iPoint2D offset)
 {
     pos += offset;
 }
Beispiel #10
0
 iRectangle2D(iPoint2D _pos, iPoint2D size)
 {
     dim = size; pos = _pos;
 }
Beispiel #11
0
 iRectangle2D(iRectangle2D r)
 {
     dim = new iPoint2D(r.dim); pos = new iPoint2D(r.pos);
 }
Beispiel #12
0
 iRectangle2D(int x_pos, int y_pos, int w, int h)
 {
     dim = new iPoint2D(w, h); pos = new iPoint2D(x_pos, y_pos);
 }
Beispiel #13
0
 iRectangle2D(int w, int h)
 {
     dim = new iPoint2D(w, h);
 }
Beispiel #14
0
 public iPoint2D getSmallest(iPoint2D otherPoint)
 {
     return(new iPoint2D(Math.Min(x, otherPoint.x), Math.Min(y, otherPoint.y)));
 }
Beispiel #15
0
 /* Retains size */
 void setTopLeft(iPoint2D top_left)
 {
     pos = top_left;
 }
Beispiel #16
0
 public iPoint2D(iPoint2D pt)
 {
     x = pt.x; y = pt.y;
 }
Beispiel #17
0
 void setSize(iPoint2D size)
 {
     dim = size;
 }
Beispiel #18
0
 void setAbsolute(iPoint2D top_left, iPoint2D bottom_right)
 {
     pos = top_left; setBottomRightAbsolute(bottom_right);
 }
Beispiel #19
0
 void setAbsolute(int x1, int y1, int x2, int y2)
 {
     pos = new iPoint2D(x1, y1); dim = new iPoint2D(x2 - x1, y2 - y1);
 }
Beispiel #20
0
 public bool isThisInside(iPoint2D otherPoint)
 {
     return(x <= otherPoint.x && y <= otherPoint.y);
 }
Beispiel #21
0
        bool isPointInside(iPoint2D checkPoint)
        {
            iPoint2D br1 = getBottomRight();

            return(pos.x <= checkPoint.x && pos.y <= checkPoint.y && br1.x >= checkPoint.x && br1.y >= checkPoint.y);
        }