Added mupdf.scaleBlitBuffer() for better scaling#519
Merged
Frenzie merged 2 commits intokoreader:masterfrom Sep 25, 2017
Merged
Added mupdf.scaleBlitBuffer() for better scaling#519Frenzie merged 2 commits intokoreader:masterfrom
Frenzie merged 2 commits intokoreader:masterfrom
Conversation
We get better quality scaling with MuPDF than our internal BlitBuffer:scale(), so we'll use it instead in ImageWidget.
Member
|
Looks good to me. |
Frenzie
reviewed
Sep 25, 2017
ffi/mupdf.lua
Outdated
| converted_bb = BlitBuffer.new(orig_w, orig_h, BlitBuffer.TYPE_BBRGB32) | ||
| converted_bb:blitFrom(bb, 0, 0, 0, 0, orig_w, orig_h) | ||
| bb = converted_bb -- we don't free() the provided bb, but we'll have to free our converted_bb | ||
| bbtype = bb:getType() |
Member
There was a problem hiding this comment.
ffi/mupdf.lua:700:9: value assigned to variable 'bbtype' is unused
Frenzie
reviewed
Sep 25, 2017
ffi/mupdf.lua
Outdated
| local p_width = M.fz_pixmap_width(context(), scaled_pixmap) | ||
| local p_height = M.fz_pixmap_height(context(), scaled_pixmap) | ||
| -- And convert the pixmap back to a BlitBuffer | ||
| local bbtype |
Member
There was a problem hiding this comment.
do you mean bbtype = nil?
ffi/mupdf.lua:718:11: variable 'bbtype' was previously defined on line 682
Frenzie
reviewed
Sep 25, 2017
ffi/mupdf.lua
Outdated
| error("unsupported number of color components") | ||
| end | ||
| local p = M.fz_pixmap_samples(context(), scaled_pixmap) | ||
| local bb = BlitBuffer.new(p_width, p_height, bbtype, p):copy() |
Member
There was a problem hiding this comment.
ffi/mupdf.lua:727:11: variable 'bb' was previously defined as an argument on line 679
Member
|
Nice! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We get better quality scaling with MuPDF than our internal BlitBuffer:scale(), so we'll use it instead in ImageWidget.