Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
9745df04
Commit
9745df04
authored
Jun 25, 2013
by
Sebastian Eichelbaum
Browse files
[ADD
#285
] RAW mode also forces a header file to be written.
parent
3f32468a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
src/modules/writeTransferFunction/WMWriteTransferFunction.cpp
...modules/writeTransferFunction/WMWriteTransferFunction.cpp
+25
-1
No files found.
src/modules/writeTransferFunction/WMWriteTransferFunction.cpp
View file @
9745df04
...
...
@@ -153,7 +153,7 @@ void WMWriteTransferFunction::moduleMain()
continue
;
}
f
<<
"Exported using OpenWalnut. http://www.openwalnut.org"
<<
std
::
endl
;
f
<<
"
#
Exported using OpenWalnut. http://www.openwalnut.org"
<<
std
::
endl
;
f
<<
"# TF export format:"
<<
std
::
endl
<<
"# Comments begin with #"
<<
std
::
endl
<<
"# 1st line: width height"
<<
std
::
endl
<<
...
...
@@ -175,6 +175,30 @@ void WMWriteTransferFunction::moduleMain()
}
else
{
// write header file separately
std
::
ofstream
fhead
;
fhead
.
open
(
(
p
.
string
()
+
".header"
).
c_str
()
);
if
(
!
fhead
.
good
()
)
{
errorLog
()
<<
"Failed to write header file "
<<
(
p
.
string
()
+
".header"
).
c_str
()
<<
". Abort."
;
continue
;
}
fhead
<<
"# Exported using OpenWalnut. http://www.openwalnut.org"
<<
std
::
endl
;
fhead
<<
"# TF export format:"
<<
std
::
endl
<<
"# Comments begin with #"
<<
std
::
endl
<<
"# 1st line: width height"
<<
std
::
endl
<<
"# 2nd line: filename to binary file, relative to header"
<<
std
::
endl
<<
"# The RGBA quadruples are stored in binary format as four unsigned char values per quadruples."
<<
std
::
endl
;
// later, we might support 2d TFs. Now, write 1 as second dimension
fhead
<<
string_utils
::
toString
(
vs
->
size
()
)
<<
" "
<<
"1"
<<
std
::
endl
;
fhead
<<
p
.
filename
().
string
().
c_str
()
<<
std
::
endl
;
// go through each RGBA vector
fhead
.
close
();
// write data file.
std
::
ofstream
f
;
f
.
open
(
p
.
string
().
c_str
(),
std
::
ios
::
out
|
std
::
ios
::
binary
);
if
(
!
f
.
good
()
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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