Changeset 337
- Timestamp:
- 03/18/07 23:28:59 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/LaserLine_2.0/Src/Interface/LZRenderedFrameView.h
r321 r337 13 13 { 14 14 NSData *rawFrameData; 15 RawPoint lastPoint; 15 16 } 16 17 trunk/LaserLine_2.0/Src/Interface/LZRenderedFrameView.m
r320 r337 16 16 if (self) { 17 17 rawFrameData = nil; 18 lastPoint = NullRawPoint; 18 19 } 19 20 return self; … … 50 51 RawPoint *points = (RawPoint *)[rawFrameData bytes]; 51 52 53 //draw line from the last fame's last point to this frame's first 54 if(count > 0) 55 { 56 [curve removeAllPoints]; 57 NSPoint point1 = NSMakePoint(lastPoint.x, lastPoint.y); 58 NSPoint point2 = NSMakePoint(points[0].x, points[0].y); 59 60 if(lastPoint.r | lastPoint.g | lastPoint.b) //only do curve if color is non-zero 61 { 62 [curve moveToPoint:point1]; 63 [curve lineToPoint:point2]; 64 65 [curve transformUsingAffineTransform:transform]; 66 67 NSColor *laserColor = [NSColor colorWithCalibratedRed:(lastPoint.r/255.) green:(lastPoint.g/255.) blue:(lastPoint.b)/255. alpha:1]; 68 69 [curve setLineWidth:400*scalingFactor]; 70 [[laserColor colorWithAlphaComponent:.5] set]; 71 [curve stroke]; 72 73 [curve setLineWidth:200*scalingFactor]; 74 [laserColor set]; 75 [curve stroke]; 76 } 77 } 78 52 79 for(i; i < count-1; i++) 53 80 { … … 60 87 [curve moveToPoint:point1]; 61 88 [curve lineToPoint:point2]; 89 90 if(i == 0 & 0) 91 [curve appendBezierPathWithOvalInRect:NSMakeRect(point1.x-300,point1.y-300,600,600)]; 62 92 63 93 [curve transformUsingAffineTransform:transform]; … … 75 105 } 76 106 107 if(count > 0) 108 lastPoint = points[count-1]; 109 77 110 [curve release]; 78 111 [transform release]; trunk/LaserLine_2.0/Src/OutputController/RawTypes.c
r320 r337 1 1 #import "RawTypes.h" 2 2 3 const RawFrame NullRawFrame = {0, 0}; 3 const RawPoint NullRawPoint = {0, 0, 0, 0, 0, 0}; 4 const RawFrame NullRawFrame = {&NullRawPoint, 0}; trunk/LaserLine_2.0/Src/OutputController/RawTypes.h
r320 r337 13 13 } RawFrame; 14 14 15 const extern RawPoint NullRawPoint; 15 16 const extern RawFrame NullRawFrame;
