Skip to content

Commit

Permalink
Fix Network declarations with GRAPHICS_DISABLED
Browse files Browse the repository at this point in the history
  • Loading branch information
voyageur committed Jan 27, 2017
1 parent 8aeb73e commit 4c39775
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lstm/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,27 +282,31 @@ double Network::Random(double range) {
return randomizer_->SignedRand(range);
}

#ifndef GRAPHICS_DISABLED
// === Debug image display methods. ===
// Displays the image of the matrix to the forward window.
void Network::DisplayForward(const NetworkIO& matrix) {
#ifndef GRAPHICS_DISABLED // do nothing if there's no graphics
Pix* image = matrix.ToPix();
ClearWindow(false, name_.string(), pixGetWidth(image),
pixGetHeight(image), &forward_win_);
DisplayImage(image, forward_win_);
forward_win_->Update();
#endif // GRAPHICS_DISABLED
}

// Displays the image of the matrix to the backward window.
void Network::DisplayBackward(const NetworkIO& matrix) {
#ifndef GRAPHICS_DISABLED // do nothing if there's no graphics
Pix* image = matrix.ToPix();
STRING window_name = name_ + "-back";
ClearWindow(false, window_name.string(), pixGetWidth(image),
pixGetHeight(image), &backward_win_);
DisplayImage(image, backward_win_);
backward_win_->Update();
#endif // GRAPHICS_DISABLED
}

#ifndef GRAPHICS_DISABLED
// Creates the window if needed, otherwise clears it.
void Network::ClearWindow(bool tess_coords, const char* window_name,
int width, int height, ScrollView** window) {
Expand Down

0 comments on commit 4c39775

Please sign in to comment.