-
Notifications
You must be signed in to change notification settings - Fork 11
Add pixel_format to libisyntax api. libisyntax_tile_read() now takes an external buffer. #24
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| #pragma once | ||
|
|
||
| #include "isyntax.h" | ||
| #include "libisyntax.h" | ||
| #include "benaphore.h" | ||
|
|
||
| typedef struct isyntax_tile_list_t { | ||
|
|
@@ -21,7 +22,9 @@ typedef struct isyntax_cache_t { | |
| int allocator_block_height; | ||
| } isyntax_cache_t; | ||
|
|
||
| uint32_t* isyntax_read_tile_bgra(isyntax_t* isyntax, isyntax_cache_t* cache, int scale, int tile_x, int tile_y); | ||
| // TODO(avirodov): can this ever fail? | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think so, e.g. if the decompression of the codeblocks fails (for example, if trying to decompress corrupt
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think so too. I prefer to defer this problem to when we need to virtualize the filesystem access (see openslide/openslide#437 (comment), maybe will be needed soon). Then we can figure out what errors the virtual FS can return, how to propogate them, and how to expose them here. So for now I'll leave it as a todo. |
||
| void isyntax_tile_read(isyntax_t* isyntax, isyntax_cache_t* cache, int scale, int tile_x, int tile_y, | ||
| uint32_t* pixels_buffer, enum isyntax_pixel_format_t pixel_format); | ||
|
|
||
| void tile_list_init(isyntax_tile_list_t* list, const char* dbg_name); | ||
| void tile_list_remove(isyntax_tile_list_t* list, isyntax_tile_t* tile); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There already is ASSERT() from common.h, should we use that instead or should we replace all ASSERT() with assert()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed to use common.h ASSERT().
(I have slight preference to standard solutions, but it is best being consistent with the existing codebase. This file uses ASSERT(), so I'll do the same).