LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling Gif aninimation

Thank you Mike!

 

Well even if you don't want to Nuggetize it you still earned a couple of tags that the forum really needed.

 

Thank you!

 

I'll try to take a look this week-end.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 11 of 41
(4,384 Views)

Hi Mike!

Nice code!

There was simply too much work put into this code for me to just leave it at that, so I'll try to document what you have done and ask questions as I go. Please don't take any of the following negatively. I am sure that there are many other developers that would jump all over some of my comments, since there is a lot of flexibility in good style. These would the same comments I would make if another one of my co-workers asked me to review their code.

It looks like the top level Vi is named "Gif.Main.vi". I have never seen anyone use a dotted notation like that before. Is that just your preference, or is that a standard you picked up?

THis prompts an open question to all. When using a naming convention where the the name starts with the name of the function like, how do you handle sub-VIs that can be shared across multiple functions? e.g. Say you had  gif.ReadFile.vi, it could be re-used in a JPG function?

You structureed Gif.Main.vi such that it was implelemtned as a State Machine. Nice! THe code you have developed and shared already exibits the flexibility of this architecture with handling the multiple file formats.

 

 

 

Q
You have used strings to control the SM states, Do you prefer them to using a type-def'd enum?

I used to use strings back in LV 6 but switched over to enums. Yes I still have code that I have been re-using since then that still use strings.

Comment: I have tried to use "Case Insensitive Match" for string control case structures. I'm pretty bad when it comes to the shift key.

Open Style Q

I often will drag all of my shift registers to the top of the SM structure. I do this to keep my states more open and to avoid having to dodge wires that are not used in every state. I even do this with the SR that controls my state transitions. But even in my beloved State Diagram Editor, NI decided the transitions should be at the bottom.

How do YOU manage the SR's in SM?

So after reading the contents of the file and save the contents and length in a SR you proceed to read the header.

 

 

 

In this state "Gif.Header.vi" is used to decode the part of the header to find Signature" and Version. These values are used to determine if the format is a GIF and the right type of GIF.

Qs

What is with "89a" ?

Could the 6 characters pulled out in "Gif.Header.vi"have been used to drive a string case structure? Any time I see more than one select node I start thinking "can I do this with a case to make it easier to read?

After this you proceed to "next"


...where Gif.LogicalScreenDescriptor.vi uses some strategic use of typecasts, data manipulation, and bit-wise logical operators to pull out all of the fields.

Nice.

Then you pull out the color table in Gif.ColorTable.vi which was implemented rather elegantly!

Could you comment a little on Gif.CreatePictureArray.vi? That Action Engine is just a little too much for my Sunday morning before coffee brain to decypher.

I'll stop here.


NICE, NICE, NICE, NICE!

Ben

Message Edited by Ben on 08-24-2008 09:18 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
Message 12 of 41
(4,345 Views)

more images

 

Message Edited by Ben on 08-24-2008 09:24 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
Message 13 of 41
(4,336 Views)

Hi Ben,

thanks for writing the comments. After reading it i decided to write a description for what i have done so far. Smiley Wink  It will be the first time, a use the Code Capture Tool. Smiley Wink

 

To some of your questions:

  • I try to use the dot notation "Gif.Main.vi" as often as possible. I think it´s easy to differ between the vi´s. I saw this if i started using LabVIEW and since then i try to use it in bigger projects.
  • I prefer to use comparater instead of a case structure if i think i can make my code more flexible. For example if i can read parameters from an ini file. In this case i wasn´t sure if it could be possible and so i used it.
  • 89a is a special version of the gif format.


I will post the detailed description as soon as possible. I think at the next weekend.

Once again, thanks for reaing the code and your interest.

 

Mike 

Message 14 of 41
(4,328 Views)

Hi Ben,

sorry for the delay, i´m still writing. Smiley Wink

 

Mike 

Message 15 of 41
(4,258 Views)

Hi Ben,

here is the first version of the description. I would be pleased to here your comments. If you have further questions, don´t hesitate to ask, i will then extend the document.

 

Mike

Message 16 of 41
(4,218 Views)

Mike I just saw a overall glance at the pdf. Looks interesting. Tonight, i will read it fully.

Very nice work indeed.

 

Thanks,

Mathan

Message 17 of 41
(4,213 Views)

Mega-Kudos to you Mike!

 

That looks like it was worth waiting for. I just printed a hard-copy so I can review it in detail (believe it or not, I don't have a pdf reader on my machine at home).

 

I will comment more after I have read this thoroughly.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 18 of 41
(4,195 Views)

This was a briliant approach to solving this problem and love the way the program was written.

I just downloaded and have only looked at it for 5 minutes but i intend to utilize this code for frame acquisition in my senior design project (Motion Estimation).

 

So far it works well but i have noticed that it does not work for larger sized images (suspecting images that are larger than 200x200)

I'll update this thread once i get more specifics and study the code some more

 

Tutu

Message 19 of 41
(4,089 Views)

Hi Tutu,

can you upload one of your big gif files?

 

Mike

Message 20 of 41
(4,068 Views)