anim_external_data_pipeline.go | |
---|---|
|
|
Creates animation based on static GIF image + set of programmed rules. That animation displays the data flow for the whole external data pipeline. |
|
Link to generated documentation for this script: https://redhatinsights.github.io/insights-results-aggregator-utils/packages/animexternaldata_pipeline.html |
|
readOriginal function tries to read the GIF file that contains the static input image. Animation to be created are based on this source image. |
|
try to open the file specified by its name and check for any error |
|
file needs to be closed properly before that function ends |
|
try to close the file and check for any error that might happened |
|
try to decode GIF frames from reader |
|
we have to use image.Paletted, so it is needed to convert the image into desired format |
|
writeAnimation function stores all images into GIF file. Each image (from
|
|
try to open the file specified by its name and check for any error |
|
file needs to be closed properly before that function ends |
|
try to close the file and check for any error that might happened |
|
try to encode all GIF frames to output file |
|
check if any error occured during EncodeAll operation |
|
drawAnt function draws one "marching" ant into the frame represented by
TODO: make color palette completely configurable |
|
standard color palette with four colors |
|
initialize color palette |
|
rectangle that represents ant |
|
draw the rectangle using selected color |
|
drawMarchingAnts functions draws all "marching" ants into the frame
represented by TODO: make this part completely configurable |
|
first vertical line |
|
first horizontal line |
|
second vertical line |
|
second horizontal line |
|
horizontal line: from Ingress to Kafka topic |
|
horizontal line: from Kafka topic into ccx-data-pipeline |
|
horizontal line: from ccx-data-pipeline to Kafka topic |
|
vertical line: from ccx-data-pipeline to Kafka topic |
|
special unmovable blocks |
|
main function is called by runtime after the tool has been started from command line. |
|
frames representing the whole animation stored in GIF file |
|
delays between frames |
|
only 20 frames needs to be created |
|
create all frames to generate final animation |
|
read original image TODO: make the file name configurable |
|
draw new frame based on original image |
|
and add the frame into animation TODO: make the delay configurable |
|
write resulting animation (set of frames) into GIF file TODO: make the file name configurable |
|