Notice: If you are member of any public project or group, please make sure that your GitLab username is not the same as the LRZ identifier/Kennung (see https://gitlab.lrz.de/profile/account). Please change your username if necessary. For more information see the section "Public projects / Öffentliche Projekte" at https://doku.lrz.de/display/PUBLIC/GitLab . Thank you!

Commit 3c537e12 authored by Jakob Weiss's avatar Jakob Weiss

Minor updates

* Added .editorconfig
* cgt::Texture::downloadTextureToBuffer now does a glFlush() before downloading
* ColorPropertyWidget now supports transparent colors properly
parent c0fe9f70
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Windows-style newlines with a newline ending every file
[*]
end_of_line = crlf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
......@@ -56,7 +56,7 @@ namespace campvis {
++_ignorePropertyUpdates;
ColorProperty* prop = static_cast<ColorProperty*>(_property);
cgt::vec4 val = QtColorTools::toTgtColor(_colorPicker->color());
prop->setValue(cgt::vec4(val.x/val.w, val.y/val.w, val.z/val.w, 1));
prop->setValue(cgt::vec4(val.x/255.f, val.y/255.f, val.z/255.f, val.w/255.f));
--_ignorePropertyUpdates;
}
......
......@@ -405,6 +405,9 @@ namespace campvis {
std::vector<cgt::vec3> vertices;
std::vector<cgt::vec3> normals;
vertices.reserve(4 * numSlices + 2);
normals.reserve(4 * numSlices + 2);
// add bottom vertex
vertices.push_back(cgt::vec3(0.f, 0.f, 0.f));
normals.push_back(cgt::vec3(0.f, 0.f, -1.f));
......
......@@ -26,13 +26,14 @@
#define ALLPROPERTIES_H__
#include "core/properties/buttonproperty.h"
#include "core/properties/colorproperty.h"
#include "core/properties/datanameproperty.h"
#include "core/properties/floatingpointproperty.h"
#include "core/properties/metaproperty.h"
#include "core/properties/numericproperty.h"
#include "core/properties/optionproperty.h"
#include "core/properties/statusproperty.h"
#include "core/properties/stringproperty.h"
#include "core/properties/transferfunctionproperty.h"
#include "core/properties/statusproperty.h"
#endif // ALLPROPERTIES_H__
\ No newline at end of file
......@@ -248,6 +248,8 @@ GLubyte* Texture::downloadTextureToBuffer(GLint format, GLenum dataType) const {
int arraySize = hmul(dimensions_) * calcBpp(format, dataType);
GLubyte* pixels = new GLubyte[arraySize];
glFlush(); // better to use a barrier here but too lazy to figure out which one would be correct
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glGetTexImage(type_, 0, format, dataType, pixels);
return pixels;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment