Author Topic: I'm trying to setup an ild file for my build in sdcard interface  (Read 62162 times)

0 Members and 1 Guest are viewing this topic.

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I'm trying to setup an ild file for my build in sdcard interface
« Reply #15 on: July 19, 2015, 08:07:09 am »
Now I do not think it is a bug in the sd interface.


Solution is very easy. After a blanked Vertex must be the same Vertex unblanked again. It is like in the ilda test pattern. I've all implemented in the python script, to convert LB ild for sd interface. See pictures off my Ilda-Editor (python-script)
.

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I'm trying to setup an ild file for my build in sdcard interface
« Reply #16 on: July 19, 2015, 11:57:17 am »
Did you get the LaserBoy Correction Amp yet?

Would you like to go over the chil effect code in LB and see of we can get it to do the same fix you came up with in your Python script?

Thanks!

James.
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I'm trying to setup an ild file for my build in sdcard interface
« Reply #17 on: July 19, 2015, 01:12:43 pm »
no kit did not arrived yet. The 7.1 soundcard I've got already now.

I'll dig in chil effect code ;-)

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I'm trying to setup an ild file for my build in sdcard interface
« Reply #18 on: July 19, 2015, 04:16:32 pm »
Code: [Select]
//############################################################################
LaserBoy_Bounds chil(LaserBoy_frame_set* p_frame_set)
{
    bool                       is_lit = false;
    int                        i,
                               j;
    LaserBoy_3D_double         Z_offset(0.0, 0.0, 100.0);
    LaserBoy_vertex            previous_vertex;
    LaserBoy_frame             frame(p_frame_set->p_space);
    LaserBoy_frame_set         in(*p_frame_set),
                               out(p_frame_set->p_space);
    //--------------------------------------------------------------------
    for(i = 0; i < (int)in.number_of_frames(); i++)
    {
        frame.clear();
        if(in[i].size() > 1)
        {
            if(in[i].is_2D())
                in[i].move(Z_offset, false);
               
            in[i].best_match_palette(LASERBOY_ILDA_STANDARD); //LASERBOY_ILDA_STANDARD
           
            frame.push_back(in[i][0]);
            frame.push_back(in[i][0]);
           
            previous_vertex = in[i][0];
           
            for(j = 1; j < (int)in[i].size(); j++)
            {
                if(    (!is_lit)
                    && in[i][j].is_lit()
                  )
                {
                    frame += in[i][j];
                    is_lit = true;
                }
                else if(    (is_lit)
                         && in[i][j].is_blank()
                       )
                {
                    frame += in[i][j];
                    is_lit = false;
                }
                else if(    (is_lit)
                         && in[i][j].is_lit()
                         && (    ((LaserBoy_color)in[i][j])
                              != ((LaserBoy_color)previous_vertex)
                            )
                       )
                {
                    frame += in[i][j];
                }
                frame += in[i][j];
                if (in[i][j].is_blank())
                { // set off blanking & add
                    in[i][j].unblank();
                    frame += in[i][j];
                    in[i][j].blank();
                   
                }
                previous_vertex = in[i][j];
            }
            frame += in[i].back();
        }
        out += frame;
    }
    //--------------------------------------------------------------------
    out.save_as_ild(LASERBOY_ILD_SHARE + "chil.ild");
    return LASERBOY_IN_BOUNDS;
}


//############################################################################

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I'm trying to setup an ild file for my build in sdcard interface
« Reply #19 on: July 20, 2015, 12:33:56 pm »
It looks like all you added was this bit....

Code: [Select]
                if (in[i][j].is_blank())
                { // set off blanking & add
                    in[i][j].unblank();
                    frame += in[i][j];
                    in[i][j].blank();
                }

You could make it a bit shorter like this....

Code: [Select]
                if (in[i][j].is_blank())
                { // set off blanking & add
                    frame += in[i][j];
                    frame.back().unblank();
                }

Have you tried this?

What effect does the code have that is above your addition?

It adds extra points right after any transition between blank to lit, lit to blank for from one color to another.

BTW, your code will add an extra point for every blank point. If the frame(s) is (are) optimized before you run this effect (which they should be), this will double the total number of blank points in each frame. The added points are obviously not blank, so they should at least be set to an index in the palette that is black.

James.
« Last Edit: July 20, 2015, 01:26:12 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I'm trying to setup an ild file for my build in sdcard interface
« Reply #20 on: July 21, 2015, 06:20:06 am »

new code: yes I think that is a nicer solution.
What effect does the code have that is above your addition?
>> I 'll test


The added points are obviously not blank, so they should at least be set to an index in the palette that is black.
>> Is it necessary?


In the ilda test pattern, there are transition between blank to lit with color index change to "0".  Take a look at the test pattern by testing my beta version of the ilda Editor. Install python2.7, copy ilda_edit.py to a folder and start:
Code: [Select]
python ilda_edit.py (optional path to V0-V3 Ild file)
« Last Edit: July 21, 2015, 06:31:03 am by emanuel »

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I'm trying to setup an ild file for my build in sdcard interface
« Reply #21 on: July 21, 2015, 12:51:20 pm »
The ILDA test pattern is not necessarily a good reference for what a frame should be. It is designed to stress scanners to their limits. It contains vector information that would not be appropriate for a properly optimized frame.

I'm not sure what the best solution is for these SD card readers.

We don't have the code that is in the firmware so we cannot see how it interprets the information in a properly prepared frame.

If it turns out that a "fix" for these devices results in a frame that is otherwise corrupted for any other properly implemented ILDA file reader then we probably should not use the file extension of *.ild.

I'm not even sure if all of these SD card readers are wrong in the same way!

James.
« Last Edit: July 21, 2015, 01:08:18 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I'm trying to setup an ild file for my build in sdcard interface
« Reply #22 on: July 21, 2015, 01:22:14 pm »
Code: [Select]
//############################################################################
LaserBoy_Bounds chil(LaserBoy_frame_set* p_frame_set)
{
    int                        i,
                               j;
    LaserBoy_3D_double         Z_offset(0.0, 0.0, 100.0); // to make 2D into 3D
    LaserBoy_frame             frame(p_frame_set->p_space); // a temp container to build a frame out of individual vertices
    LaserBoy_frame_set         in(*p_frame_set), // a copy of the currently loaded frame set
                               out(p_frame_set->p_space); // a container for the resulting modified frame set
    //--------------------------------------------------------------------
    for(i = 0; i < (int)in.number_of_frames(); i++) // i is the index of each frame in the set
    {
        frame.clear(); // empty the temp frame container
        if(in[i].size() > 1) // if this frame has vertices
        {
            if(in[i].is_2D())
                in[i].move(Z_offset, false); // convert 2D to 3D

            in[i].best_match_palette(LASERBOY_ILDA_DEFAULT); // convert to Default palette

            frame.push_back(in[i][0]); // add the original vertex of this frame to the temp frame
            frame.push_back(in[i][0]); // add another copy of the original vertex to the temp frame

            // The zeroth vertex of a frame is only an anchor point for the first vector.
            // It has no color and it is neither lit or blank, but it has a coordinate location.
            // A properly implemented ILDA reader would not read color or blanking information from this vertex.
            // But, it should be saved as blank in the file.

            for(j = 1; j < (int)in[i].size(); j++) // j is every vertex in this frame after the zeroth
            {
                frame += in[i][j]; // no matter what, add this vertex to the frame

                // if this vertex is lit and the previous one is not
                if(    (!in[i][j - 1].is_lit()) // look at the previous vertex
                    && in[i][j].is_lit()
                  )
                    frame += in[i][j]; // add this vertex to the frame (again)
                //-------------------------------------------------------------

                // if this vertex is blank and the previous one is not
                else if(    in[i][j - 1].is_lit() // look at the previous vertex
                         && in[i][j].is_blank()
                       )
                    frame += in[i][j]; // add this vertex to the frame (again)
                //-------------------------------------------------------------

                // if this vertex is lit and not the same color as the previous lit vertex
                else if(    in[i][j - 1].is_lit()
                         && in[i][j].is_lit()
                         && (    ((LaserBoy_color)in[i][j])
                              != ((LaserBoy_color)in[i][j - 1]) // look at the previous vertex
                            )
                       )
                    frame += in[i][j]; // add this vertex to the frame (again)
            } // end for(j = 1; j < (int)in[i].size(); j++)
            //-----------------------------------------------------------------
           
            frame += in[i].back(); // add the last vertex to the frame (again)
        } // end if(in[i].size() > 1)
        //---------------------------------------------------------------------

        out += frame; // add this frame to the new resulting frame set
    } // end for(i = 0; i < (int)in.number_of_frames(); i++)
    //--------------------------------------------------------------------
    out.save_as_ild(LASERBOY_ILD_SHARE + "chil.ild"); // save the frame set
    return LASERBOY_IN_BOUNDS; // there is no way this new frame set could be out of bounds.
}

//############################################################################

This idea for a fix is based on the assumption that the SD card reader is reading the color and blanking information from the anchor end of each vector rather than the destination end.

So every transition from lit to blank, blank to lit or from one color to another has an additional copy of that vertex added to the frame.

If this works for the SD card readers it would have the added advantage of also working for proper ILDA readers.

We should get on Skype sometime. You could open LB and share that part of your screen with me. Then we can visualize this stuff together.

James.
« Last Edit: July 21, 2015, 04:11:27 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: I'm trying to setup an ild file for my build in sdcard interface
« Reply #23 on: August 09, 2015, 12:31:34 am »
Hey! did you every mess around with this code?

LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline emanuel

  • Jr. Member
  • **
  • Posts: 71
  • Milliwatts: 0
    • View Profile
Re: I'm trying to setup an ild file for my build in sdcard interface
« Reply #24 on: August 09, 2015, 06:28:16 pm »
yes but do not fix blanking for sd interface.

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.7 © 2008-2024, SimplePortal