anim_smart_proxy.go | |
---|---|
|
|
Creates animation based on static GIF image + set of programmed rules. That animation displays data flow between Insights Results Smart Proxy and other services (internal and external ones). |
|
Link to generated documentation for this script: https://redhatinsights.github.io/insights-results-aggregator-utils/packages/animsmartproxy.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 three colors |
|
initialize color palette |
|
rectangle that represents the ant |
|
draw rectangle using the first color (black) |
|
rectangle that represents the ant |
|
draw rectangle using the selected color |
|
main function is called by runtime after the tool has been started. |
|
frames representing the whole animation stored in GIF file |
|
delays between frames |
|
paths with additional attributes |
|
draw ants animation along the paths |
|
basic parameter for moving ant |
|
special point at end |
|
special point at end |
|
ant move vector |
|
calculate the move vector |
|
create animation for the active path |
|
read original image TODO: make the file name configurable |
|
first special block |
|
second special block |
|
add frame into set of frames |
|
last image is the same as the original one with long delay |
|
write resulting animation (set of frames) into GIF file TODO: make the file name configurable |
|