/usr/include/nordlicht.h is in libnordlicht-dev 0.4.4-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | #ifndef INCLUDE_nordlicht_h__
#define INCLUDE_nordlicht_h__
#include <stdlib.h> // for size_t
#ifndef NORDLICHT_API
# ifdef _WIN32
# if defined(NORDLICHT_BUILD_SHARED) /* build dll */
# define NORDLICHT_API __declspec(dllexport)
# elif !defined(NORDLICHT_BUILD_STATIC) /* use dll */
# define NORDLICHT_API __declspec(dllimport)
# else /* static library */
# define NORDLICHT_API
# endif
# else
# if __GNUC__ >= 4
# define NORDLICHT_API __attribute__((visibility("default")))
# else
# define NORDLICHT_API
# endif
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct nordlicht nordlicht;
typedef enum nordlicht_style {
NORDLICHT_STYLE_THUMBNAILS,
NORDLICHT_STYLE_HORIZONTAL, // compress frames to columns, "move to the right"
NORDLICHT_STYLE_VERTICAL, // compress frames to rows, "move downwards"
NORDLICHT_STYLE_SLITSCAN, // take single columns, while moving to the right (and wrapping to the left)
NORDLICHT_STYLE_MIDDLECOLUMN, // take the frames' middlemost column
NORDLICHT_STYLE_SPECTROGRAM, // spectrogram of the first audio track (not all sample formats are supported yet)
NORDLICHT_STYLE_LAST
} nordlicht_style;
typedef enum nordlicht_strategy {
NORDLICHT_STRATEGY_FAST, // generate barcode in a single pass as fast as possible
NORDLICHT_STRATEGY_LIVE, // generate a fast approximation first, good for live display
} nordlicht_strategy;
// Returns a description of the last error, or NULL if the was no error.
NORDLICHT_API const char *nordlicht_error();
// Allocate a new nordlicht of specific width and height, for a given video
// file. When `live` is true, give a fast approximation before starting the
// slow, exact generation. Use `nordlicht_free` to free the nordlicht again.
// Returns NULL on errors.
NORDLICHT_API nordlicht* nordlicht_init(const char *filename, const int width, const int height);
// Free a nordlicht.
NORDLICHT_API void nordlicht_free(nordlicht *n);
// Specify where to start the nordlicht, in percent between 0 and 1.
NORDLICHT_API int nordlicht_set_start(nordlicht *n, const float start);
// Specify where to end the nordlicht, in percent between 0 and 1.
NORDLICHT_API int nordlicht_set_end(nordlicht *n, const float end);
// Set the output style of the nordlicht. Default is NORDLICHT_STYLE_HORIZONTAL.
// Returns 0 on success. To set multiple styles at once, use `nordlicht_set_styles`.
NORDLICHT_API int nordlicht_set_style(nordlicht *n, const nordlicht_style style);
// Set multiple output styles, which will be displayed on top of each other.
// Expects a pointer to an array of nordlicht_style-s of length `num_styles`.
// Returns 0 on success.
NORDLICHT_API int nordlicht_set_styles(nordlicht *n, const nordlicht_style *styles, const int num_styles);
// Set the generation strategy of the nordlicht. Default is NORDLICHT_STRATEGY_FAST.
// Returns 0 on success. This function will be removed in the future.
NORDLICHT_API int nordlicht_set_strategy(nordlicht *n, const nordlicht_strategy strategy);
// Returns a pointer to the nordlicht's internal buffer. You can use it to draw
// the barcode while it is generated. The pixel format is 32-bit BGRA.
NORDLICHT_API const unsigned char* nordlicht_buffer(const nordlicht *n);
// Replace the internal nordlicht's internal buffer. The data pointer is owned
// by the caller and must be freed after `nordlicht_free`. Returns 0 on success.
NORDLICHT_API int nordlicht_set_buffer(nordlicht *n, unsigned char *data);
// Returns the size of this nordlicht's buffer in bytes.
NORDLICHT_API size_t nordlicht_buffer_size(const nordlicht *n);
// Generate the nordlicht. Calling this will freeze the nordlicht:
// "set" functions will fail. Returns 0 on success.
NORDLICHT_API int nordlicht_generate(nordlicht *n);
// Returns a value between 0 and 1 indicating how much of the nordlicht is done.
NORDLICHT_API float nordlicht_progress(const nordlicht *n);
// Write the nordlicht to a PNG file. Returns 0 on success.
NORDLICHT_API int nordlicht_write(const nordlicht *n, const char *filename);
#ifdef __cplusplus
}
#endif
#endif
|