Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
png
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blaar
png
Commits
7e894996
Commit
7e894996
authored
6 years ago
by
Arnaud Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
Default period 0 (no needing return) between each images
parent
3791c4c6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
i_pngfile/i_pngfile.cpp
+10
-16
10 additions, 16 deletions
i_pngfile/i_pngfile.cpp
with
10 additions
and
16 deletions
i_pngfile/i_pngfile.cpp
+
10
−
16
View file @
7e894996
...
...
@@ -37,7 +37,7 @@ int main(int argc, char**argv){
blc_program_add_option
(
&
format_str
,
'f'
,
"format"
,
"NDEF|Y800|RGB3|RGBA"
,
"format of the desired image (NDEF for native format of the png)"
,
"NDEF"
);
blc_program_add_option
(
&
images_nb_str
,
'n'
,
"number"
,
"integer"
,
"number of images to load (need: file format like: filename%d.png)"
,
NULL
);
blc_program_add_option
(
&
output_name
,
'o'
,
"output"
,
"blc_channel-out"
,
"Name of the channel"
,
DEFAULT_OUTPUT_NAME
);
blc_program_add_option
(
&
period_str
,
'p'
,
"period"
,
"integer"
,
"refresh period in ms (-1 for blocking)"
,
"
-1
"
);
blc_program_add_option
(
&
period_str
,
'p'
,
"period"
,
"integer"
,
"refresh period in ms (-1 for blocking
and waiting return
)"
,
"
0
"
);
blc_program_add_option
(
&
type_str
,
't'
,
"type"
,
"NDEF|UIN8|INT8|FL32"
,
"type of the data (NDEF for native type of png)"
,
"NDEF"
);
blc_program_add_parameter
(
&
filename
,
"filename"
,
1
,
"filename of the image"
,
NULL
);
blc_program_init
(
&
argc
,
&
argv
,
blc_quit
);
...
...
@@ -45,7 +45,7 @@ int main(int argc, char**argv){
if
(
filename
==
NULL
){
blc_program_args_display_help
();
EXIT_ON_ERROR
(
"You need to specify a filename:
-F
<filename>"
);
EXIT_ON_ERROR
(
"You need to specify a filename: <filename>"
);
}
format
=
STRING_TO_UINT32
(
format_str
);
type
=
STRING_TO_UINT32
(
type_str
);
...
...
@@ -60,12 +60,8 @@ int main(int argc, char**argv){
SSCANF
(
1
,
images_nb_str
,
"%d"
,
&
images_nb
);
image_id
=
0
;
SPRINTF
(
final_filename
,
filename
,
image_id
);
image_id
++
;
}
else
{
STRCPY
(
final_filename
,
filename
);
images_nb
=
1
;
}
else
STRCPY
(
final_filename
,
filename
);
//Only the properties are defined, the data is not allocated.
blc_image_def_with_png_file
(
&
output
,
final_filename
,
type
,
format
);
...
...
@@ -76,17 +72,15 @@ int main(int argc, char**argv){
blc_loop_try_add_posting_semaphore
(
output
.
sem_new_data
);
BLC_COMMAND_LOOP
(
period
){
if
(
images_nb_str
){
if
(
image_id
==
images_nb
-
1
)
blc_command_ask_quit
();
else
{
SPRINTF
(
final_filename
,
filename
,
image_id
);
image_id
++
;
}
}
//If we have a number of images to load and we have not finish
blc_image_update_with_png_file
(
&
output
,
final_filename
);
if
(
images_nb_str
){
if
(
image_id
==
images_nb
-
1
)
blc_command_ask_quit
();
else
{
SPRINTF
(
final_filename
,
filename
,
image_id
);
image_id
++
;
}
}
}
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment