Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brayns 300 replace free image #942

Merged
merged 25 commits into from
Dec 14, 2021
Merged

Conversation

Adrien4193
Copy link
Contributor

@Adrien4193 Adrien4193 commented Dec 7, 2021

  • Image API implemented under brayns/utils/image.
  • ImageCodec interface to register image formats using ImageCodecRegistry.
  • JPEG and PNG support using stb_image.
  • Removed brayns IBL from the build.
  • Removed some parts of the texture API to be able to compile.
  • Removed perceptualdiff
  • Re-render test images with stbi and update image validation process.
  • Enabled warnings for building tests.

@NadirRoGue
Copy link
Contributor

retest this please

@Adrien4193
Copy link
Contributor Author

retest this please

static bool validate(const brayns::Image &image,
const std::string &filename)
{
std::cout << "Validation of image '" << filename << "'.\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these cout messages needed for tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah maybe not, there were some of them before and I replaced it by some debug info like the full file path of the template and the comparison between the evaluation and the threshold to have an idea of what is going on when a test fails.
You think it is better without ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the tests themselves should suffice. If we ever encounter a problem, we can manually add prints for debugging, but I think they are not necessary as part of the tests output

const brayns::Image &reference)
{
auto evaluation = _evaluate(image, reference);
std::cout << "Evaluation result: " << evaluation << ".\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these cout messages needed for tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah maybe not, there were some of them before and I replaced it by some debug info like the full file path of the template and the comparison between the evaluation and the threshold to have an idea of what is going on when a test fails.
You think it is better without ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the tests themselves should suffice. If we ever encounter a problem, we can manually add prints for debugging, but I think they are not necessary as part of the tests output

@NadirRoGue
Copy link
Contributor

retest this please

@NadirRoGue
Copy link
Contributor

retest this please

1 similar comment
@NadirRoGue
Copy link
Contributor

retest this please

Copy link
Contributor

@NadirRoGue NadirRoGue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

#pragma GCC diagnostic ignored "-Wmissing-field-initializers"

#define STB_IMAGE_IMPLEMENTATION
#include <deps/stb/stb_image.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stb should be linked as target, not included directly from the place where is downloaded

#include <cassert>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not be needed when stb is included as target and its include directories included as SYSTEM

static bool validate(const brayns::Image &image,
const std::string &filename)
{
std::cout << "Validation of image '" << filename << "'.\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the tests themselves should suffice. If we ever encounter a problem, we can manually add prints for debugging, but I think they are not necessary as part of the tests output

const brayns::Image &reference)
{
auto evaluation = _evaluate(image, reference);
std::cout << "Evaluation result: " << evaluation << ".\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the tests themselves should suffice. If we ever encounter a problem, we can manually add prints for debugging, but I think they are not necessary as part of the tests output

@Adrien4193 Adrien4193 merged commit 7534083 into develop Dec 14, 2021
@Adrien4193 Adrien4193 deleted the BRAYNS-300_ReplaceFreeImage branch December 14, 2021 08:21
NadirRoGue pushed a commit that referenced this pull request Dec 14, 2021
* Image wrapper around stb implemented.

* Improved a bit Image API.

* Improved image API.

* IBL migrated.

* Removed texture loading from image.

* Adding new features to Image.

* FreeImage replaced by stbi.

* Fix bugs.

* Fixed warnings with asserts disabled.

* Reverting IBL changes.

* Removed pdiff.

* Fixing bug.

* Enable warnings in brayns/tests.

* Re-render test images and remove unused ones.

* Fixed path issue in tests.

* Documentation of image API.

* Fixing bug.

* Moved some code to cpp files.

* Fixed warning in release build.

* Moved helper class inside cpp.

* Adding debug options to tests.

* New image validation system.

* Create target for stb.

* Trigger CI.
NadirRoGue added a commit that referenced this pull request Dec 15, 2021
* Bumped Pillow and websockets version. (#922)

* Code cleanup (#923)

* Brayns 278 add mock requests in python tests (#924)

* Brayns 285 fix logic issue in quanta jpeg stream (#925)

* Brayns 286 fix python image method (#928)

* Brayns 287 fix python entrypoint methods with one of schema (#929)

* Loaders & CircuitExplorer refactoring (#927)

* Fixed some typo's (#930)

* Update AUTHORS.txt (#931)

* Brayns 258 create a proper logging system for brayns (#932)

* Frame export improvement and static global objects removal: (#933)

* Removes CMake/common dependency from build system (#934)

* Removed VRPN plugin and deps. (#935)

* Brayns 295 rename brayns json macros to a more appropriate name (#936)

* Fixes segfault due to global const std::strings (#939)

* Map and unmap framebuffer added. (#940)

* Fix entry points variable naming (#941)

* Brayns 300 replace free image (#942)

* Brayns 308 Code restructure (#943)

* Brayns 315 2.0.0 release preparation (#944)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants