Skip to content
Snippets Groups Projects
Commit e15de401 authored by evenp's avatar evenp
Browse files

Expes: script ytimes.c fixed

parent 1a08945e
No related branches found
No related tags found
No related merge requests found
...@@ -14,9 +14,9 @@ DirectionalScanner *ScannerProvider::getScanner (Pt2i p1, Pt2i p2, ...@@ -14,9 +14,9 @@ DirectionalScanner *ScannerProvider::getScanner (Pt2i p1, Pt2i p2,
{ {
// Enforces P1 to be lower than P2 // Enforces P1 to be lower than P2
// or to left of P2 in case of equality // or to left of P2 in case of equality
lastScanReversed = (p1.y () > p2.y ()) last_scan_reversed = (p1.y () > p2.y ())
|| ((p1.y () == p2.y ()) && (p1.x () > p2.x ())); || ((p1.y () == p2.y ()) && (p1.x () > p2.x ()));
if (lastScanReversed) if (last_scan_reversed)
{ {
Pt2i tmp (p1); Pt2i tmp (p1);
p1.set (p2); p1.set (p2);
...@@ -122,7 +122,8 @@ DirectionalScanner *ScannerProvider::getScanner (Pt2i centre, Vr2i normal, ...@@ -122,7 +122,8 @@ DirectionalScanner *ScannerProvider::getScanner (Pt2i centre, Vr2i normal,
// Orients rightwards // Orients rightwards
int a = normal.x (); int a = normal.x ();
int b = normal.y (); // as equation is (ax + by = c) int b = normal.y (); // as equation is (ax + by = c)
if (a < 0 || (a == 0 && b < 0)) last_scan_reversed = (a < 0 || (a == 0 && b < 0));
if (last_scan_reversed)
{ {
a = -a; a = -a;
b = -b; b = -b;
......
...@@ -17,7 +17,7 @@ public: ...@@ -17,7 +17,7 @@ public:
/** /**
* \brief Builds a directional scanner provider. * \brief Builds a directional scanner provider.
*/ */
ScannerProvider () : isOrtho (false), lastScanReversed (false), ScannerProvider () : isOrtho (false), last_scan_reversed (false),
xmin (0), ymin (0), xmax (100), ymax (100) { } xmin (0), ymin (0), xmax (100), ymax (100) { }
/** /**
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
* The scan strip is composed of parallel scans (line segments), * The scan strip is composed of parallel scans (line segments),
* the first one defined by its center, its direct vector, and its length. * the first one defined by its center, its direct vector, and its length.
* @param centre Initial scan center. * @param centre Initial scan center.
* @param normal Initial scan direct vector. * @param normal Initial scan director vector.
* @param length Initial scan length. * @param length Initial scan length.
* @param controlable Control modality (true for an adaptive scanner). * @param controlable Control modality (true for an adaptive scanner).
*/ */
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
/** /**
* \brief Returns whether the currently used scan end points were permutated. * \brief Returns whether the currently used scan end points were permutated.
*/ */
inline bool isLastScanReversed () const { return lastScanReversed; } inline bool isLastScanReversed () const { return last_scan_reversed; }
/** /**
* \brief Sets the orthogonal scanner modality. * \brief Sets the orthogonal scanner modality.
...@@ -78,7 +78,7 @@ private: ...@@ -78,7 +78,7 @@ private:
/** Orthogonal scanner modality. */ /** Orthogonal scanner modality. */
bool isOrtho; bool isOrtho;
/** Last scan end points permutation modality. */ /** Last scan end points permutation modality. */
bool lastScanReversed; bool last_scan_reversed;
/** Scan area lowest x coordinate. */ /** Scan area lowest x coordinate. */
int xmin; int xmin;
......
...@@ -14,9 +14,9 @@ DirectionalScanner *ScannerProvider::getScanner (Pt2i p1, Pt2i p2, ...@@ -14,9 +14,9 @@ DirectionalScanner *ScannerProvider::getScanner (Pt2i p1, Pt2i p2,
{ {
// Enforces P1 to be lower than P2 // Enforces P1 to be lower than P2
// or to left of P2 in case of equality // or to left of P2 in case of equality
lastScanReversed = (p1.y () > p2.y ()) last_scan_reversed = (p1.y () > p2.y ())
|| ((p1.y () == p2.y ()) && (p1.x () > p2.x ())); || ((p1.y () == p2.y ()) && (p1.x () > p2.x ()));
if (lastScanReversed) if (last_scan_reversed)
{ {
Pt2i tmp (p1); Pt2i tmp (p1);
p1.set (p2); p1.set (p2);
...@@ -122,7 +122,8 @@ DirectionalScanner *ScannerProvider::getScanner (Pt2i centre, Vr2i normal, ...@@ -122,7 +122,8 @@ DirectionalScanner *ScannerProvider::getScanner (Pt2i centre, Vr2i normal,
// Orients rightwards // Orients rightwards
int a = normal.x (); int a = normal.x ();
int b = normal.y (); // as equation is (ax + by = c) int b = normal.y (); // as equation is (ax + by = c)
if (a < 0 || (a == 0 && b < 0)) last_scan_reversed = (a < 0 || (a == 0 && b < 0));
if (last_scan_reversed)
{ {
a = -a; a = -a;
b = -b; b = -b;
......
...@@ -17,7 +17,7 @@ public: ...@@ -17,7 +17,7 @@ public:
/** /**
* \brief Builds a directional scanner provider. * \brief Builds a directional scanner provider.
*/ */
ScannerProvider () : isOrtho (false), lastScanReversed (false), ScannerProvider () : isOrtho (false), last_scan_reversed (false),
xmin (0), ymin (0), xmax (100), ymax (100) { } xmin (0), ymin (0), xmax (100), ymax (100) { }
/** /**
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
* The scan strip is composed of parallel scans (line segments), * The scan strip is composed of parallel scans (line segments),
* the first one defined by its center, its direct vector, and its length. * the first one defined by its center, its direct vector, and its length.
* @param centre Initial scan center. * @param centre Initial scan center.
* @param normal Initial scan direct vector. * @param normal Initial scan director vector.
* @param length Initial scan length. * @param length Initial scan length.
* @param controlable Control modality (true for an adaptive scanner). * @param controlable Control modality (true for an adaptive scanner).
*/ */
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
/** /**
* \brief Returns whether the currently used scan end points were permutated. * \brief Returns whether the currently used scan end points were permutated.
*/ */
inline bool isLastScanReversed () const { return lastScanReversed; } inline bool isLastScanReversed () const { return last_scan_reversed; }
/** /**
* \brief Sets the orthogonal scanner modality. * \brief Sets the orthogonal scanner modality.
...@@ -78,7 +78,7 @@ private: ...@@ -78,7 +78,7 @@ private:
/** Orthogonal scanner modality. */ /** Orthogonal scanner modality. */
bool isOrtho; bool isOrtho;
/** Last scan end points permutation modality. */ /** Last scan end points permutation modality. */
bool lastScanReversed; bool last_scan_reversed;
/** Scan area lowest x coordinate. */ /** Scan area lowest x coordinate. */
int xmin; int xmin;
......
...@@ -135,10 +135,10 @@ int main (int argc, char *argv[]) ...@@ -135,10 +135,10 @@ int main (int argc, char *argv[])
} }
else if (tir[j] == 3) // fbsd else if (tir[j] == 3) // fbsd
{ {
sprintf (val, "\\cp Images/%s/%s.jpg %sData/image.jpg", sprintf (val, "\\cp Images/%s/%s.jpg %s%sData/image.jpg",
ims[i], ims[i], FBSD_DIR); ims[i], ims[i], EXPES_DIR, FBSD_DIR);
fprintf (fcom, "%s\n", val); fprintf (fcom, "%s\n", val);
sprintf (val, "cd %s", FBSD_DIR); sprintf (val, "cd %s%s", EXPES_DIR, FBSD_DIR);
fprintf (fcom, "%s\n", val); fprintf (fcom, "%s\n", val);
sprintf (val, "echo 'TIMING %d (%s) on fbsd'", (i+1), ims[i]); sprintf (val, "echo 'TIMING %d (%s) on fbsd'", (i+1), ims[i]);
fprintf (fcom, "%s\n", val); fprintf (fcom, "%s\n", val);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment