Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
8cf0c634
Commit
8cf0c634
authored
Dec 05, 2014
by
Christian Schulte zu Berge
Browse files
Fixed various warnings and CppCheck issues.
parent
340fdebf
Changes
3
Hide whitespace changes
Inline
Side-by-side
application/gui/datacontainerinspectorcanvas.cpp
View file @
8cf0c634
...
...
@@ -285,9 +285,9 @@ namespace campvis {
const
ImageData
*
id
=
static_cast
<
const
ImageData
*>
(
_textures
[
texIndx
].
getData
());
const
cgt
::
Texture
*
tex
=
id
->
getRepresentation
<
ImageRepresentationGL
>
()
->
getTexture
();
const
ImageRepresentationLocal
*
localRep
=
id
->
getRepresentation
<
ImageRepresentationLocal
>
();
cgt
::
i
vec2
imageSize
=
id
->
getSize
().
xy
();
cgt
::
s
vec2
imageSize
=
id
->
getSize
().
xy
();
cgt
::
vec2
lookupTexelFloat
=
cgt
::
vec2
((
e
->
coord
()
%
_quadSize
)
*
imageSize
)
/
cgt
::
vec2
(
_quadSize
);
cgt
::
vec2
lookupTexelFloat
=
cgt
::
vec2
((
e
->
coord
()
%
_quadSize
)
*
cgt
::
ivec2
(
imageSize
)
)
/
cgt
::
vec2
(
_quadSize
);
// compute transformation matrices
float
renderTargetRatio
=
static_cast
<
float
>
(
_quadSize
.
x
)
/
static_cast
<
float
>
(
_quadSize
.
y
);
...
...
ext/cgt/texturereadertga.cpp
View file @
8cf0c634
...
...
@@ -103,7 +103,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
return
0
;
}
in
t
bpp
=
header
[
4
];
size_
t
bpp
=
static_cast
<
size_t
>
(
header
[
4
]
)
;
bpp
/=
8
;
// divide by 8 to get the bytes per pixel
GLint
format
=
GL_RGBA
;
...
...
@@ -128,7 +128,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
GLenum
dataType
=
GL_UNSIGNED_BYTE
;
in
t
numBytes
=
bpp
*
cgt
::
hmul
(
dimensions
);
size_
t
numBytes
=
static_cast
<
size_t
>
(
bpp
*
cgt
::
hmul
(
dimensions
)
)
;
GLubyte
*
buffer
=
new
GLubyte
[
numBytes
];
if
(
TGAheader
[
2
]
==
2
)
{
...
...
@@ -137,6 +137,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
if
(
file
->
read
(
buffer
,
numBytes
)
!=
numBytes
)
{
LERROR
(
"Failed to read uncompressed image! file: "
<<
filename
);
delete
file
;
delete
[]
buffer
;
return
0
;
}
}
...
...
@@ -147,7 +148,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
//TODO: error handling
unsigned
char
chunk
[
4
];
unsigned
char
*
at
=
buffer
;
for
(
in
t
bytesDone
=
0
;
bytesDone
<
numBytes
;
/* nothing here */
)
{
for
(
size_
t
bytesDone
=
0
;
bytesDone
<
numBytes
;
/* nothing here */
)
{
unsigned
char
packetHead
;
file
->
read
(
reinterpret_cast
<
char
*>
(
&
packetHead
),
1
);
if
(
packetHead
>
128
)
{
...
...
@@ -175,7 +176,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
// switch r & b
if
(
bpp
>=
3
)
{
GLubyte
*
at
=
buffer
;
while
(
at
-
buffer
<
numBytes
)
{
while
(
at
-
buffer
<
static_cast
<
ptrdiff_t
>
(
numBytes
)
)
{
std
::
swap
(
at
[
0
],
at
[
2
]);
at
+=
bpp
;
}
...
...
@@ -185,6 +186,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
t
->
uploadTexture
(
buffer
,
format
,
dataType
);
t
->
setName
(
filename
);
delete
[]
buffer
;
return
t
;
}
...
...
modules/preprocessing/processors/glimagecrop.cpp
View file @
8cf0c634
...
...
@@ -76,7 +76,6 @@ namespace campvis {
ImageRepresentationGL
::
ScopedRepresentation
img
(
data
,
p_inputImage
.
getValue
());
if
(
img
!=
0
)
{
cgt
::
ivec3
inputSize
=
img
->
getSize
();
cgt
::
ivec3
outputSize
=
cgt
::
abs
(
p_urb
.
getValue
()
-
p_llf
.
getValue
());
cgt
::
TextureUnit
inputUnit
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment