Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interpolated resize has the wrong size #1797

Closed
joseluis opened this issue Jun 19, 2021 · 8 comments
Closed

interpolated resize has the wrong size #1797

joseluis opened this issue Jun 19, 2021 · 8 comments
Assignees
Labels
bitmaps bitmapped graphics (sixel, kitty, mmap) bug Something isn't working
Milestone

Comments

@joseluis
Copy link
Collaborator

using the pixel-cell.rs example:, it shows the interpolated resize is either smaller (alacritty, wezterm) or larger (xterm) than it should be.

in latest alacritty:
image

in xterm:
image

in latest nightly wezterm:
image

can't test in kitty because #1796

@joseluis joseluis added bug Something isn't working bitmaps bitmapped graphics (sixel, kitty, mmap) labels Jun 19, 2021
@dankamongmen dankamongmen self-assigned this Jun 20, 2021
@dankamongmen dankamongmen added this to the 3.0.0 milestone Jun 20, 2021
@dankamongmen
Copy link
Owner

i assume this is recent breakage? if so, it's probably related to #1789's fix. need better unit testing!

@dankamongmen
Copy link
Owner

i confirm your behavior. i have a unit test on this stuff, i think, so it's odd that we're seeing this. let me try and trace it down.

@dankamongmen
Copy link
Owner

check out the PoC i've added, interp. it does something very similar. is it working (i.e. all "squares" are the same size) for you? i just put a bunch of comments into #1796 that really belonged here, argh.

@dankamongmen
Copy link
Owner

looking at pixel-cell.rs, i see:

    // resize the ncvisual (doesn't use interpolation)                                                     
    let voptions4 =                                                                                        
        NcVisualOptions::without_plane(7, 37, 0, 0, pg.cell_y, pg.cell_x, NCBLIT_PIXEL, 0, 0);             
    v1.resize_noninterpolative(pg.cell_y * 4, pg.cell_x * 4)?;                                             
    v1.render(&mut nc, &voptions4)?;                                                                       
    rsleep![&mut nc, 1];                                                                                   
                                                                                                           
    // resize the ncvisual (uses interpolation)                                                            
    let v5 = NcVisual::from_rgba(buffer.as_slice(), pg.cell_y, pg.cell_x * 4, pg.cell_x)?;                 
    let voptions5 =                                                                                        
        NcVisualOptions::without_plane(7, 51, 0, 0, pg.cell_y, pg.cell_x, NCBLIT_PIXEL, 0, 0);             
    v5.resize(18 * 4, 9 * 4)?; // FIXME: render function fails when downsizing (y<18 | x<9) 

in one you've got pg.cell_{y,x} * 4 and the other you've got {18,9} * 4 as your resize targets. why would they be the same size?

@dankamongmen
Copy link
Owner

in one you've got pg.cell_{y,x} * 4 and the other you've got {18,9} * 4 as your resize targets. why would they be the same size?

and we would expect them to change with the cell-pixel geometry, i.e. with different terminals, which is exactly what we see...no?

@joseluis
Copy link
Collaborator Author

ok I've confirmed your poc works in all terminals, I'll fix my example, sorry about that

@dankamongmen
Copy link
Owner

ok I've confirmed your poc works in all terminals, I'll fix my example, sorry about that

well, it might not necessarily be your sample -- it might be the particular geometries you're using, etc. let's leave this open until we know for sure (unless you agree with my assessment above). feel free to play around with or look at that interp.c in src/poc.

@joseluis
Copy link
Collaborator Author

Don't worry! It was what you said, I forgot those contant values in there... it's fixed in 90a2ff6

@dankamongmen dankamongmen modified the milestones: 3.0.0, 2.4.0 Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bitmaps bitmapped graphics (sixel, kitty, mmap) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants