mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
[ncvisual] add pxoffy+pxoffx fields to ncvisual_options #1682
This commit is contained in:
parent
88e2ac14ee
commit
a8b3634ca7
7
USAGE.md
7
USAGE.md
@ -3378,6 +3378,13 @@ struct ncvisual_options {
|
|||||||
ncblitter_e blitter; // glyph set to use (maps input to output cells)
|
ncblitter_e blitter; // glyph set to use (maps input to output cells)
|
||||||
uint64_t flags; // bitmask over NCVISUAL_OPTION_*
|
uint64_t flags; // bitmask over NCVISUAL_OPTION_*
|
||||||
uint32_t transcolor; // used only if NCVISUAL_OPTION_ADDALPHA is set
|
uint32_t transcolor; // used only if NCVISUAL_OPTION_ADDALPHA is set
|
||||||
|
// pixel offsets within the cell. if NCBLIT_PIXEL is used, the bitmap will
|
||||||
|
// be drawn offset from the upper-left cell's origin by these amounts. it is
|
||||||
|
// an error if either number exceeds the cell-pixel geometry in its
|
||||||
|
// dimension. if NCBLIT_PIXEL is not used, these fields are ignored.
|
||||||
|
// this functionality can be used for smooth bitmap movement.
|
||||||
|
// FIXME not yet implemented.
|
||||||
|
unsigned pxoffy, pxoffx;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -47,6 +47,7 @@ struct ncvisual_options {
|
|||||||
ncblitter_e blitter; // glyph set to use
|
ncblitter_e blitter; // glyph set to use
|
||||||
uint64_t flags; // bitmask over NCVISUAL_OPTION_*
|
uint64_t flags; // bitmask over NCVISUAL_OPTION_*
|
||||||
uint32_t transcolor; // use this color for ADDALPHA
|
uint32_t transcolor; // use this color for ADDALPHA
|
||||||
|
unsigned pxoffy, pxoffx; // pixel offset from origin
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef int (*streamcb)(struct notcurses*, struct ncvisual*, void*);
|
typedef int (*streamcb)(struct notcurses*, struct ncvisual*, void*);
|
||||||
@ -286,6 +287,12 @@ Only one bitmap can be blitted onto a plane at a time (but multiple planes
|
|||||||
with bitmaps may be visible); blitting a second to the same plane will delete
|
with bitmaps may be visible); blitting a second to the same plane will delete
|
||||||
the original.
|
the original.
|
||||||
|
|
||||||
|
**pxoffy** and **pxoffx** can specify an offset from the origin of the upper
|
||||||
|
left cell. This can be used for absolute positioning of a bitmap, or for
|
||||||
|
smooth movement of same. It is an error if **pxoffy** exceeds the cell height
|
||||||
|
in pixels, or **pxoffx** exceeds the cell width in pixels. If
|
||||||
|
**NCBLIT_PIXEL** is not used, these fields are ignored.
|
||||||
|
|
||||||
# RETURN VALUES
|
# RETURN VALUES
|
||||||
|
|
||||||
**ncvisual_from_file** returns an **ncvisual** object on success, or **NULL**
|
**ncvisual_from_file** returns an **ncvisual** object on success, or **NULL**
|
||||||
@ -371,6 +378,8 @@ Multiple threads may not currently call **ncvisual_render** concurrently
|
|||||||
using the same **ncvisual**, even if targeting distinct **ncplane**s. This
|
using the same **ncvisual**, even if targeting distinct **ncplane**s. This
|
||||||
will likely change in the future.
|
will likely change in the future.
|
||||||
|
|
||||||
|
**pxoffy** and **pxoffx** are not yet implemented.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
**notcurses(3)**,
|
**notcurses(3)**,
|
||||||
|
@ -2804,7 +2804,6 @@ API ALLOC struct ncvisual* ncvisual_from_plane(const struct ncplane* n,
|
|||||||
#define NCVISUAL_OPTION_ADDALPHA 0x0010ull // transcolor is in effect
|
#define NCVISUAL_OPTION_ADDALPHA 0x0010ull // transcolor is in effect
|
||||||
#define NCVISUAL_OPTION_CHILDPLANE 0x0020ull // interpret n as parent
|
#define NCVISUAL_OPTION_CHILDPLANE 0x0020ull // interpret n as parent
|
||||||
#define NCVISUAL_OPTION_NOINTERPOLATE 0x0040ull // non-interpolative scaling
|
#define NCVISUAL_OPTION_NOINTERPOLATE 0x0040ull // non-interpolative scaling
|
||||||
// 0x0080 is used internally
|
|
||||||
|
|
||||||
struct ncvisual_options {
|
struct ncvisual_options {
|
||||||
// if no ncplane is provided, one will be created using the exact size
|
// if no ncplane is provided, one will be created using the exact size
|
||||||
@ -2834,6 +2833,13 @@ struct ncvisual_options {
|
|||||||
ncblitter_e blitter; // glyph set to use (maps input to output cells)
|
ncblitter_e blitter; // glyph set to use (maps input to output cells)
|
||||||
uint64_t flags; // bitmask over NCVISUAL_OPTION_*
|
uint64_t flags; // bitmask over NCVISUAL_OPTION_*
|
||||||
uint32_t transcolor; // treat this color as transparent under NCVISUAL_OPTION_ADDALPHA
|
uint32_t transcolor; // treat this color as transparent under NCVISUAL_OPTION_ADDALPHA
|
||||||
|
// pixel offsets within the cell. if NCBLIT_PIXEL is used, the bitmap will
|
||||||
|
// be drawn offset from the upper-left cell's origin by these amounts. it is
|
||||||
|
// an error if either number exceeds the cell-pixel geometry in its
|
||||||
|
// dimension. if NCBLIT_PIXEL is not used, these fields are ignored.
|
||||||
|
// this functionality can be used for smooth bitmap movement.
|
||||||
|
// FIXME not yet implemented.
|
||||||
|
unsigned pxoffy, pxoffx;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create an RGBA flat array from the selected region of the ncplane 'nc'.
|
// Create an RGBA flat array from the selected region of the ncplane 'nc'.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user