37 lines
1.6 KiB
C
37 lines
1.6 KiB
C
/* Fotogramas. Todas las operaciones que modifican se pueden deshacer y
|
|
* fallan con TGB_ERR_STATE si hay una sesión de edición abierta. */
|
|
#ifndef TAHGIBU_FRAME_H
|
|
#define TAHGIBU_FRAME_H
|
|
|
|
#include "tahgibu/document.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
size_t tgb_frame_count(const tgb_document *doc);
|
|
uint32_t tgb_frame_id(const tgb_document *doc, size_t index); /* 0 si fuera de rango */
|
|
tgb_status tgb_frame_index_of(const tgb_document *doc, uint32_t id, size_t *out_index);
|
|
uint32_t tgb_frame_duration_ms(const tgb_document *doc, size_t index);
|
|
|
|
/* index == count añade al final. Devuelve el id del nuevo fotograma. */
|
|
tgb_status tgb_frame_add(tgb_document *doc, size_t index, uint32_t *out_id);
|
|
/* Duplica y coloca la copia justo después (comparte memoria hasta editarla). */
|
|
tgb_status tgb_frame_duplicate(tgb_document *doc, size_t index, uint32_t *out_id);
|
|
tgb_status tgb_frame_delete(tgb_document *doc, size_t index); /* nunca el último */
|
|
tgb_status tgb_frame_move(tgb_document *doc, size_t from, size_t to);
|
|
tgb_status tgb_frame_set_duration(tgb_document *doc, size_t index, uint32_t ms);
|
|
|
|
/* Portapapeles de fotogramas (vive en el contexto). Pegar exige mismas
|
|
* dimensiones; las capas se emparejan por posición (las sobrantes se ignoran). */
|
|
tgb_status tgb_frame_copy(tgb_document *doc, size_t index);
|
|
tgb_status tgb_frame_paste(tgb_document *doc, size_t index, uint32_t *out_id);
|
|
|
|
/* Celda de un fotograma/capa. NULL = celda vacía (transparente). Solo lectura. */
|
|
const tgb_canvas *tgb_frame_cel(const tgb_document *doc, size_t frame_index, size_t layer_index);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|