You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.7KB

  1. #include "TSScopeBase.hpp"
  2. // List of what global effects to offer on each waveform.
  3. const GlobalEffect* SCOPE_GLOBAL_EFFECTS[TROWA_NUM_GLOBAL_EFFECTS] = {
  4. new GlobalEffect("SRC-OVR",NVG_SOURCE_OVER), //destination + source
  5. new GlobalEffect("DEST-OUT",NVG_DESTINATION_OUT), //destination - source
  6. new GlobalEffect("LIGHT",NVG_LIGHTER), //destination + source + lighter(source & destination)
  7. new GlobalEffect("XOR",NVG_XOR), //source ^ destination
  8. new GlobalEffect("SRC-ATOP",NVG_ATOP), //destination + (source & destination)
  9. new GlobalEffect("DEST-OVR",NVG_DESTINATION_OVER), //source + destination
  10. new GlobalEffect("SRC-IN",NVG_SOURCE_IN), //destination & source
  11. new GlobalEffect("SRC-OUT",NVG_SOURCE_OUT), //source - destination
  12. new GlobalEffect("DEST-IN",NVG_DESTINATION_IN), //source & destination
  13. new GlobalEffect("DEST-ATOP",NVG_DESTINATION_ATOP), //source + (destination & source)
  14. new GlobalEffect("COPY",NVG_COPY) //source
  15. };
  16. // Gets where the point is.
  17. uint8_t GetPointLocationCode(Vec pt, float minX, float maxX, float minY, float maxY)
  18. {
  19. uint8_t code = POINT_POS_INSIDE;
  20. if (pt.x < minX)
  21. code = code | POINT_POS_LEFT;
  22. else if (pt.x > maxX)
  23. code = code | POINT_POS_RIGHT;
  24. if (pt.y < minY)
  25. code = code | POINT_POS_BOTTOM;
  26. else if (pt.y > maxY)
  27. code = code | POINT_POS_TOP;
  28. return code;
  29. }
  30. // Get where the point is.
  31. uint8_t GetPointLocationCode(Vec pt, Vec minBounds, Vec maxBounds)
  32. {
  33. uint8_t code = POINT_POS_INSIDE;
  34. if (pt.x < minBounds.x)
  35. code = code | POINT_POS_LEFT;
  36. else if (pt.x > maxBounds.x)
  37. code = code | POINT_POS_RIGHT;
  38. if (pt.y < minBounds.y)
  39. code = code | POINT_POS_BOTTOM;
  40. else if (pt.y > maxBounds.y)
  41. code = code | POINT_POS_TOP;
  42. return code;
  43. }