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

ncplane_as_rgba ought work for quadrants and sextants #1490

Closed
dankamongmen opened this issue Mar 31, 2021 · 7 comments · Fixed by #1697
Closed

ncplane_as_rgba ought work for quadrants and sextants #1490

dankamongmen opened this issue Mar 31, 2021 · 7 comments · Fixed by #1697
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@dankamongmen
Copy link
Owner

ncplane_rgba() currently only works on halfblocks and fullblocks (spaces). it ought be able to handle NCBLIT_2x2 and NCBLIT_3x2 as well. since we don't know what the original blit was (and they could technically be mixed), translate cells into their LCMs: each cell ought thus go to 2x6. that kinda whacks out aspect ratio; we could perhaps go to 6x12 instead?

fullblock -> 6x12
halfblocks -> 6x6, 6x6
quadrant -> 3x6, 3x6, 3x6, 3x6
sextant -> 3x4, 3x4, 3x4, 3x4, 3x4, 3x4

@dankamongmen dankamongmen added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 31, 2021
@dankamongmen dankamongmen added this to the 2.3.0 milestone Mar 31, 2021
@dankamongmen dankamongmen self-assigned this Mar 31, 2021
@dankamongmen
Copy link
Owner Author

this leads directly to #1441.

@dankamongmen
Copy link
Owner Author

we also now need NCBLIT_PIXEL support

@dankamongmen
Copy link
Owner Author

also, apparently it has no support for transparency, egads

@dankamongmen dankamongmen changed the title ncplane_rgba ought work for quadrants and sextants ncplane_as_rgba ought work for quadrants and sextants May 24, 2021
@dankamongmen
Copy link
Owner Author

This work is ongoing in the dankamongmen/ncplane-as-rgba branch, and ought be done this evening. One thing to add: if a plane has a null glyph at a cell, we probably ought use the default character there. This allows, for instance, ncplane_as_rgba() to be run on a plane which has been filled using ncplane_set_base().

@dankamongmen
Copy link
Owner Author

This work is ongoing in the dankamongmen/ncplane-as-rgba branch, and ought be done this evening. One thing to add: if a plane has a null glyph at a cell, we probably ought use the default character there. This allows, for instance, ncplane_as_rgba() to be run on a plane which has been filled using ncplane_set_base().

if we want to do this, i think a better way might be to have ncplane_at_yx() consult the base cell, which is honestly probably a good idea unless we've specified otherwise in the documentation.

@dankamongmen
Copy link
Owner Author

dankamongmen commented May 29, 2021

also, it needs to keep working with NCBLIT_DEFAULT. except how can it? NCBLIT_DEFAULT resolves to a different thing based off the scaling type, and the latter is not available to us. hrmmm. we could always go for the most complex; since we would decay to 2x1 to maintain aspect ratio...no, because 3x2 doesn't contain 2x1 (2x2 does, though), so if they went with STRETCH and got 3x2, that won't work for a 2x1, shit...hrmm....maybe we don't allow NCBLIT_DEFAULT? maybe we prescan? maybe we go with 3x2, and retry with 2x2? no really great solutions here...

dankamongmen added a commit that referenced this issue Jun 1, 2021
dankamongmen added a commit that referenced this issue Jun 1, 2021
ncplane_as_rgba: genericize across blitters

ncplane_as_rgba() previously was implemented explicitly
in terms of NCBLIT_2x1. it now uses the `egcs` field of the
`blitset`. this supports NCBLIT_2x2 and NCBLIT_3x2 in
ncplane_rgba(). Closes #1490.
@dankamongmen
Copy link
Owner Author

we now support NCBLIT_2x2 and NCBLIT_3x2. we need add support for NCBLIT_BRAILLE and NCBLIT_PIXEL still, but we've genericized it to use the inverse tables from blitset.

@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
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant