44 lines
2.0 KiB
C
44 lines
2.0 KiB
C
/*
|
||
* Математика взаимодействия с графиком: области просмотра, масштабирование, перемещение и
|
||
* координатные преобразования. Расчёты общие для JNI и ctypes; цвета, события GUI и рисование
|
||
* остаются в приложении.
|
||
*/
|
||
|
||
/** @file set_plot.h
|
||
* @brief Toolkit-independent plot interaction math shared by JNI and ctypes.
|
||
* Coordinates are doubles in the caller's units. No allocation or global state.
|
||
*/
|
||
#ifndef SET_PLOT_H
|
||
#define SET_PLOT_H
|
||
#include "pcan_abi.h"
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
enum set_plot_operation {
|
||
SET_PLOT_TRANSFORM = 0, /* x,y,w,h, zoomX,zoomY, panX,panY, focusX,focusY -> x,y,w,h */
|
||
SET_PLOT_AXIS = 1, /* deltaX,deltaY,slop -> 0=none, 1=X, 2=Y */
|
||
SET_PLOT_FRACTION = 2, /* value,low,high,inverted -> fraction (not clamped) */
|
||
SET_PLOT_VALUE = 3, /* fraction,low,high,inverted -> value (not clamped) */
|
||
SET_PLOT_DRAG = 4, /* initial,deltaPixels,length,low,high,inverted -> clamped value */
|
||
SET_PLOT_TICK_STEP = 5, /* range,lengthPixels -> nice step */
|
||
SET_PLOT_DELTA = 6, /* A,B,multiplier -> (B-A)*multiplier */
|
||
SET_PLOT_DB_DELTA = 7, /* A,B -> 20*log10(abs(B/A)); zero is invalid */
|
||
SET_PLOT_LIMITS = 8 /* xMin,xMax,yMin,yMax -> validated unchanged limits */
|
||
};
|
||
|
||
/** Version of this additive plot ABI, independently of the transport ABI. */
|
||
PCAN_ABI_API uint32_t set_plot_abi_version(void);
|
||
/** Evaluates one operation. Returns output count, or 0 for invalid arguments.
|
||
* TRANSFORM rejects malformed viewports; invalid gesture values return the
|
||
* unchanged viewport. Zoom is restricted to 1..128, with focus anchoring.
|
||
* Screen fractions increase downwards; set inverted=1 for the Y value axis.
|
||
*/
|
||
PCAN_ABI_API size_t set_plot_eval(uint32_t operation, const double *input,
|
||
size_t count, double *output, size_t capacity);
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
#endif
|