Cleanup: Remove unnecessary keywords in C++ headers

This commit is contained in:
Hans Goudey 2024-01-24 11:46:28 -05:00
parent 500f09b88a
commit d02d6ec4e5
15 changed files with 758 additions and 815 deletions

View File

@ -15,30 +15,30 @@ struct MetaElem;
struct Object;
struct Scene;
struct MetaBall *BKE_mball_add(struct Main *bmain, const char *name);
MetaBall *BKE_mball_add(Main *bmain, const char *name);
bool BKE_mball_is_any_selected(const struct MetaBall *mb);
bool BKE_mball_is_any_selected_multi(struct Base **bases, int bases_len);
bool BKE_mball_is_any_unselected(const struct MetaBall *mb);
bool BKE_mball_is_any_selected(const MetaBall *mb);
bool BKE_mball_is_any_selected_multi(Base **bases, int bases_len);
bool BKE_mball_is_any_unselected(const MetaBall *mb);
/**
* Return `true` if `ob1` and `ob2` are part of the same metaBall group.
*
* \note Currently checks whether their two base names (without numerical suffix) is the same.
*/
bool BKE_mball_is_same_group(const struct Object *ob1, const struct Object *ob2);
bool BKE_mball_is_same_group(const Object *ob1, const Object *ob2);
/**
* Return `true` if `ob1` and `ob2` are part of the same metaBall group, and `ob1` is its
* basis.
*/
bool BKE_mball_is_basis_for(const struct Object *ob1, const struct Object *ob2);
bool BKE_mball_is_basis_for(const Object *ob1, const Object *ob2);
/**
* Test, if \a ob is a basis meta-ball.
*
* It test last character of Object ID name.
* If last character is digit it return 0, else it return 1.
*/
bool BKE_mball_is_basis(const struct Object *ob);
bool BKE_mball_is_basis(const Object *ob);
/**
* This function finds the basis meta-ball.
*
@ -48,7 +48,7 @@ bool BKE_mball_is_basis(const struct Object *ob);
*
* \warning #BKE_mball_is_basis() can fail on returned object, see function docs for details.
*/
struct Object *BKE_mball_basis_find(struct Scene *scene, struct Object *ob);
Object *BKE_mball_basis_find(Scene *scene, Object *ob);
/**
* Copy some properties from a meta-ball obdata to all other meta-ball obdata belonging to the same
@ -59,37 +59,37 @@ struct Object *BKE_mball_basis_find(struct Scene *scene, struct Object *ob);
* `MBall`, `MBall.001`, `MBall.002`, etc). The most important is to copy properties to the base
* meta-ball, because this meta-ball influences polygonization of meta-balls.
*/
void BKE_mball_properties_copy(struct Main *bmain, struct MetaBall *metaball_src);
void BKE_mball_properties_copy(Main *bmain, MetaBall *metaball_src);
bool BKE_mball_minmax_ex(
const struct MetaBall *mb, float min[3], float max[3], const float obmat[4][4], short flag);
const MetaBall *mb, float min[3], float max[3], const float obmat[4][4], short flag);
/* Basic vertex data functions. */
bool BKE_mball_minmax(const struct MetaBall *mb, float min[3], float max[3]);
bool BKE_mball_center_median(const struct MetaBall *mb, float r_cent[3]);
bool BKE_mball_center_bounds(const struct MetaBall *mb, float r_cent[3]);
void BKE_mball_transform(struct MetaBall *mb, const float mat[4][4], bool do_props);
void BKE_mball_translate(struct MetaBall *mb, const float offset[3]);
bool BKE_mball_minmax(const MetaBall *mb, float min[3], float max[3]);
bool BKE_mball_center_median(const MetaBall *mb, float r_cent[3]);
bool BKE_mball_center_bounds(const MetaBall *mb, float r_cent[3]);
void BKE_mball_transform(MetaBall *mb, const float mat[4][4], bool do_props);
void BKE_mball_translate(MetaBall *mb, const float offset[3]);
/**
* Most simple meta-element adding function.
*
* \note don't do context manipulation here (rna uses).
*/
struct MetaElem *BKE_mball_element_add(struct MetaBall *mb, int type);
MetaElem *BKE_mball_element_add(MetaBall *mb, int type);
/* *** Select functions *** */
int BKE_mball_select_count(const struct MetaBall *mb);
int BKE_mball_select_count_multi(struct Base **bases, int bases_len);
bool BKE_mball_select_all(struct MetaBall *mb);
bool BKE_mball_select_all_multi_ex(struct Base **bases, int bases_len);
bool BKE_mball_deselect_all(struct MetaBall *mb);
bool BKE_mball_deselect_all_multi_ex(struct Base **bases, int bases_len);
bool BKE_mball_select_swap(struct MetaBall *mb);
bool BKE_mball_select_swap_multi_ex(struct Base **bases, int bases_len);
int BKE_mball_select_count(const MetaBall *mb);
int BKE_mball_select_count_multi(Base **bases, int bases_len);
bool BKE_mball_select_all(MetaBall *mb);
bool BKE_mball_select_all_multi_ex(Base **bases, int bases_len);
bool BKE_mball_deselect_all(MetaBall *mb);
bool BKE_mball_deselect_all_multi_ex(Base **bases, int bases_len);
bool BKE_mball_select_swap(MetaBall *mb);
bool BKE_mball_select_swap_multi_ex(Base **bases, int bases_len);
/* **** Depsgraph evaluation **** */
void BKE_mball_data_update(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob);
void BKE_mball_data_update(Depsgraph *depsgraph, Scene *scene, Object *ob);

View File

@ -12,8 +12,6 @@ struct Object;
struct Scene;
struct Mesh;
struct Mesh *BKE_mball_polygonize(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
Mesh *BKE_mball_polygonize(Depsgraph *depsgraph, Scene *scene, Object *ob);
void BKE_mball_cubeTable_free(void);
void BKE_mball_cubeTable_free();

View File

@ -95,7 +95,7 @@ enum eUndoPushReturn {
};
ENUM_OPERATORS(eUndoPushReturn, UNDO_PUSH_RET_OVERRIDE_CHANGED)
using UndoTypeForEachIDRefFn = void (*)(void *user_data, struct UndoRefID *id_ref);
using UndoTypeForEachIDRefFn = void (*)(void *user_data, UndoRefID *id_ref);
struct UndoType {
UndoType *next, *prev;
@ -116,11 +116,10 @@ struct UndoType {
* Note that 'step_encode_init' is optional,
* some undo types need to perform operations before undo push finishes.
*/
void (*step_encode_init)(struct bContext *C, UndoStep *us);
void (*step_encode_init)(bContext *C, UndoStep *us);
bool (*step_encode)(struct bContext *C, struct Main *bmain, UndoStep *us);
void (*step_decode)(
struct bContext *C, struct Main *bmain, UndoStep *us, eUndoStepDir dir, bool is_final);
bool (*step_encode)(bContext *C, Main *bmain, UndoStep *us);
void (*step_decode)(bContext *C, Main *bmain, UndoStep *us, eUndoStepDir dir, bool is_final);
/**
* \note When freeing all steps,

View File

@ -9,7 +9,7 @@
*/
bool BM_mesh_boolean(BMesh *bm,
struct BMLoop *(*looptris)[3],
BMLoop *(*looptris)[3],
int looptris_tot,
int (*test_fn)(BMFace *f, void *user_data),
void *user_data,
@ -30,7 +30,7 @@ bool BM_mesh_boolean(BMesh *bm,
* to the intersection result faces.
*/
bool BM_mesh_boolean_knife(BMesh *bm,
struct BMLoop *(*looptris)[3],
BMLoop *(*looptris)[3],
int looptris_tot,
int (*test_fn)(BMFace *f, void *user_data),
void *user_data,

View File

@ -13,26 +13,23 @@ struct BMCalcPathParams {
uint use_step_face : 1;
};
struct LinkNode *BM_mesh_calc_path_vert(BMesh *bm,
BMVert *v_src,
BMVert *v_dst,
const struct BMCalcPathParams *params,
bool (*filter_fn)(BMVert *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3, 5);
LinkNode *BM_mesh_calc_path_vert(BMesh *bm,
BMVert *v_src,
BMVert *v_dst,
const BMCalcPathParams *params,
bool (*filter_fn)(BMVert *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2, 3, 5);
struct LinkNode *BM_mesh_calc_path_edge(BMesh *bm,
BMEdge *e_src,
BMEdge *e_dst,
const struct BMCalcPathParams *params,
bool (*filter_fn)(BMEdge *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3, 5);
LinkNode *BM_mesh_calc_path_edge(BMesh *bm,
BMEdge *e_src,
BMEdge *e_dst,
const BMCalcPathParams *params,
bool (*filter_fn)(BMEdge *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2, 3, 5);
struct LinkNode *BM_mesh_calc_path_face(BMesh *bm,
BMFace *f_src,
BMFace *f_dst,
const struct BMCalcPathParams *params,
bool (*filter_fn)(BMFace *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3, 5);
LinkNode *BM_mesh_calc_path_face(BMesh *bm,
BMFace *f_src,
BMFace *f_dst,
const BMCalcPathParams *params,
bool (*filter_fn)(BMFace *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2, 3, 5);

View File

@ -15,26 +15,26 @@ struct BMCalcPathUVParams {
float aspect_y;
};
struct LinkNode *BM_mesh_calc_path_uv_vert(BMesh *bm,
BMLoop *l_src,
BMLoop *l_dst,
const struct BMCalcPathUVParams *params,
bool (*filter_fn)(BMLoop *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT
LinkNode *BM_mesh_calc_path_uv_vert(BMesh *bm,
BMLoop *l_src,
BMLoop *l_dst,
const BMCalcPathUVParams *params,
bool (*filter_fn)(BMLoop *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3, 5);
struct LinkNode *BM_mesh_calc_path_uv_edge(BMesh *bm,
BMLoop *l_src,
BMLoop *l_dst,
const struct BMCalcPathUVParams *params,
bool (*filter_fn)(BMLoop *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT
LinkNode *BM_mesh_calc_path_uv_edge(BMesh *bm,
BMLoop *l_src,
BMLoop *l_dst,
const BMCalcPathUVParams *params,
bool (*filter_fn)(BMLoop *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3, 5);
struct LinkNode *BM_mesh_calc_path_uv_face(BMesh *bm,
BMFace *f_src,
BMFace *f_dst,
const struct BMCalcPathUVParams *params,
bool (*filter_fn)(BMFace *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT
LinkNode *BM_mesh_calc_path_uv_face(BMesh *bm,
BMFace *f_src,
BMFace *f_dst,
const BMCalcPathUVParams *params,
bool (*filter_fn)(BMFace *, void *),
void *user_data) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3, 5);

View File

@ -16,6 +16,7 @@ struct ARegion;
struct DRWData;
struct DRWInstanceDataList;
struct Depsgraph;
struct DrawDataList;
struct DrawEngineType;
struct GHash;
struct GPUMaterial;
@ -37,23 +38,23 @@ struct ViewLayer;
struct bContext;
struct rcti;
void DRW_engines_register(void);
void DRW_engines_free(void);
void DRW_engines_register();
void DRW_engines_free();
bool DRW_engine_render_support(struct DrawEngineType *draw_engine_type);
void DRW_engine_register(struct DrawEngineType *draw_engine_type);
bool DRW_engine_render_support(DrawEngineType *draw_engine_type);
void DRW_engine_register(DrawEngineType *draw_engine_type);
void DRW_engine_external_free(struct RegionView3D *rv3d);
void DRW_engine_external_free(RegionView3D *rv3d);
typedef struct DRWUpdateContext {
struct Main *bmain;
struct Depsgraph *depsgraph;
struct Scene *scene;
struct ViewLayer *view_layer;
struct ARegion *region;
struct View3D *v3d;
struct RenderEngineType *engine_type;
} DRWUpdateContext;
struct DRWUpdateContext {
Main *bmain;
Depsgraph *depsgraph;
Scene *scene;
ViewLayer *view_layer;
ARegion *region;
View3D *v3d;
RenderEngineType *engine_type;
};
void DRW_notify_view_update(const DRWUpdateContext *update_ctx);
typedef enum eDRWSelectStage {
@ -61,14 +62,14 @@ typedef enum eDRWSelectStage {
DRW_SELECT_PASS_POST,
} eDRWSelectStage;
typedef bool (*DRW_SelectPassFn)(eDRWSelectStage stage, void *user_data);
typedef bool (*DRW_ObjectFilterFn)(struct Object *ob, void *user_data);
typedef bool (*DRW_ObjectFilterFn)(Object *ob, void *user_data);
/**
* Everything starts here.
* This function takes care of calling all cache and rendering functions
* for each relevant engine / mode engine.
*/
void DRW_draw_view(const struct bContext *C);
void DRW_draw_view(const bContext *C);
/**
* Draw render engine info.
*/
@ -78,43 +79,43 @@ void DRW_draw_region_engine_info(int xoffset, int *yoffset, int line_height);
* Used for both regular and off-screen drawing.
* Need to reset DST before calling this function
*/
void DRW_draw_render_loop_ex(struct Depsgraph *depsgraph,
struct RenderEngineType *engine_type,
struct ARegion *region,
struct View3D *v3d,
struct GPUViewport *viewport,
const struct bContext *evil_C);
void DRW_draw_render_loop(struct Depsgraph *depsgraph,
struct ARegion *region,
struct View3D *v3d,
struct GPUViewport *viewport);
void DRW_draw_render_loop_ex(Depsgraph *depsgraph,
RenderEngineType *engine_type,
ARegion *region,
View3D *v3d,
GPUViewport *viewport,
const bContext *evil_C);
void DRW_draw_render_loop(Depsgraph *depsgraph,
ARegion *region,
View3D *v3d,
GPUViewport *viewport);
/**
* \param viewport: can be NULL, in this case we create one.
*/
void DRW_draw_render_loop_offscreen(struct Depsgraph *depsgraph,
struct RenderEngineType *engine_type,
struct ARegion *region,
struct View3D *v3d,
void DRW_draw_render_loop_offscreen(Depsgraph *depsgraph,
RenderEngineType *engine_type,
ARegion *region,
View3D *v3d,
bool is_image_render,
bool draw_background,
bool do_color_management,
struct GPUOffScreen *ofs,
struct GPUViewport *viewport);
void DRW_draw_render_loop_2d_ex(struct Depsgraph *depsgraph,
struct ARegion *region,
struct GPUViewport *viewport,
const struct bContext *evil_C);
GPUOffScreen *ofs,
GPUViewport *viewport);
void DRW_draw_render_loop_2d_ex(Depsgraph *depsgraph,
ARegion *region,
GPUViewport *viewport,
const bContext *evil_C);
/**
* object mode select-loop, see: #ED_view3d_draw_select_loop (legacy drawing).
*/
void DRW_draw_select_loop(struct Depsgraph *depsgraph,
struct ARegion *region,
struct View3D *v3d,
void DRW_draw_select_loop(Depsgraph *depsgraph,
ARegion *region,
View3D *v3d,
bool use_obedit_skip,
bool draw_surface,
bool use_nearest,
bool do_material_sub_selection,
const struct rcti *rect,
const rcti *rect,
DRW_SelectPassFn select_pass_fn,
void *select_pass_user_data,
DRW_ObjectFilterFn object_filter_fn,
@ -122,63 +123,60 @@ void DRW_draw_select_loop(struct Depsgraph *depsgraph,
/**
* Object mode select-loop, see: #ED_view3d_draw_depth_loop (legacy drawing).
*/
void DRW_draw_depth_loop(struct Depsgraph *depsgraph,
struct ARegion *region,
struct View3D *v3d,
struct GPUViewport *viewport,
void DRW_draw_depth_loop(Depsgraph *depsgraph,
ARegion *region,
View3D *v3d,
GPUViewport *viewport,
const bool use_gpencil,
const bool use_basic,
const bool use_overlay);
/**
* Clears the Depth Buffer and draws only the specified object.
*/
void DRW_draw_depth_object(struct Scene *scene,
struct ARegion *region,
struct View3D *v3d,
struct GPUViewport *viewport,
struct Object *object);
void DRW_draw_select_id(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d);
void DRW_draw_depth_object(
Scene *scene, ARegion *region, View3D *v3d, GPUViewport *viewport, Object *object);
void DRW_draw_select_id(Depsgraph *depsgraph, ARegion *region, View3D *v3d);
/* Grease pencil render. */
/**
* Helper to check if exit object type to render.
*/
bool DRW_render_check_grease_pencil(struct Depsgraph *depsgraph);
void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph);
bool DRW_render_check_grease_pencil(Depsgraph *depsgraph);
void DRW_render_gpencil(RenderEngine *engine, Depsgraph *depsgraph);
/**
* This is here because #GPUViewport needs it.
*/
struct DRWInstanceDataList *DRW_instance_data_list_create(void);
void DRW_instance_data_list_free(struct DRWInstanceDataList *idatalist);
void DRW_uniform_attrs_pool_free(struct GHash *table);
DRWInstanceDataList *DRW_instance_data_list_create();
void DRW_instance_data_list_free(DRWInstanceDataList *idatalist);
void DRW_uniform_attrs_pool_free(GHash *table);
void DRW_render_context_enable(struct Render *render);
void DRW_render_context_disable(struct Render *render);
void DRW_render_context_enable(Render *render);
void DRW_render_context_disable(Render *render);
void DRW_gpu_context_create(void);
void DRW_gpu_context_destroy(void);
void DRW_gpu_context_enable(void);
void DRW_gpu_context_disable(void);
void DRW_gpu_context_create();
void DRW_gpu_context_destroy();
void DRW_gpu_context_enable();
void DRW_gpu_context_disable();
#ifdef WITH_XR_OPENXR
/* XXX: see comment on #DRW_system_gpu_context_get() */
void *DRW_system_gpu_context_get(void);
void *DRW_xr_blender_gpu_context_get(void);
void DRW_xr_drawing_begin(void);
void DRW_xr_drawing_end(void);
void *DRW_system_gpu_context_get();
void *DRW_xr_blender_gpu_context_get();
void DRW_xr_drawing_begin();
void DRW_xr_drawing_end();
#endif
/* For garbage collection */
void DRW_cache_free_old_batches(struct Main *bmain);
void DRW_cache_free_old_batches(Main *bmain);
namespace blender::draw {
void DRW_cache_free_old_subdiv(void);
void DRW_cache_free_old_subdiv();
/* For the OpenGL evaluators and garbage collected subdivision data. */
void DRW_subdiv_free(void);
void DRW_subdiv_free();
} // namespace blender::draw
@ -194,29 +192,29 @@ void DRW_system_gpu_render_context_disable(void *re_system_gpu_context);
void DRW_blender_gpu_render_context_enable(void *re_gpu_context);
void DRW_blender_gpu_render_context_disable(void *re_gpu_context);
void DRW_deferred_shader_remove(struct GPUMaterial *mat);
void DRW_deferred_shader_optimize_remove(struct GPUMaterial *mat);
void DRW_deferred_shader_remove(GPUMaterial *mat);
void DRW_deferred_shader_optimize_remove(GPUMaterial *mat);
/**
* Get DrawData from the given ID-block. In order for this to work, we assume that
* the DrawData pointer is stored in the struct in the same fashion as in #IdDdtTemplate.
* the DrawData pointer is stored in the in the same fashion as in #IdDdtTemplate.
*/
struct DrawDataList *DRW_drawdatalist_from_id(struct ID *id);
void DRW_drawdata_free(struct ID *id);
DrawDataList *DRW_drawdatalist_from_id(ID *id);
void DRW_drawdata_free(ID *id);
struct DRWData *DRW_viewport_data_create(void);
void DRW_viewport_data_free(struct DRWData *drw_data);
DRWData *DRW_viewport_data_create();
void DRW_viewport_data_free(DRWData *drw_data);
bool DRW_gpu_context_release(void);
bool DRW_gpu_context_release();
void DRW_gpu_context_activate(bool drw_state);
/**
* We may want to move this into a more general location.
* \note This doesn't require the draw context to be in use.
*/
void DRW_draw_cursor_2d_ex(const struct ARegion *region, const float cursor[2]);
void DRW_draw_cursor_2d_ex(const ARegion *region, const float cursor[2]);
void DRW_cdlayer_attr_aliases_add(struct GPUVertFormat *format,
void DRW_cdlayer_attr_aliases_add(GPUVertFormat *format,
const char *base_name,
int data_type,
const char *layer_name,

View File

@ -71,6 +71,7 @@ struct ParticleSystem;
struct RenderEngineType;
struct bContext;
struct rcti;
struct TaskGraph;
namespace blender::draw {
struct DRW_Attributes;
struct DRW_MeshCDMask;
@ -85,9 +86,9 @@ typedef struct DRWUniform DRWUniform;
typedef struct DRWView DRWView;
/* TODO: Put it somewhere else? */
typedef struct BoundSphere {
struct BoundSphere {
float center[3], radius;
} BoundSphere;
};
/* declare members as empty (unused) */
typedef char DRWViewportEmptyList;
@ -103,141 +104,141 @@ typedef char DRWViewportEmptyList;
DRW_VIEWPORT_LIST_SIZE(*(((ty *)NULL)->stl)), \
}
typedef struct DrawEngineDataSize {
struct DrawEngineDataSize {
int fbl_len;
int txl_len;
int psl_len;
int stl_len;
} DrawEngineDataSize;
};
typedef struct DrawEngineType {
struct DrawEngineType *next, *prev;
struct DrawEngineType {
DrawEngineType *next, *prev;
char idname[32];
const DrawEngineDataSize *vedata_size;
void (*engine_init)(void *vedata);
void (*engine_free)(void);
void (*engine_free)();
void (*instance_free)(void *instance_data);
void (*cache_init)(void *vedata);
void (*cache_populate)(void *vedata, struct Object *ob);
void (*cache_populate)(void *vedata, Object *ob);
void (*cache_finish)(void *vedata);
void (*draw_scene)(void *vedata);
void (*view_update)(void *vedata);
void (*id_update)(void *vedata, struct ID *id);
void (*id_update)(void *vedata, ID *id);
void (*render_to_image)(void *vedata,
struct RenderEngine *engine,
struct RenderLayer *layer,
const struct rcti *rect);
void (*store_metadata)(void *vedata, struct RenderResult *render_result);
} DrawEngineType;
RenderEngine *engine,
RenderLayer *layer,
const rcti *rect);
void (*store_metadata)(void *vedata, RenderResult *render_result);
};
/* Textures */
typedef enum {
enum DRWTextureFlag {
DRW_TEX_FILTER = (1 << 0),
DRW_TEX_WRAP = (1 << 1),
DRW_TEX_COMPARE = (1 << 2),
DRW_TEX_MIPMAP = (1 << 3),
} DRWTextureFlag;
};
/**
* Textures from `DRW_texture_pool_query_*` have the options
* #DRW_TEX_FILTER for color float textures, and no options
* for depth textures and integer textures.
*/
struct GPUTexture *DRW_texture_pool_query_2d(int w,
int h,
eGPUTextureFormat format,
DrawEngineType *engine_type);
struct GPUTexture *DRW_texture_pool_query_fullscreen(eGPUTextureFormat format,
DrawEngineType *engine_type);
GPUTexture *DRW_texture_pool_query_2d(int w,
int h,
eGPUTextureFormat format,
DrawEngineType *engine_type);
GPUTexture *DRW_texture_pool_query_fullscreen(eGPUTextureFormat format,
DrawEngineType *engine_type);
struct GPUTexture *DRW_texture_create_1d(int w,
eGPUTextureFormat format,
DRWTextureFlag flags,
const float *fpixels);
struct GPUTexture *DRW_texture_create_2d(
GPUTexture *DRW_texture_create_1d(int w,
eGPUTextureFormat format,
DRWTextureFlag flags,
const float *fpixels);
GPUTexture *DRW_texture_create_2d(
int w, int h, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
struct GPUTexture *DRW_texture_create_2d_array(
GPUTexture *DRW_texture_create_2d_array(
int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
struct GPUTexture *DRW_texture_create_3d(
GPUTexture *DRW_texture_create_3d(
int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
struct GPUTexture *DRW_texture_create_cube(int w,
eGPUTextureFormat format,
DRWTextureFlag flags,
const float *fpixels);
struct GPUTexture *DRW_texture_create_cube_array(
GPUTexture *DRW_texture_create_cube(int w,
eGPUTextureFormat format,
DRWTextureFlag flags,
const float *fpixels);
GPUTexture *DRW_texture_create_cube_array(
int w, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
void DRW_texture_ensure_fullscreen_2d(struct GPUTexture **tex,
void DRW_texture_ensure_fullscreen_2d(GPUTexture **tex,
eGPUTextureFormat format,
DRWTextureFlag flags);
void DRW_texture_ensure_2d(
struct GPUTexture **tex, int w, int h, eGPUTextureFormat format, DRWTextureFlag flags);
GPUTexture **tex, int w, int h, eGPUTextureFormat format, DRWTextureFlag flags);
/* Explicit parameter variants. */
struct GPUTexture *DRW_texture_pool_query_2d_ex(
GPUTexture *DRW_texture_pool_query_2d_ex(
int w, int h, eGPUTextureFormat format, eGPUTextureUsage usage, DrawEngineType *engine_type);
struct GPUTexture *DRW_texture_pool_query_fullscreen_ex(eGPUTextureFormat format,
eGPUTextureUsage usage,
DrawEngineType *engine_type);
GPUTexture *DRW_texture_pool_query_fullscreen_ex(eGPUTextureFormat format,
eGPUTextureUsage usage,
DrawEngineType *engine_type);
struct GPUTexture *DRW_texture_create_1d_ex(int w,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
struct GPUTexture *DRW_texture_create_2d_ex(int w,
int h,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
struct GPUTexture *DRW_texture_create_2d_array_ex(int w,
int h,
int d,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
struct GPUTexture *DRW_texture_create_3d_ex(int w,
int h,
int d,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
struct GPUTexture *DRW_texture_create_cube_ex(int w,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
struct GPUTexture *DRW_texture_create_cube_array_ex(int w,
int d,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
GPUTexture *DRW_texture_create_1d_ex(int w,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
GPUTexture *DRW_texture_create_2d_ex(int w,
int h,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
GPUTexture *DRW_texture_create_2d_array_ex(int w,
int h,
int d,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
GPUTexture *DRW_texture_create_3d_ex(int w,
int h,
int d,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
GPUTexture *DRW_texture_create_cube_ex(int w,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
GPUTexture *DRW_texture_create_cube_array_ex(int w,
int d,
eGPUTextureFormat format,
eGPUTextureUsage usage_flags,
DRWTextureFlag flags,
const float *fpixels);
void DRW_texture_ensure_fullscreen_2d_ex(struct GPUTexture **tex,
void DRW_texture_ensure_fullscreen_2d_ex(GPUTexture **tex,
eGPUTextureFormat format,
eGPUTextureUsage usage,
DRWTextureFlag flags);
void DRW_texture_ensure_2d_ex(struct GPUTexture **tex,
void DRW_texture_ensure_2d_ex(GPUTexture **tex,
int w,
int h,
eGPUTextureFormat format,
eGPUTextureUsage usage,
DRWTextureFlag flags);
void DRW_texture_generate_mipmaps(struct GPUTexture *tex);
void DRW_texture_free(struct GPUTexture *tex);
void DRW_texture_generate_mipmaps(GPUTexture *tex);
void DRW_texture_free(GPUTexture *tex);
#define DRW_TEXTURE_FREE_SAFE(tex) \
do { \
if (tex != NULL) { \
@ -255,34 +256,34 @@ void DRW_texture_free(struct GPUTexture *tex);
} while (0)
/* Shaders */
struct GPUShader *DRW_shader_create_from_info_name(const char *info_name);
struct GPUShader *DRW_shader_create_ex(
GPUShader *DRW_shader_create_from_info_name(const char *info_name);
GPUShader *DRW_shader_create_ex(
const char *vert, const char *geom, const char *frag, const char *defines, const char *name);
struct GPUShader *DRW_shader_create_with_lib_ex(const char *vert,
const char *geom,
const char *frag,
const char *lib,
const char *defines,
const char *name);
struct GPUShader *DRW_shader_create_with_shaderlib_ex(const char *vert,
const char *geom,
const char *frag,
const DRWShaderLibrary *lib,
const char *defines,
const char *name);
struct GPUShader *DRW_shader_create_with_transform_feedback(const char *vert,
const char *geom,
const char *defines,
eGPUShaderTFBType prim_type,
const char **varying_names,
int varying_count);
struct GPUShader *DRW_shader_create_fullscreen_ex(const char *frag,
const char *defines,
const char *name);
struct GPUShader *DRW_shader_create_fullscreen_with_shaderlib_ex(const char *frag,
const DRWShaderLibrary *lib,
const char *defines,
const char *name);
GPUShader *DRW_shader_create_with_lib_ex(const char *vert,
const char *geom,
const char *frag,
const char *lib,
const char *defines,
const char *name);
GPUShader *DRW_shader_create_with_shaderlib_ex(const char *vert,
const char *geom,
const char *frag,
const DRWShaderLibrary *lib,
const char *defines,
const char *name);
GPUShader *DRW_shader_create_with_transform_feedback(const char *vert,
const char *geom,
const char *defines,
eGPUShaderTFBType prim_type,
const char **varying_names,
int varying_count);
GPUShader *DRW_shader_create_fullscreen_ex(const char *frag,
const char *defines,
const char *name);
GPUShader *DRW_shader_create_fullscreen_with_shaderlib_ex(const char *frag,
const DRWShaderLibrary *lib,
const char *defines,
const char *name);
#define DRW_shader_create(vert, geom, frag, defines) \
DRW_shader_create_ex(vert, geom, frag, defines, __func__)
#define DRW_shader_create_with_lib(vert, geom, frag, lib, defines) \
@ -294,24 +295,24 @@ struct GPUShader *DRW_shader_create_fullscreen_with_shaderlib_ex(const char *fra
#define DRW_shader_create_fullscreen_with_shaderlib(frag, lib, defines) \
DRW_shader_create_fullscreen_with_shaderlib_ex(frag, lib, defines, __func__)
struct GPUMaterial *DRW_shader_from_world(struct World *wo,
struct bNodeTree *ntree,
eGPUMaterialEngine engine,
const uint64_t shader_id,
const bool is_volume_shader,
bool deferred,
GPUCodegenCallbackFn callback,
void *thunk);
struct GPUMaterial *DRW_shader_from_material(struct Material *ma,
struct bNodeTree *ntree,
eGPUMaterialEngine engine,
const uint64_t shader_id,
const bool is_volume_shader,
bool deferred,
GPUCodegenCallbackFn callback,
void *thunk);
void DRW_shader_queue_optimize_material(struct GPUMaterial *mat);
void DRW_shader_free(struct GPUShader *shader);
GPUMaterial *DRW_shader_from_world(World *wo,
bNodeTree *ntree,
eGPUMaterialEngine engine,
const uint64_t shader_id,
const bool is_volume_shader,
bool deferred,
GPUCodegenCallbackFn callback,
void *thunk);
GPUMaterial *DRW_shader_from_material(Material *ma,
bNodeTree *ntree,
eGPUMaterialEngine engine,
const uint64_t shader_id,
const bool is_volume_shader,
bool deferred,
GPUCodegenCallbackFn callback,
void *thunk);
void DRW_shader_queue_optimize_material(GPUMaterial *mat);
void DRW_shader_free(GPUShader *shader);
#define DRW_SHADER_FREE_SAFE(shader) \
do { \
if (shader != NULL) { \
@ -320,7 +321,7 @@ void DRW_shader_free(struct GPUShader *shader);
} \
} while (0)
DRWShaderLibrary *DRW_shader_library_create(void);
DRWShaderLibrary *DRW_shader_library_create();
/**
* \warning Each library must be added after all its dependencies.
@ -352,19 +353,19 @@ void DRW_shader_library_free(DRWShaderLibrary *lib);
/* Batches */
typedef enum {
enum eDRWAttrType {
DRW_ATTR_INT,
DRW_ATTR_FLOAT,
} eDRWAttrType;
};
typedef struct DRWInstanceAttrFormat {
struct DRWInstanceAttrFormat {
char name[32];
eDRWAttrType type;
int components;
} DRWInstanceAttrFormat;
};
struct GPUVertFormat *DRW_shgroup_instance_format_array(const DRWInstanceAttrFormat attrs[],
int arraysize);
GPUVertFormat *DRW_shgroup_instance_format_array(const DRWInstanceAttrFormat attrs[],
int arraysize);
#define DRW_shgroup_instance_format(format, ...) \
do { \
if (format == NULL) { \
@ -374,14 +375,14 @@ struct GPUVertFormat *DRW_shgroup_instance_format_array(const DRWInstanceAttrFor
} \
} while (0)
DRWShadingGroup *DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass);
DRWShadingGroup *DRW_shgroup_create(GPUShader *shader, DRWPass *pass);
DRWShadingGroup *DRW_shgroup_create_sub(DRWShadingGroup *shgroup);
DRWShadingGroup *DRW_shgroup_material_create(struct GPUMaterial *material, DRWPass *pass);
DRWShadingGroup *DRW_shgroup_transform_feedback_create(struct GPUShader *shader,
DRWShadingGroup *DRW_shgroup_material_create(GPUMaterial *material, DRWPass *pass);
DRWShadingGroup *DRW_shgroup_transform_feedback_create(GPUShader *shader,
DRWPass *pass,
struct GPUVertBuf *tf_target);
GPUVertBuf *tf_target);
void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, struct GPUMaterial *material);
void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, GPUMaterial *material);
/**
* Return final visibility.
@ -391,7 +392,7 @@ typedef bool(DRWCallVisibilityFn)(bool vis_in, void *user_data);
void DRW_shgroup_call_ex(DRWShadingGroup *shgroup,
const Object *ob,
const float (*obmat)[4],
struct GPUBatch *geom,
GPUBatch *geom,
bool bypass_culling,
void *user_data);
@ -419,12 +420,12 @@ void DRW_shgroup_call_ex(DRWShadingGroup *shgroup,
DRW_shgroup_call_ex(shgroup, ob, NULL, geom, true, NULL)
void DRW_shgroup_call_range(
DRWShadingGroup *shgroup, const Object *ob, struct GPUBatch *geom, uint v_sta, uint v_num);
DRWShadingGroup *shgroup, const Object *ob, GPUBatch *geom, uint v_sta, uint v_num);
/**
* A count of 0 instance will use the default number of instance in the batch.
*/
void DRW_shgroup_call_instance_range(
DRWShadingGroup *shgroup, const Object *ob, struct GPUBatch *geom, uint i_sta, uint i_num);
DRWShadingGroup *shgroup, const Object *ob, GPUBatch *geom, uint i_sta, uint i_num);
void DRW_shgroup_call_compute(DRWShadingGroup *shgroup,
int groups_x_len,
@ -451,15 +452,15 @@ void DRW_shgroup_call_procedural_indirect(DRWShadingGroup *shgroup,
*/
void DRW_shgroup_call_instances(DRWShadingGroup *shgroup,
const Object *ob,
struct GPUBatch *geom,
GPUBatch *geom,
uint count);
/**
* \warning Only use with Shaders that have INSTANCED_ATTR defined.
*/
void DRW_shgroup_call_instances_with_attrs(DRWShadingGroup *shgroup,
const Object *ob,
struct GPUBatch *geom,
struct GPUBatch *inst_attributes);
GPUBatch *geom,
GPUBatch *inst_attributes);
void DRW_shgroup_call_sculpt(DRWShadingGroup *shgroup,
Object *ob,
@ -470,16 +471,16 @@ void DRW_shgroup_call_sculpt(DRWShadingGroup *shgroup,
bool use_uv);
void DRW_shgroup_call_sculpt_with_materials(DRWShadingGroup **shgroups,
struct GPUMaterial **gpumats,
GPUMaterial **gpumats,
int num_shgroups,
const Object *ob);
DRWCallBuffer *DRW_shgroup_call_buffer(DRWShadingGroup *shgroup,
struct GPUVertFormat *format,
GPUVertFormat *format,
GPUPrimType prim_type);
DRWCallBuffer *DRW_shgroup_call_buffer_instance(DRWShadingGroup *shgroup,
struct GPUVertFormat *format,
struct GPUBatch *geom);
GPUVertFormat *format,
GPUBatch *geom);
void DRW_buffer_add_entry_struct(DRWCallBuffer *callbuf, const void *data);
void DRW_buffer_add_entry_array(DRWCallBuffer *callbuf, const void *attr[], uint attr_len);
@ -536,7 +537,7 @@ void DRW_shgroup_clear_framebuffer(DRWShadingGroup *shgroup,
void DRW_shgroup_uniform_texture_ex(DRWShadingGroup *shgroup,
const char *name,
const struct GPUTexture *tex,
const GPUTexture *tex,
GPUSamplerState sampler_state);
void DRW_shgroup_uniform_texture_ref_ex(DRWShadingGroup *shgroup,
const char *name,
@ -544,22 +545,20 @@ void DRW_shgroup_uniform_texture_ref_ex(DRWShadingGroup *shgroup,
GPUSamplerState sampler_state);
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup,
const char *name,
const struct GPUTexture *tex);
void DRW_shgroup_uniform_texture_ref(DRWShadingGroup *shgroup,
const char *name,
struct GPUTexture **tex);
const GPUTexture *tex);
void DRW_shgroup_uniform_texture_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex);
void DRW_shgroup_uniform_block_ex(DRWShadingGroup *shgroup,
const char *name,
const struct GPUUniformBuf *ubo DRW_DEBUG_FILE_LINE_ARGS);
const GPUUniformBuf *ubo DRW_DEBUG_FILE_LINE_ARGS);
void DRW_shgroup_uniform_block_ref_ex(DRWShadingGroup *shgroup,
const char *name,
struct GPUUniformBuf **ubo DRW_DEBUG_FILE_LINE_ARGS);
GPUUniformBuf **ubo DRW_DEBUG_FILE_LINE_ARGS);
void DRW_shgroup_storage_block_ex(DRWShadingGroup *shgroup,
const char *name,
const struct GPUStorageBuf *ssbo DRW_DEBUG_FILE_LINE_ARGS);
const GPUStorageBuf *ssbo DRW_DEBUG_FILE_LINE_ARGS);
void DRW_shgroup_storage_block_ref_ex(DRWShadingGroup *shgroup,
const char *name,
struct GPUStorageBuf **ssbo DRW_DEBUG_FILE_LINE_ARGS);
GPUStorageBuf **ssbo DRW_DEBUG_FILE_LINE_ARGS);
void DRW_shgroup_uniform_float(DRWShadingGroup *shgroup,
const char *name,
const float *value,
@ -620,16 +619,16 @@ void DRW_shgroup_uniform_mat4_copy(DRWShadingGroup *shgroup,
const float (*value)[4]);
void DRW_shgroup_vertex_buffer_ex(DRWShadingGroup *shgroup,
const char *name,
struct GPUVertBuf *vertex_buffer DRW_DEBUG_FILE_LINE_ARGS);
GPUVertBuf *vertex_buffer DRW_DEBUG_FILE_LINE_ARGS);
void DRW_shgroup_vertex_buffer_ref_ex(DRWShadingGroup *shgroup,
const char *name,
struct GPUVertBuf **vertex_buffer DRW_DEBUG_FILE_LINE_ARGS);
GPUVertBuf **vertex_buffer DRW_DEBUG_FILE_LINE_ARGS);
void DRW_shgroup_buffer_texture(DRWShadingGroup *shgroup,
const char *name,
struct GPUVertBuf *vertex_buffer);
GPUVertBuf *vertex_buffer);
void DRW_shgroup_buffer_texture_ref(DRWShadingGroup *shgroup,
const char *name,
struct GPUVertBuf **vertex_buffer);
GPUVertBuf **vertex_buffer);
#ifdef DRW_UNUSED_RESOURCE_TRACKING
# define DRW_shgroup_vertex_buffer(shgroup, name, vert) \
@ -725,7 +724,7 @@ void DRW_view_update_sub(DRWView *view, const float viewmat[4][4], const float w
/**
* \return default view if it is a viewport render.
*/
const DRWView *DRW_view_default_get(void);
const DRWView *DRW_view_default_get();
/**
* MUST only be called once per render and only in render mode. Sets default view.
*/
@ -733,12 +732,12 @@ void DRW_view_default_set(const DRWView *view);
/**
* \warning Only use in render AND only if you are going to set view_default again.
*/
void DRW_view_reset(void);
void DRW_view_reset();
/**
* Set active view for rendering.
*/
void DRW_view_set_active(const DRWView *view);
const DRWView *DRW_view_get_active(void);
const DRWView *DRW_view_get_active();
/**
* This only works if DRWPasses have been tagged with DRW_STATE_CLIP_PLANES,
@ -799,34 +798,29 @@ void DRW_culling_frustum_planes_get(const DRWView *view, float planes[6][4]);
/* Viewport. */
const float *DRW_viewport_size_get(void);
const float *DRW_viewport_invert_size_get(void);
const float *DRW_viewport_pixelsize_get(void);
const float *DRW_viewport_size_get();
const float *DRW_viewport_invert_size_get();
const float *DRW_viewport_pixelsize_get();
struct DefaultFramebufferList *DRW_viewport_framebuffer_list_get(void);
struct DefaultTextureList *DRW_viewport_texture_list_get(void);
DefaultFramebufferList *DRW_viewport_framebuffer_list_get();
DefaultTextureList *DRW_viewport_texture_list_get();
void DRW_viewport_request_redraw(void);
void DRW_viewport_request_redraw();
void DRW_render_to_image(struct RenderEngine *engine, struct Depsgraph *depsgraph);
void DRW_render_object_iter(void *vedata,
struct RenderEngine *engine,
struct Depsgraph *depsgraph,
void (*callback)(void *vedata,
struct Object *ob,
struct RenderEngine *engine,
struct Depsgraph *depsgraph));
void DRW_render_to_image(RenderEngine *engine, Depsgraph *depsgraph);
void DRW_render_object_iter(
void *vedata,
RenderEngine *engine,
Depsgraph *depsgraph,
void (*callback)(void *vedata, Object *ob, RenderEngine *engine, Depsgraph *depsgraph));
/**
* Must run after all instance datas have been added.
*/
void DRW_render_instance_buffer_finish(void);
void DRW_render_instance_buffer_finish();
/**
* \warning Changing frame might free the #ViewLayerEngineData.
*/
void DRW_render_set_time(struct RenderEngine *engine,
struct Depsgraph *depsgraph,
int frame,
float subframe);
void DRW_render_set_time(RenderEngine *engine, Depsgraph *depsgraph, int frame, float subframe);
/**
* \warning only use for custom pipeline. 99% of the time, you don't want to use this.
*/
@ -838,24 +832,24 @@ void DRW_render_viewport_size_set(const int size[2]);
* \warning similar to DRW_render_to_image you cannot use default lists (`dfbl` & `dtxl`).
*/
void DRW_custom_pipeline(DrawEngineType *draw_engine_type,
struct Depsgraph *depsgraph,
Depsgraph *depsgraph,
void (*callback)(void *vedata, void *user_data),
void *user_data);
/**
* Same as `DRW_custom_pipeline` but allow better code-flow than a callback.
*/
void DRW_custom_pipeline_begin(DrawEngineType *draw_engine_type, struct Depsgraph *depsgraph);
void DRW_custom_pipeline_end(void);
void DRW_custom_pipeline_begin(DrawEngineType *draw_engine_type, Depsgraph *depsgraph);
void DRW_custom_pipeline_end();
/**
* Used when the render engine want to redo another cache populate inside the same render frame.
*/
void DRW_cache_restart(void);
void DRW_cache_restart();
/* ViewLayers */
void *DRW_view_layer_engine_data_get(DrawEngineType *engine_type);
void **DRW_view_layer_engine_data_ensure_ex(struct ViewLayer *view_layer,
void **DRW_view_layer_engine_data_ensure_ex(ViewLayer *view_layer,
DrawEngineType *engine_type,
void (*callback)(void *storage));
void **DRW_view_layer_engine_data_ensure(DrawEngineType *engine_type,
@ -876,7 +870,7 @@ void **DRW_duplidata_get(void *vedata);
/* Settings. */
bool DRW_object_is_renderable(const struct Object *ob);
bool DRW_object_is_renderable(const Object *ob);
/**
* Does `ob` needs to be rendered in edit mode.
*
@ -884,19 +878,19 @@ bool DRW_object_is_renderable(const struct Object *ob);
* it is in edit mode, when another object with the same mesh is in edit mode.
* This will not be the case when one of the objects are influenced by modifiers.
*/
bool DRW_object_is_in_edit_mode(const struct Object *ob);
bool DRW_object_is_in_edit_mode(const Object *ob);
/**
* Return whether this object is visible depending if
* we are rendering or drawing in the viewport.
*/
int DRW_object_visibility_in_active_context(const struct Object *ob);
bool DRW_object_use_hide_faces(const struct Object *ob);
int DRW_object_visibility_in_active_context(const Object *ob);
bool DRW_object_use_hide_faces(const Object *ob);
bool DRW_object_is_visible_psys_in_active_context(const struct Object *object,
const struct ParticleSystem *psys);
bool DRW_object_is_visible_psys_in_active_context(const Object *object,
const ParticleSystem *psys);
struct Object *DRW_object_get_dupli_parent(const struct Object *ob);
struct DupliObject *DRW_object_get_dupli(const struct Object *ob);
Object *DRW_object_get_dupli_parent(const Object *ob);
DupliObject *DRW_object_get_dupli(const Object *ob);
/* Draw commands */
@ -906,14 +900,14 @@ void DRW_draw_pass(DRWPass *pass);
*/
void DRW_draw_pass_subset(DRWPass *pass, DRWShadingGroup *start_group, DRWShadingGroup *end_group);
void DRW_draw_callbacks_pre_scene(void);
void DRW_draw_callbacks_post_scene(void);
void DRW_draw_callbacks_pre_scene();
void DRW_draw_callbacks_post_scene();
/**
* Reset state to not interfere with other UI draw-call.
*/
void DRW_state_reset_ex(DRWState state);
void DRW_state_reset(void);
void DRW_state_reset();
/**
* Use with care, intended so selection code can override passes depth settings,
* which is important for selection to work properly.
@ -932,64 +926,64 @@ void DRW_select_load_id(uint id);
* When false, drawing doesn't output to a pixel buffer
* eg: Occlusion queries, or when we have setup a context to draw in already.
*/
bool DRW_state_is_fbo(void);
bool DRW_state_is_fbo();
/**
* For when engines need to know if this is drawing for selection or not.
*/
bool DRW_state_is_select(void);
bool DRW_state_is_material_select(void);
bool DRW_state_is_depth(void);
bool DRW_state_is_select();
bool DRW_state_is_material_select();
bool DRW_state_is_depth();
/**
* Whether we are rendering for an image
*/
bool DRW_state_is_image_render(void);
bool DRW_state_is_image_render();
/**
* Whether we are rendering only the render engine,
* or if we should also render the mode engines.
*/
bool DRW_state_is_scene_render(void);
bool DRW_state_is_scene_render();
/**
* Whether we are rendering simple opengl render
*/
bool DRW_state_is_viewport_image_render(void);
bool DRW_state_is_playback(void);
bool DRW_state_is_viewport_image_render();
bool DRW_state_is_playback();
/**
* Is the user navigating the region.
*/
bool DRW_state_is_navigating(void);
bool DRW_state_is_navigating();
/**
* Should text draw in this mode?
*/
bool DRW_state_show_text(void);
bool DRW_state_show_text();
/**
* Should draw support elements
* Objects center, selection outline, probe data, ...
*/
bool DRW_state_draw_support(void);
bool DRW_state_draw_support();
/**
* Whether we should render the background
*/
bool DRW_state_draw_background(void);
bool DRW_state_draw_background();
/* Avoid too many lookups while drawing */
typedef struct DRWContextState {
struct DRWContextState {
struct ARegion *region; /* 'CTX_wm_region(C)' */
struct RegionView3D *rv3d; /* 'CTX_wm_region_view3d(C)' */
struct View3D *v3d; /* 'CTX_wm_view3d(C)' */
struct SpaceLink *space_data; /* 'CTX_wm_space_data(C)' */
ARegion *region; /* 'CTX_wm_region(C)' */
RegionView3D *rv3d; /* 'CTX_wm_region_view3d(C)' */
View3D *v3d; /* 'CTX_wm_view3d(C)' */
SpaceLink *space_data; /* 'CTX_wm_space_data(C)' */
struct Scene *scene; /* 'CTX_data_scene(C)' */
struct ViewLayer *view_layer; /* 'CTX_data_view_layer(C)' */
Scene *scene; /* 'CTX_data_scene(C)' */
ViewLayer *view_layer; /* 'CTX_data_view_layer(C)' */
/* Use 'object_edit' for edit-mode */
struct Object *obact;
Object *obact;
struct RenderEngineType *engine_type;
RenderEngineType *engine_type;
struct Depsgraph *depsgraph;
Depsgraph *depsgraph;
struct TaskGraph *task_graph;
TaskGraph *task_graph;
eObjectMode object_mode;
@ -997,20 +991,19 @@ typedef struct DRWContextState {
/** Last resort (some functions take this as an arg so we can't easily avoid).
* May be NULL when used for selection or depth buffer. */
const struct bContext *evil_C;
const bContext *evil_C;
/* ---- */
/* Cache: initialized by 'drw_context_state_init'. */
struct Object *object_pose;
struct Object *object_edit;
Object *object_pose;
Object *object_edit;
};
} DRWContextState;
const DRWContextState *DRW_context_state_get();
const DRWContextState *DRW_context_state_get(void);
void DRW_mesh_batch_cache_get_attributes(struct Object *object,
struct Mesh *mesh,
void DRW_mesh_batch_cache_get_attributes(Object *object,
Mesh *mesh,
blender::draw::DRW_Attributes **r_attrs,
blender::draw::DRW_MeshCDMask **r_cd_needed);

View File

@ -33,210 +33,208 @@ typedef enum eDRWLevelOfDetail {
DRW_LOD_MAX, /* Max number of level of detail */
} eDRWLevelOfDetail;
void DRW_shape_cache_free(void);
void DRW_shape_cache_free();
/* 3D cursor */
struct GPUBatch *DRW_cache_cursor_get(bool crosshair_lines);
GPUBatch *DRW_cache_cursor_get(bool crosshair_lines);
/* Common Shapes */
struct GPUBatch *DRW_cache_groundline_get(void);
GPUBatch *DRW_cache_groundline_get();
/* Grid */
struct GPUBatch *DRW_cache_grid_get(void);
GPUBatch *DRW_cache_grid_get();
/**
* Use this one for rendering full-screen passes. For 3D objects use #DRW_cache_quad_get().
*/
struct GPUBatch *DRW_cache_fullscreen_quad_get(void);
GPUBatch *DRW_cache_fullscreen_quad_get();
/* Just a regular quad with 4 vertices. */
struct GPUBatch *DRW_cache_quad_get(void);
GPUBatch *DRW_cache_quad_get();
/* Just a regular quad with 4 vertices - wires. */
struct GPUBatch *DRW_cache_quad_wires_get(void);
struct GPUBatch *DRW_cache_cube_get(void);
struct GPUBatch *DRW_cache_normal_arrow_get(void);
GPUBatch *DRW_cache_quad_wires_get();
GPUBatch *DRW_cache_cube_get();
GPUBatch *DRW_cache_normal_arrow_get();
struct GPUBatch *DRW_cache_sphere_get(eDRWLevelOfDetail level_of_detail);
GPUBatch *DRW_cache_sphere_get(eDRWLevelOfDetail level_of_detail);
/* Dummy VBOs */
struct GPUBatch *DRW_gpencil_dummy_buffer_get(void);
GPUBatch *DRW_gpencil_dummy_buffer_get();
/* Common Object */
struct GPUBatch *DRW_cache_object_all_edges_get(struct Object *ob);
struct GPUBatch *DRW_cache_object_edge_detection_get(struct Object *ob, bool *r_is_manifold);
struct GPUBatch *DRW_cache_object_surface_get(struct Object *ob);
struct GPUBatch *DRW_cache_object_loose_edges_get(struct Object *ob);
struct GPUBatch **DRW_cache_object_surface_material_get(struct Object *ob,
struct GPUMaterial **gpumat_array,
uint gpumat_array_len);
struct GPUBatch *DRW_cache_object_face_wireframe_get(struct Object *ob);
int DRW_cache_object_material_count_get(const struct Object *ob);
GPUBatch *DRW_cache_object_all_edges_get(Object *ob);
GPUBatch *DRW_cache_object_edge_detection_get(Object *ob, bool *r_is_manifold);
GPUBatch *DRW_cache_object_surface_get(Object *ob);
GPUBatch *DRW_cache_object_loose_edges_get(Object *ob);
GPUBatch **DRW_cache_object_surface_material_get(Object *ob,
GPUMaterial **gpumat_array,
uint gpumat_array_len);
GPUBatch *DRW_cache_object_face_wireframe_get(Object *ob);
int DRW_cache_object_material_count_get(const Object *ob);
/**
* Returns the vertbuf used by shaded surface batch.
*/
struct GPUVertBuf *DRW_cache_object_pos_vertbuf_get(struct Object *ob);
GPUVertBuf *DRW_cache_object_pos_vertbuf_get(Object *ob);
/* Empties */
struct GPUBatch *DRW_cache_plain_axes_get(void);
struct GPUBatch *DRW_cache_single_arrow_get(void);
struct GPUBatch *DRW_cache_empty_cube_get(void);
struct GPUBatch *DRW_cache_circle_get(void);
struct GPUBatch *DRW_cache_empty_sphere_get(void);
struct GPUBatch *DRW_cache_empty_cylinder_get(void);
struct GPUBatch *DRW_cache_empty_cone_get(void);
struct GPUBatch *DRW_cache_empty_capsule_cap_get(void);
struct GPUBatch *DRW_cache_empty_capsule_body_get(void);
GPUBatch *DRW_cache_plain_axes_get();
GPUBatch *DRW_cache_single_arrow_get();
GPUBatch *DRW_cache_empty_cube_get();
GPUBatch *DRW_cache_circle_get();
GPUBatch *DRW_cache_empty_sphere_get();
GPUBatch *DRW_cache_empty_cylinder_get();
GPUBatch *DRW_cache_empty_cone_get();
GPUBatch *DRW_cache_empty_capsule_cap_get();
GPUBatch *DRW_cache_empty_capsule_body_get();
/* Force Field */
struct GPUBatch *DRW_cache_field_wind_get(void);
struct GPUBatch *DRW_cache_field_force_get(void);
struct GPUBatch *DRW_cache_field_vortex_get(void);
GPUBatch *DRW_cache_field_wind_get();
GPUBatch *DRW_cache_field_force_get();
GPUBatch *DRW_cache_field_vortex_get();
/* Screen-aligned circle. */
struct GPUBatch *DRW_cache_field_curve_get(void);
struct GPUBatch *DRW_cache_field_tube_limit_get(void);
struct GPUBatch *DRW_cache_field_cone_limit_get(void);
GPUBatch *DRW_cache_field_curve_get();
GPUBatch *DRW_cache_field_tube_limit_get();
GPUBatch *DRW_cache_field_cone_limit_get();
/* Screen-aligned dashed circle */
struct GPUBatch *DRW_cache_field_sphere_limit_get(void);
GPUBatch *DRW_cache_field_sphere_limit_get();
/* Lights */
struct GPUBatch *DRW_cache_light_icon_inner_lines_get(void);
struct GPUBatch *DRW_cache_light_icon_outer_lines_get(void);
struct GPUBatch *DRW_cache_light_icon_sun_rays_get(void);
struct GPUBatch *DRW_cache_light_point_lines_get(void);
struct GPUBatch *DRW_cache_light_sun_lines_get(void);
struct GPUBatch *DRW_cache_light_spot_lines_get(void);
struct GPUBatch *DRW_cache_light_area_disk_lines_get(void);
struct GPUBatch *DRW_cache_light_area_square_lines_get(void);
struct GPUBatch *DRW_cache_light_spot_volume_get(void);
GPUBatch *DRW_cache_light_icon_inner_lines_get();
GPUBatch *DRW_cache_light_icon_outer_lines_get();
GPUBatch *DRW_cache_light_icon_sun_rays_get();
GPUBatch *DRW_cache_light_point_lines_get();
GPUBatch *DRW_cache_light_sun_lines_get();
GPUBatch *DRW_cache_light_spot_lines_get();
GPUBatch *DRW_cache_light_area_disk_lines_get();
GPUBatch *DRW_cache_light_area_square_lines_get();
GPUBatch *DRW_cache_light_spot_volume_get();
/* Camera */
struct GPUBatch *DRW_cache_camera_frame_get(void);
struct GPUBatch *DRW_cache_camera_volume_get(void);
struct GPUBatch *DRW_cache_camera_volume_wire_get(void);
struct GPUBatch *DRW_cache_camera_tria_wire_get(void);
struct GPUBatch *DRW_cache_camera_tria_get(void);
struct GPUBatch *DRW_cache_camera_distances_get(void);
GPUBatch *DRW_cache_camera_frame_get();
GPUBatch *DRW_cache_camera_volume_get();
GPUBatch *DRW_cache_camera_volume_wire_get();
GPUBatch *DRW_cache_camera_tria_wire_get();
GPUBatch *DRW_cache_camera_tria_get();
GPUBatch *DRW_cache_camera_distances_get();
/* Speaker */
struct GPUBatch *DRW_cache_speaker_get(void);
GPUBatch *DRW_cache_speaker_get();
/* Probe */
struct GPUBatch *DRW_cache_lightprobe_cube_get(void);
struct GPUBatch *DRW_cache_lightprobe_grid_get(void);
struct GPUBatch *DRW_cache_lightprobe_planar_get(void);
GPUBatch *DRW_cache_lightprobe_cube_get();
GPUBatch *DRW_cache_lightprobe_grid_get();
GPUBatch *DRW_cache_lightprobe_planar_get();
/* Bones */
struct GPUBatch *DRW_cache_bone_octahedral_get(void);
struct GPUBatch *DRW_cache_bone_octahedral_wire_get(void);
struct GPUBatch *DRW_cache_bone_box_get(void);
struct GPUBatch *DRW_cache_bone_box_wire_get(void);
struct GPUBatch *DRW_cache_bone_envelope_solid_get(void);
struct GPUBatch *DRW_cache_bone_envelope_outline_get(void);
struct GPUBatch *DRW_cache_bone_point_get(void);
struct GPUBatch *DRW_cache_bone_point_wire_outline_get(void);
struct GPUBatch *DRW_cache_bone_stick_get(void);
struct GPUBatch *DRW_cache_bone_arrows_get(void);
struct GPUBatch *DRW_cache_bone_dof_sphere_get(void);
struct GPUBatch *DRW_cache_bone_dof_lines_get(void);
GPUBatch *DRW_cache_bone_octahedral_get();
GPUBatch *DRW_cache_bone_octahedral_wire_get();
GPUBatch *DRW_cache_bone_box_get();
GPUBatch *DRW_cache_bone_box_wire_get();
GPUBatch *DRW_cache_bone_envelope_solid_get();
GPUBatch *DRW_cache_bone_envelope_outline_get();
GPUBatch *DRW_cache_bone_point_get();
GPUBatch *DRW_cache_bone_point_wire_outline_get();
GPUBatch *DRW_cache_bone_stick_get();
GPUBatch *DRW_cache_bone_arrows_get();
GPUBatch *DRW_cache_bone_dof_sphere_get();
GPUBatch *DRW_cache_bone_dof_lines_get();
/* Meshes */
struct GPUBatch *DRW_cache_mesh_all_verts_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_all_edges_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_loose_edges_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_edge_detection_get(struct Object *ob, bool *r_is_manifold);
struct GPUBatch *DRW_cache_mesh_surface_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_surface_edges_get(struct Object *ob);
GPUBatch *DRW_cache_mesh_all_verts_get(Object *ob);
GPUBatch *DRW_cache_mesh_all_edges_get(Object *ob);
GPUBatch *DRW_cache_mesh_loose_edges_get(Object *ob);
GPUBatch *DRW_cache_mesh_edge_detection_get(Object *ob, bool *r_is_manifold);
GPUBatch *DRW_cache_mesh_surface_get(Object *ob);
GPUBatch *DRW_cache_mesh_surface_edges_get(Object *ob);
/**
* Return list of batches with length equal to `max(1, totcol)`.
*/
struct GPUBatch **DRW_cache_mesh_surface_shaded_get(struct Object *ob,
struct GPUMaterial **gpumat_array,
uint gpumat_array_len);
GPUBatch **DRW_cache_mesh_surface_shaded_get(Object *ob,
GPUMaterial **gpumat_array,
uint gpumat_array_len);
/**
* Return list of batches with length equal to `max(1, totcol)`.
*/
struct GPUBatch **DRW_cache_mesh_surface_texpaint_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_surface_texpaint_single_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_surface_vertpaint_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_surface_sculptcolors_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_surface_weights_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_surface_mesh_analysis_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_face_wireframe_get(struct Object *ob);
struct GPUBatch *DRW_cache_mesh_surface_viewer_attribute_get(struct Object *ob);
GPUBatch **DRW_cache_mesh_surface_texpaint_get(Object *ob);
GPUBatch *DRW_cache_mesh_surface_texpaint_single_get(Object *ob);
GPUBatch *DRW_cache_mesh_surface_vertpaint_get(Object *ob);
GPUBatch *DRW_cache_mesh_surface_sculptcolors_get(Object *ob);
GPUBatch *DRW_cache_mesh_surface_weights_get(Object *ob);
GPUBatch *DRW_cache_mesh_surface_mesh_analysis_get(Object *ob);
GPUBatch *DRW_cache_mesh_face_wireframe_get(Object *ob);
GPUBatch *DRW_cache_mesh_surface_viewer_attribute_get(Object *ob);
/* Curve */
struct GPUBatch *DRW_cache_curve_edge_wire_get(struct Object *ob);
struct GPUBatch *DRW_cache_curve_edge_wire_viewer_attribute_get(struct Object *ob);
GPUBatch *DRW_cache_curve_edge_wire_get(Object *ob);
GPUBatch *DRW_cache_curve_edge_wire_viewer_attribute_get(Object *ob);
/* edit-mode */
struct GPUBatch *DRW_cache_curve_edge_normal_get(struct Object *ob);
struct GPUBatch *DRW_cache_curve_edge_overlay_get(struct Object *ob);
struct GPUBatch *DRW_cache_curve_vert_overlay_get(struct Object *ob);
GPUBatch *DRW_cache_curve_edge_normal_get(Object *ob);
GPUBatch *DRW_cache_curve_edge_overlay_get(Object *ob);
GPUBatch *DRW_cache_curve_vert_overlay_get(Object *ob);
/* Font */
struct GPUBatch *DRW_cache_text_edge_wire_get(struct Object *ob);
GPUBatch *DRW_cache_text_edge_wire_get(Object *ob);
/* Surface */
struct GPUBatch *DRW_cache_surf_edge_wire_get(struct Object *ob);
GPUBatch *DRW_cache_surf_edge_wire_get(Object *ob);
/* Lattice */
struct GPUBatch *DRW_cache_lattice_verts_get(struct Object *ob);
struct GPUBatch *DRW_cache_lattice_wire_get(struct Object *ob, bool use_weight);
struct GPUBatch *DRW_cache_lattice_vert_overlay_get(struct Object *ob);
GPUBatch *DRW_cache_lattice_verts_get(Object *ob);
GPUBatch *DRW_cache_lattice_wire_get(Object *ob, bool use_weight);
GPUBatch *DRW_cache_lattice_vert_overlay_get(Object *ob);
/* Particles */
struct GPUBatch *DRW_cache_particles_get_hair(struct Object *object,
struct ParticleSystem *psys,
struct ModifierData *md);
struct GPUBatch *DRW_cache_particles_get_dots(struct Object *object, struct ParticleSystem *psys);
struct GPUBatch *DRW_cache_particles_get_edit_strands(struct Object *object,
struct ParticleSystem *psys,
struct PTCacheEdit *edit,
bool use_weight);
struct GPUBatch *DRW_cache_particles_get_edit_inner_points(struct Object *object,
struct ParticleSystem *psys,
struct PTCacheEdit *edit);
struct GPUBatch *DRW_cache_particles_get_edit_tip_points(struct Object *object,
struct ParticleSystem *psys,
struct PTCacheEdit *edit);
struct GPUBatch *DRW_cache_particles_get_prim(int type);
GPUBatch *DRW_cache_particles_get_hair(Object *object, ParticleSystem *psys, ModifierData *md);
GPUBatch *DRW_cache_particles_get_dots(Object *object, ParticleSystem *psys);
GPUBatch *DRW_cache_particles_get_edit_strands(Object *object,
ParticleSystem *psys,
PTCacheEdit *edit,
bool use_weight);
GPUBatch *DRW_cache_particles_get_edit_inner_points(Object *object,
ParticleSystem *psys,
PTCacheEdit *edit);
GPUBatch *DRW_cache_particles_get_edit_tip_points(Object *object,
ParticleSystem *psys,
PTCacheEdit *edit);
GPUBatch *DRW_cache_particles_get_prim(int type);
/* Curves */
struct GPUBatch *DRW_cache_curves_surface_get(struct Object *ob);
struct GPUBatch **DRW_cache_curves_surface_shaded_get(struct Object *ob,
struct GPUMaterial **gpumat_array,
uint gpumat_array_len);
struct GPUBatch *DRW_cache_curves_face_wireframe_get(struct Object *ob);
struct GPUBatch *DRW_cache_curves_edge_detection_get(struct Object *ob, bool *r_is_manifold);
GPUBatch *DRW_cache_curves_surface_get(Object *ob);
GPUBatch **DRW_cache_curves_surface_shaded_get(Object *ob,
GPUMaterial **gpumat_array,
uint gpumat_array_len);
GPUBatch *DRW_cache_curves_face_wireframe_get(Object *ob);
GPUBatch *DRW_cache_curves_edge_detection_get(Object *ob, bool *r_is_manifold);
/* Volume */
typedef struct DRWVolumeGrid {
struct DRWVolumeGrid *next, *prev;
struct DRWVolumeGrid {
DRWVolumeGrid *next, *prev;
/* Grid name. */
char *name;
/* 3D texture. */
struct GPUTexture *texture;
GPUTexture *texture;
/* Transform between 0..1 texture space and object space. */
float texture_to_object[4][4];
@ -245,47 +243,41 @@ typedef struct DRWVolumeGrid {
/* Transform from bounds to texture space. */
float object_to_bounds[4][4];
float bounds_to_texture[4][4];
} DRWVolumeGrid;
};
namespace blender::draw {
DRWVolumeGrid *DRW_volume_batch_cache_get_grid(struct Volume *volume,
const bke::VolumeGridData *grid);
struct GPUBatch *DRW_cache_volume_face_wireframe_get(struct Object *ob);
struct GPUBatch *DRW_cache_volume_selection_surface_get(struct Object *ob);
DRWVolumeGrid *DRW_volume_batch_cache_get_grid(Volume *volume, const bke::VolumeGridData *grid);
GPUBatch *DRW_cache_volume_face_wireframe_get(Object *ob);
GPUBatch *DRW_cache_volume_selection_surface_get(Object *ob);
/* GPencil (legacy) */
struct GPUBatch *DRW_cache_gpencil_get(struct Object *ob, int cfra);
struct GPUVertBuf *DRW_cache_gpencil_position_buffer_get(struct Object *ob, int cfra);
struct GPUVertBuf *DRW_cache_gpencil_color_buffer_get(struct Object *ob, int cfra);
struct GPUBatch *DRW_cache_gpencil_edit_lines_get(struct Object *ob, int cfra);
struct GPUBatch *DRW_cache_gpencil_edit_points_get(struct Object *ob, int cfra);
struct GPUBatch *DRW_cache_gpencil_edit_curve_handles_get(struct Object *ob, int cfra);
struct GPUBatch *DRW_cache_gpencil_edit_curve_points_get(struct Object *ob, int cfra);
struct GPUBatch *DRW_cache_gpencil_sbuffer_get(struct Object *ob, bool show_fill);
struct GPUVertBuf *DRW_cache_gpencil_sbuffer_position_buffer_get(struct Object *ob,
bool show_fill);
struct GPUVertBuf *DRW_cache_gpencil_sbuffer_color_buffer_get(struct Object *ob, bool show_fill);
int DRW_gpencil_material_count_get(const struct bGPdata *gpd);
GPUBatch *DRW_cache_gpencil_get(Object *ob, int cfra);
GPUVertBuf *DRW_cache_gpencil_position_buffer_get(Object *ob, int cfra);
GPUVertBuf *DRW_cache_gpencil_color_buffer_get(Object *ob, int cfra);
GPUBatch *DRW_cache_gpencil_edit_lines_get(Object *ob, int cfra);
GPUBatch *DRW_cache_gpencil_edit_points_get(Object *ob, int cfra);
GPUBatch *DRW_cache_gpencil_edit_curve_handles_get(Object *ob, int cfra);
GPUBatch *DRW_cache_gpencil_edit_curve_points_get(Object *ob, int cfra);
GPUBatch *DRW_cache_gpencil_sbuffer_get(Object *ob, bool show_fill);
GPUVertBuf *DRW_cache_gpencil_sbuffer_position_buffer_get(Object *ob, bool show_fill);
GPUVertBuf *DRW_cache_gpencil_sbuffer_color_buffer_get(Object *ob, bool show_fill);
int DRW_gpencil_material_count_get(const bGPdata *gpd);
struct GPUBatch *DRW_cache_gpencil_face_wireframe_get(struct Object *ob);
GPUBatch *DRW_cache_gpencil_face_wireframe_get(Object *ob);
struct bGPDstroke *DRW_cache_gpencil_sbuffer_stroke_data_get(struct Object *ob);
bGPDstroke *DRW_cache_gpencil_sbuffer_stroke_data_get(Object *ob);
/**
* Sbuffer batches are temporary. We need to clear it after drawing.
*/
void DRW_cache_gpencil_sbuffer_clear(struct Object *ob);
void DRW_cache_gpencil_sbuffer_clear(Object *ob);
/* Grease Pencil */
struct GPUBatch *DRW_cache_grease_pencil_get(const struct Scene *scene, struct Object *ob);
struct GPUBatch *DRW_cache_grease_pencil_edit_points_get(const struct Scene *scene,
struct Object *ob);
struct GPUBatch *DRW_cache_grease_pencil_edit_lines_get(const struct Scene *scene,
struct Object *ob);
struct GPUVertBuf *DRW_cache_grease_pencil_position_buffer_get(const struct Scene *scene,
struct Object *ob);
struct GPUVertBuf *DRW_cache_grease_pencil_color_buffer_get(const struct Scene *scene,
struct Object *ob);
GPUBatch *DRW_cache_grease_pencil_get(const Scene *scene, Object *ob);
GPUBatch *DRW_cache_grease_pencil_edit_points_get(const Scene *scene, Object *ob);
GPUBatch *DRW_cache_grease_pencil_edit_lines_get(const Scene *scene, Object *ob);
GPUVertBuf *DRW_cache_grease_pencil_position_buffer_get(const Scene *scene, Object *ob);
GPUVertBuf *DRW_cache_grease_pencil_color_buffer_get(const Scene *scene, Object *ob);
} // namespace blender::draw

View File

@ -31,8 +31,8 @@ struct MeshRenderData;
* \{ */
struct DRWPatchMap {
struct GPUVertBuf *patch_map_handles;
struct GPUVertBuf *patch_map_quadtree;
GPUVertBuf *patch_map_handles;
GPUVertBuf *patch_map_quadtree;
int min_patch_face;
int max_patch_face;
int max_depth;

View File

@ -8,76 +8,72 @@
#pragma once
/* internal exports only */
struct wmOperatorType;
struct Base;
struct GPUSelectResult;
struct Object;
struct Scene;
struct bContext;
struct bPoseChannel;
struct Bone;
struct EditBone;
struct bArmature;
struct Base;
struct bContext;
struct Bone;
struct bPoseChannel;
struct EditBone;
struct GPUSelectResult;
struct LinkData;
struct ListBase;
struct Object;
struct Scene;
struct wmOperatorType;
/* -------------------------------------------------------------------- */
/** \name Armature EditMode Operators
* \{ */
void ARMATURE_OT_bone_primitive_add(struct wmOperatorType *ot);
void ARMATURE_OT_bone_primitive_add(wmOperatorType *ot);
void ARMATURE_OT_align(struct wmOperatorType *ot);
void ARMATURE_OT_calculate_roll(struct wmOperatorType *ot);
void ARMATURE_OT_roll_clear(struct wmOperatorType *ot);
void ARMATURE_OT_switch_direction(struct wmOperatorType *ot);
void ARMATURE_OT_align(wmOperatorType *ot);
void ARMATURE_OT_calculate_roll(wmOperatorType *ot);
void ARMATURE_OT_roll_clear(wmOperatorType *ot);
void ARMATURE_OT_switch_direction(wmOperatorType *ot);
void ARMATURE_OT_subdivide(struct wmOperatorType *ot);
void ARMATURE_OT_subdivide(wmOperatorType *ot);
void ARMATURE_OT_parent_set(struct wmOperatorType *ot);
void ARMATURE_OT_parent_clear(struct wmOperatorType *ot);
void ARMATURE_OT_parent_set(wmOperatorType *ot);
void ARMATURE_OT_parent_clear(wmOperatorType *ot);
void ARMATURE_OT_select_all(struct wmOperatorType *ot);
void ARMATURE_OT_select_mirror(struct wmOperatorType *ot);
void ARMATURE_OT_select_more(struct wmOperatorType *ot);
void ARMATURE_OT_select_less(struct wmOperatorType *ot);
void ARMATURE_OT_select_hierarchy(struct wmOperatorType *ot);
void ARMATURE_OT_select_linked_pick(struct wmOperatorType *ot);
void ARMATURE_OT_select_linked(struct wmOperatorType *ot);
void ARMATURE_OT_select_similar(struct wmOperatorType *ot);
void ARMATURE_OT_shortest_path_pick(struct wmOperatorType *ot);
void ARMATURE_OT_select_all(wmOperatorType *ot);
void ARMATURE_OT_select_mirror(wmOperatorType *ot);
void ARMATURE_OT_select_more(wmOperatorType *ot);
void ARMATURE_OT_select_less(wmOperatorType *ot);
void ARMATURE_OT_select_hierarchy(wmOperatorType *ot);
void ARMATURE_OT_select_linked_pick(wmOperatorType *ot);
void ARMATURE_OT_select_linked(wmOperatorType *ot);
void ARMATURE_OT_select_similar(wmOperatorType *ot);
void ARMATURE_OT_shortest_path_pick(wmOperatorType *ot);
void ARMATURE_OT_delete(struct wmOperatorType *ot);
void ARMATURE_OT_dissolve(struct wmOperatorType *ot);
void ARMATURE_OT_duplicate(struct wmOperatorType *ot);
void ARMATURE_OT_symmetrize(struct wmOperatorType *ot);
void ARMATURE_OT_extrude(struct wmOperatorType *ot);
void ARMATURE_OT_hide(struct wmOperatorType *ot);
void ARMATURE_OT_reveal(struct wmOperatorType *ot);
void ARMATURE_OT_click_extrude(struct wmOperatorType *ot);
void ARMATURE_OT_fill(struct wmOperatorType *ot);
void ARMATURE_OT_separate(struct wmOperatorType *ot);
void ARMATURE_OT_split(struct wmOperatorType *ot);
void ARMATURE_OT_delete(wmOperatorType *ot);
void ARMATURE_OT_dissolve(wmOperatorType *ot);
void ARMATURE_OT_duplicate(wmOperatorType *ot);
void ARMATURE_OT_symmetrize(wmOperatorType *ot);
void ARMATURE_OT_extrude(wmOperatorType *ot);
void ARMATURE_OT_hide(wmOperatorType *ot);
void ARMATURE_OT_reveal(wmOperatorType *ot);
void ARMATURE_OT_click_extrude(wmOperatorType *ot);
void ARMATURE_OT_fill(wmOperatorType *ot);
void ARMATURE_OT_separate(wmOperatorType *ot);
void ARMATURE_OT_split(wmOperatorType *ot);
void ARMATURE_OT_autoside_names(struct wmOperatorType *ot);
void ARMATURE_OT_flip_names(struct wmOperatorType *ot);
void ARMATURE_OT_autoside_names(wmOperatorType *ot);
void ARMATURE_OT_flip_names(wmOperatorType *ot);
void ARMATURE_OT_collection_add(struct wmOperatorType *ot);
void ARMATURE_OT_collection_remove(struct wmOperatorType *ot);
void ARMATURE_OT_collection_move(struct wmOperatorType *ot);
void ARMATURE_OT_collection_assign(struct wmOperatorType *ot);
void ARMATURE_OT_collection_create_and_assign(struct wmOperatorType *ot);
void ARMATURE_OT_collection_unassign(struct wmOperatorType *ot);
void ARMATURE_OT_collection_unassign_named(struct wmOperatorType *ot);
void ARMATURE_OT_collection_select(struct wmOperatorType *ot);
void ARMATURE_OT_collection_deselect(struct wmOperatorType *ot);
void ARMATURE_OT_collection_add(wmOperatorType *ot);
void ARMATURE_OT_collection_remove(wmOperatorType *ot);
void ARMATURE_OT_collection_move(wmOperatorType *ot);
void ARMATURE_OT_collection_assign(wmOperatorType *ot);
void ARMATURE_OT_collection_create_and_assign(wmOperatorType *ot);
void ARMATURE_OT_collection_unassign(wmOperatorType *ot);
void ARMATURE_OT_collection_unassign_named(wmOperatorType *ot);
void ARMATURE_OT_collection_select(wmOperatorType *ot);
void ARMATURE_OT_collection_deselect(wmOperatorType *ot);
void ARMATURE_OT_move_to_collection(struct wmOperatorType *ot);
void ARMATURE_OT_assign_to_collection(struct wmOperatorType *ot);
void ARMATURE_OT_move_to_collection(wmOperatorType *ot);
void ARMATURE_OT_assign_to_collection(wmOperatorType *ot);
/** \} */
@ -85,41 +81,41 @@ void ARMATURE_OT_assign_to_collection(struct wmOperatorType *ot);
/** \name Pose-Mode Operators
* \{ */
void POSE_OT_hide(struct wmOperatorType *ot);
void POSE_OT_reveal(struct wmOperatorType *ot);
void POSE_OT_hide(wmOperatorType *ot);
void POSE_OT_reveal(wmOperatorType *ot);
void POSE_OT_armature_apply(struct wmOperatorType *ot);
void POSE_OT_visual_transform_apply(struct wmOperatorType *ot);
void POSE_OT_armature_apply(wmOperatorType *ot);
void POSE_OT_visual_transform_apply(wmOperatorType *ot);
void POSE_OT_rot_clear(struct wmOperatorType *ot);
void POSE_OT_loc_clear(struct wmOperatorType *ot);
void POSE_OT_scale_clear(struct wmOperatorType *ot);
void POSE_OT_transforms_clear(struct wmOperatorType *ot);
void POSE_OT_user_transforms_clear(struct wmOperatorType *ot);
void POSE_OT_rot_clear(wmOperatorType *ot);
void POSE_OT_loc_clear(wmOperatorType *ot);
void POSE_OT_scale_clear(wmOperatorType *ot);
void POSE_OT_transforms_clear(wmOperatorType *ot);
void POSE_OT_user_transforms_clear(wmOperatorType *ot);
void POSE_OT_copy(struct wmOperatorType *ot);
void POSE_OT_paste(struct wmOperatorType *ot);
void POSE_OT_copy(wmOperatorType *ot);
void POSE_OT_paste(wmOperatorType *ot);
void POSE_OT_select_all(struct wmOperatorType *ot);
void POSE_OT_select_parent(struct wmOperatorType *ot);
void POSE_OT_select_hierarchy(struct wmOperatorType *ot);
void POSE_OT_select_linked(struct wmOperatorType *ot);
void POSE_OT_select_linked_pick(struct wmOperatorType *ot);
void POSE_OT_select_constraint_target(struct wmOperatorType *ot);
void POSE_OT_select_grouped(struct wmOperatorType *ot);
void POSE_OT_select_mirror(struct wmOperatorType *ot);
void POSE_OT_select_all(wmOperatorType *ot);
void POSE_OT_select_parent(wmOperatorType *ot);
void POSE_OT_select_hierarchy(wmOperatorType *ot);
void POSE_OT_select_linked(wmOperatorType *ot);
void POSE_OT_select_linked_pick(wmOperatorType *ot);
void POSE_OT_select_constraint_target(wmOperatorType *ot);
void POSE_OT_select_grouped(wmOperatorType *ot);
void POSE_OT_select_mirror(wmOperatorType *ot);
void POSE_OT_paths_calculate(struct wmOperatorType *ot);
void POSE_OT_paths_update(struct wmOperatorType *ot);
void POSE_OT_paths_clear(struct wmOperatorType *ot);
void POSE_OT_paths_range_update(struct wmOperatorType *ot);
void POSE_OT_paths_calculate(wmOperatorType *ot);
void POSE_OT_paths_update(wmOperatorType *ot);
void POSE_OT_paths_clear(wmOperatorType *ot);
void POSE_OT_paths_range_update(wmOperatorType *ot);
void POSE_OT_autoside_names(struct wmOperatorType *ot);
void POSE_OT_flip_names(struct wmOperatorType *ot);
void POSE_OT_autoside_names(wmOperatorType *ot);
void POSE_OT_flip_names(wmOperatorType *ot);
void POSE_OT_rotation_mode_set(struct wmOperatorType *ot);
void POSE_OT_rotation_mode_set(wmOperatorType *ot);
void POSE_OT_quaternions_flip(struct wmOperatorType *ot);
void POSE_OT_quaternions_flip(wmOperatorType *ot);
/** \} */
@ -130,16 +126,16 @@ void POSE_OT_quaternions_flip(struct wmOperatorType *ot);
/* `pose_utils.cc` */
/* Temporary data linking PoseChannels with the F-Curves they affect */
typedef struct tPChanFCurveLink {
struct tPChanFCurveLink *next, *prev;
struct tPChanFCurveLink {
tPChanFCurveLink *next, *prev;
/** Object this Pose Channel belongs to. */
struct Object *ob;
Object *ob;
/** F-Curves for this PoseChannel (wrapped with LinkData) */
ListBase fcurves;
/** Pose Channel which data is attached to */
struct bPoseChannel *pchan;
bPoseChannel *pchan;
/** RNA Path to this Pose Channel (needs to be freed when we're done) */
char *pchan_path;
@ -162,31 +158,28 @@ typedef struct tPChanFCurveLink {
float scale_out[3];
/** copy of custom properties at start of operator (to be restored before each modal step) */
struct IDProperty *oldprops;
} tPChanFCurveLink;
IDProperty *oldprops;
};
/* ----------- */
/** Returns a valid pose armature for this object, else returns NULL. */
struct Object *poseAnim_object_get(struct Object *ob_);
Object *poseAnim_object_get(Object *ob_);
/** Get sets of F-Curves providing transforms for the bones in the Pose. */
void poseAnim_mapping_get(struct bContext *C, ListBase *pfLinks);
void poseAnim_mapping_get(bContext *C, ListBase *pfLinks);
/** Free F-Curve <-> PoseChannel links. */
void poseAnim_mapping_free(ListBase *pfLinks);
/**
* Helper for apply() / reset() - refresh the data.
*/
void poseAnim_mapping_refresh(struct bContext *C, struct Scene *scene, struct Object *ob);
void poseAnim_mapping_refresh(bContext *C, Scene *scene, Object *ob);
/**
* Reset changes made to current pose.
*/
void poseAnim_mapping_reset(ListBase *pfLinks);
/** Perform auto-key-framing after changes were made + confirmed. */
void poseAnim_mapping_autoKeyframe(struct bContext *C,
struct Scene *scene,
ListBase *pfLinks,
float cframe);
void poseAnim_mapping_autoKeyframe(bContext *C, Scene *scene, ListBase *pfLinks, float cframe);
/**
* Find the next F-Curve for a PoseChannel with matching path.
@ -203,8 +196,8 @@ LinkData *poseAnim_mapping_getNextFCurve(ListBase *fcuLinks, LinkData *prev, con
/* `pose_lib_2.cc` */
void POSELIB_OT_apply_pose_asset(struct wmOperatorType *ot);
void POSELIB_OT_blend_pose_asset(struct wmOperatorType *ot);
void POSELIB_OT_apply_pose_asset(wmOperatorType *ot);
void POSELIB_OT_blend_pose_asset(wmOperatorType *ot);
/** \} */
@ -214,13 +207,13 @@ void POSELIB_OT_blend_pose_asset(struct wmOperatorType *ot);
/* `pose_slide.cc` */
void POSE_OT_push(struct wmOperatorType *ot);
void POSE_OT_relax(struct wmOperatorType *ot);
void POSE_OT_blend_with_rest(struct wmOperatorType *ot);
void POSE_OT_breakdown(struct wmOperatorType *ot);
void POSE_OT_blend_to_neighbors(struct wmOperatorType *ot);
void POSE_OT_push(wmOperatorType *ot);
void POSE_OT_relax(wmOperatorType *ot);
void POSE_OT_blend_with_rest(wmOperatorType *ot);
void POSE_OT_breakdown(wmOperatorType *ot);
void POSE_OT_blend_to_neighbors(wmOperatorType *ot);
void POSE_OT_propagate(struct wmOperatorType *ot);
void POSE_OT_propagate(wmOperatorType *ot);
/** \} */
@ -233,44 +226,36 @@ void POSE_OT_propagate(struct wmOperatorType *ot);
* but some tools still have a bit of overlap which makes things messy -- Feb 2013
*/
struct EditBone *make_boneList(struct ListBase *edbo,
struct ListBase *bones,
struct Bone *actBone);
EditBone *make_boneList(ListBase *edbo, ListBase *bones, Bone *actBone);
/* Duplicate method. */
/** Call this before doing any duplications. */
void preEditBoneDuplicate(struct ListBase *editbones);
void postEditBoneDuplicate(struct ListBase *editbones, struct Object *ob);
struct EditBone *duplicateEditBone(struct EditBone *cur_bone,
const char *name,
struct ListBase *editbones,
struct Object *ob);
void preEditBoneDuplicate(ListBase *editbones);
void postEditBoneDuplicate(ListBase *editbones, Object *ob);
EditBone *duplicateEditBone(EditBone *cur_bone, const char *name, ListBase *editbones, Object *ob);
/* Duplicate method (cross objects). */
/**
* \param editbones: The target list.
*/
struct EditBone *duplicateEditBoneObjects(struct EditBone *cur_bone,
const char *name,
struct ListBase *editbones,
struct Object *src_ob,
struct Object *dst_ob);
EditBone *duplicateEditBoneObjects(
EditBone *cur_bone, const char *name, ListBase *editbones, Object *src_ob, Object *dst_ob);
/** Adds an EditBone between the nominated locations (should be in the right space). */
struct EditBone *add_points_bone(struct Object *obedit, float head[3], float tail[3]);
void bone_free(struct bArmature *arm, struct EditBone *bone);
EditBone *add_points_bone(Object *obedit, float head[3], float tail[3]);
void bone_free(bArmature *arm, EditBone *bone);
void armature_tag_select_mirrored(struct bArmature *arm);
void armature_tag_select_mirrored(bArmature *arm);
/**
* Helper function for tools to work on mirrored parts.
* it leaves mirrored bones selected then too, which is a good indication of what happened.
*/
void armature_select_mirrored_ex(struct bArmature *arm, int flag);
void armature_select_mirrored(struct bArmature *arm);
void armature_select_mirrored_ex(bArmature *arm, int flag);
void armature_select_mirrored(bArmature *arm);
/** Only works when tagged. */
void armature_tag_unselect(struct bArmature *arm);
void armature_tag_unselect(bArmature *arm);
/** \} */
@ -278,42 +263,31 @@ void armature_tag_unselect(struct bArmature *arm);
/** \name Selection Picking
* \{ */
struct EditBone *ED_armature_pick_ebone(struct bContext *C,
const int xy[2],
bool findunsel,
struct Base **r_base);
struct bPoseChannel *ED_armature_pick_pchan(struct bContext *C,
const int xy[2],
bool findunsel,
struct Base **r_base);
struct Bone *ED_armature_pick_bone(struct bContext *C,
const int xy[2],
bool findunsel,
struct Base **r_base);
EditBone *ED_armature_pick_ebone(bContext *C, const int xy[2], bool findunsel, Base **r_base);
bPoseChannel *ED_armature_pick_pchan(bContext *C, const int xy[2], bool findunsel, Base **r_base);
Bone *ED_armature_pick_bone(bContext *C, const int xy[2], bool findunsel, Base **r_base);
struct EditBone *ED_armature_pick_ebone_from_selectbuffer(
struct Base **bases,
uint bases_len,
const struct GPUSelectResult *hit_results,
int hits,
bool findunsel,
bool do_nearest,
struct Base **r_base);
struct bPoseChannel *ED_armature_pick_pchan_from_selectbuffer(
struct Base **bases,
uint bases_len,
const struct GPUSelectResult *hit_results,
int hits,
bool findunsel,
bool do_nearest,
struct Base **r_base);
struct Bone *ED_armature_pick_bone_from_selectbuffer(struct Base **bases,
uint bases_len,
const struct GPUSelectResult *hit_results,
int hits,
bool findunsel,
bool do_nearest,
struct Base **r_base);
EditBone *ED_armature_pick_ebone_from_selectbuffer(Base **bases,
uint bases_len,
const GPUSelectResult *hit_results,
int hits,
bool findunsel,
bool do_nearest,
Base **r_base);
bPoseChannel *ED_armature_pick_pchan_from_selectbuffer(Base **bases,
uint bases_len,
const GPUSelectResult *hit_results,
int hits,
bool findunsel,
bool do_nearest,
Base **r_base);
Bone *ED_armature_pick_bone_from_selectbuffer(Base **bases,
uint bases_len,
const GPUSelectResult *hit_results,
int hits,
bool findunsel,
bool do_nearest,
Base **r_base);
/** \} */
@ -325,9 +299,6 @@ struct Bone *ED_armature_pick_bone_from_selectbuffer(struct Base **bases,
* XXX: bone_looper is only to be used when we want to access settings
* (i.e. editability/visibility/selected) that context doesn't offer.
*/
int bone_looper(struct Object *ob,
struct Bone *bone,
void *data,
int (*bone_func)(struct Object *, struct Bone *, void *));
int bone_looper(Object *ob, Bone *bone, void *data, int (*bone_func)(Object *, Bone *, void *));
/** \} */

View File

@ -333,7 +333,7 @@ struct uiButColor : public uiBut {
/** Derived struct for #UI_BTYPE_TAB */
struct uiButTab : public uiBut {
struct MenuType *menu = nullptr;
MenuType *menu = nullptr;
};
/** Derived struct for #UI_BTYPE_SEARCH_MENU */

View File

@ -22,7 +22,7 @@ struct ImBuf;
#define IM_FTYPE_FLOAT 1
typedef struct ImFileType {
struct ImFileType {
/** Optional, called once when initializing. */
void (*init)(void);
/** Optional, called once when exiting. */
@ -36,25 +36,22 @@ typedef struct ImFileType {
bool (*is_a)(const unsigned char *buf, size_t size);
/** Load an image from memory. */
struct ImBuf *(*load)(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
ImBuf *(*load)(const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]);
/** Load an image from a file. */
struct ImBuf *(*load_filepath)(const char *filepath, int flags, char colorspace[IM_MAX_SPACE]);
ImBuf *(*load_filepath)(const char *filepath, int flags, char colorspace[IM_MAX_SPACE]);
/**
* Load/Create a thumbnail image from a filepath. `max_thumb_size` is maximum size of either
* dimension, so can return less on either or both. Should, if possible and performant, return
* dimensions of the full-size image in r_width & r_height.
*/
struct ImBuf *(*load_filepath_thumbnail)(const char *filepath,
int flags,
size_t max_thumb_size,
char colorspace[IM_MAX_SPACE],
size_t *r_width,
size_t *r_height);
ImBuf *(*load_filepath_thumbnail)(const char *filepath,
int flags,
size_t max_thumb_size,
char colorspace[IM_MAX_SPACE],
size_t *r_width,
size_t *r_height);
/** Save to a file (or memory if #IB_mem is set in `flags` and the format supports it). */
bool (*save)(struct ImBuf *ibuf, const char *filepath, int flags);
bool (*save)(ImBuf *ibuf, const char *filepath, int flags);
int flag;
@ -62,13 +59,13 @@ typedef struct ImFileType {
int filetype;
int default_save_role;
} ImFileType;
};
extern const ImFileType IMB_FILE_TYPES[];
extern const ImFileType *IMB_FILE_TYPES_LAST;
const ImFileType *IMB_file_type_from_ftype(int ftype);
const ImFileType *IMB_file_type_from_ibuf(const struct ImBuf *ibuf);
const ImFileType *IMB_file_type_from_ibuf(const ImBuf *ibuf);
void imb_filetypes_init(void);
void imb_filetypes_exit(void);
@ -82,11 +79,11 @@ void imb_filetypes_exit(void);
* \{ */
bool imb_is_a_png(const unsigned char *mem, size_t size);
struct ImBuf *imb_load_png(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_save_png(struct ImBuf *ibuf, const char *filepath, int flags);
ImBuf *imb_load_png(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_save_png(ImBuf *ibuf, const char *filepath, int flags);
/** \} */
@ -95,11 +92,11 @@ bool imb_save_png(struct ImBuf *ibuf, const char *filepath, int flags);
* \{ */
bool imb_is_a_tga(const unsigned char *mem, size_t size);
struct ImBuf *imb_load_tga(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_save_tga(struct ImBuf *ibuf, const char *filepath, int flags);
ImBuf *imb_load_tga(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_save_tga(ImBuf *ibuf, const char *filepath, int flags);
/** \} */
@ -111,11 +108,11 @@ bool imb_is_a_iris(const unsigned char *mem, size_t size);
/**
* Read in a B/W RGB or RGBA iris image file and return an image buffer.
*/
struct ImBuf *imb_loadiris(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_saveiris(struct ImBuf *ibuf, const char *filepath, int flags);
ImBuf *imb_loadiris(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_saveiris(ImBuf *ibuf, const char *filepath, int flags);
/** \} */
@ -124,14 +121,12 @@ bool imb_saveiris(struct ImBuf *ibuf, const char *filepath, int flags);
* \{ */
bool imb_is_a_jp2(const unsigned char *buf, size_t size);
struct ImBuf *imb_load_jp2(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
struct ImBuf *imb_load_jp2_filepath(const char *filepath,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_save_jp2(struct ImBuf *ibuf, const char *filepath, int flags);
ImBuf *imb_load_jp2(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
ImBuf *imb_load_jp2_filepath(const char *filepath, int flags, char colorspace[IM_MAX_SPACE]);
bool imb_save_jp2(ImBuf *ibuf, const char *filepath, int flags);
/** \} */
@ -140,17 +135,17 @@ bool imb_save_jp2(struct ImBuf *ibuf, const char *filepath, int flags);
* \{ */
bool imb_is_a_jpeg(const unsigned char *mem, size_t size);
bool imb_savejpeg(struct ImBuf *ibuf, const char *filepath, int flags);
struct ImBuf *imb_load_jpeg(const unsigned char *buffer,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
struct ImBuf *imb_thumbnail_jpeg(const char *filepath,
int flags,
size_t max_thumb_size,
char colorspace[IM_MAX_SPACE],
size_t *r_width,
size_t *r_height);
bool imb_savejpeg(ImBuf *ibuf, const char *filepath, int flags);
ImBuf *imb_load_jpeg(const unsigned char *buffer,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
ImBuf *imb_thumbnail_jpeg(const char *filepath,
int flags,
size_t max_thumb_size,
char colorspace[IM_MAX_SPACE],
size_t *r_width,
size_t *r_height);
/** \} */
@ -159,12 +154,12 @@ struct ImBuf *imb_thumbnail_jpeg(const char *filepath,
* \{ */
bool imb_is_a_bmp(const unsigned char *buf, size_t size);
struct ImBuf *imb_load_bmp(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
ImBuf *imb_load_bmp(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
/* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */
bool imb_save_bmp(struct ImBuf *ibuf, const char *filepath, int flags);
bool imb_save_bmp(ImBuf *ibuf, const char *filepath, int flags);
/** \} */
@ -173,11 +168,11 @@ bool imb_save_bmp(struct ImBuf *ibuf, const char *filepath, int flags);
* \{ */
bool imb_is_a_cineon(const unsigned char *buf, size_t size);
bool imb_save_cineon(struct ImBuf *buf, const char *filepath, int flags);
struct ImBuf *imb_load_cineon(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_save_cineon(ImBuf *buf, const char *filepath, int flags);
ImBuf *imb_load_cineon(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
/** \} */
@ -186,11 +181,11 @@ struct ImBuf *imb_load_cineon(const unsigned char *mem,
* \{ */
bool imb_is_a_dpx(const unsigned char *buf, size_t size);
bool imb_save_dpx(struct ImBuf *ibuf, const char *filepath, int flags);
struct ImBuf *imb_load_dpx(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_save_dpx(ImBuf *ibuf, const char *filepath, int flags);
ImBuf *imb_load_dpx(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
/** \} */
@ -199,11 +194,11 @@ struct ImBuf *imb_load_dpx(const unsigned char *mem,
* \{ */
bool imb_is_a_hdr(const unsigned char *buf, size_t size);
struct ImBuf *imb_load_hdr(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_save_hdr(struct ImBuf *ibuf, const char *filepath, int flags);
ImBuf *imb_load_hdr(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
bool imb_save_hdr(ImBuf *ibuf, const char *filepath, int flags);
/** \} */
@ -221,10 +216,10 @@ bool imb_is_a_tiff(const unsigned char *buf, size_t size);
*
* \return A newly allocated #ImBuf structure if successful, otherwise NULL.
*/
struct ImBuf *imb_load_tiff(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
ImBuf *imb_load_tiff(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
/**
* Saves a TIFF file.
*
@ -239,7 +234,7 @@ struct ImBuf *imb_load_tiff(const unsigned char *mem,
*
* \return 1 if the function is successful, 0 on failure.
*/
bool imb_save_tiff(struct ImBuf *ibuf, const char *filepath, int flags);
bool imb_save_tiff(ImBuf *ibuf, const char *filepath, int flags);
/** \} */
@ -248,17 +243,17 @@ bool imb_save_tiff(struct ImBuf *ibuf, const char *filepath, int flags);
* \{ */
bool imb_is_a_webp(const unsigned char *buf, size_t size);
struct ImBuf *imb_loadwebp(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
struct ImBuf *imb_load_filepath_thumbnail_webp(const char *filepath,
const int flags,
const size_t max_thumb_size,
char colorspace[],
size_t *r_width,
size_t *r_height);
bool imb_savewebp(struct ImBuf *ibuf, const char *filepath, int flags);
ImBuf *imb_loadwebp(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
ImBuf *imb_load_filepath_thumbnail_webp(const char *filepath,
const int flags,
const size_t max_thumb_size,
char colorspace[],
size_t *r_width,
size_t *r_height);
bool imb_savewebp(ImBuf *ibuf, const char *filepath, int flags);
/** \} */
@ -270,10 +265,10 @@ void imb_init_dds();
bool imb_is_a_dds(const unsigned char *buf, size_t size);
struct ImBuf *imb_load_dds(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
ImBuf *imb_load_dds(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
/** \} */
@ -283,10 +278,10 @@ struct ImBuf *imb_load_dds(const unsigned char *mem,
bool imb_is_a_psd(const unsigned char *buf, size_t size);
struct ImBuf *imb_load_psd(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
ImBuf *imb_load_psd(const unsigned char *mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE]);
/** \} */
@ -294,12 +289,12 @@ struct ImBuf *imb_load_psd(const unsigned char *mem,
/** \name Format: SVG - Only for thumbnails.
* \{ */
struct ImBuf *imb_load_filepath_thumbnail_svg(const char *filepath,
const int flags,
const size_t max_thumb_size,
char colorspace[],
size_t *r_width,
size_t *r_height);
ImBuf *imb_load_filepath_thumbnail_svg(const char *filepath,
const int flags,
const size_t max_thumb_size,
char colorspace[],
size_t *r_width,
size_t *r_height);
/** \} */

View File

@ -13,7 +13,7 @@
struct ImBuf;
void imb_filterx(struct ImBuf *ibuf);
void imb_filterx(ImBuf *ibuf);
void IMB_premultiply_rect(uint8_t *rect, char planes, int w, int h);
void IMB_premultiply_rect_float(float *rect_float, int channels, int w, int h);
@ -24,4 +24,4 @@ void IMB_unpremultiply_rect_float(float *rect_float, int channels, int w, int h)
/**
* Result in ibuf2, scaling should be done correctly.
*/
void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1);
void imb_onehalf_no_alloc(ImBuf *ibuf2, ImBuf *ibuf1);

View File

@ -34,36 +34,36 @@
* the BL_proxy directory structure for later reuse in different blender files.
*/
typedef struct anim_index_entry {
struct anim_index_entry {
int frameno;
uint64_t seek_pos;
uint64_t seek_pos_pts;
uint64_t seek_pos_dts;
uint64_t pts;
} anim_index_entry;
};
struct ImBufAnimIndex {
char filepath[1024];
int num_entries;
struct anim_index_entry *entries;
anim_index_entry *entries;
};
struct anim_index_builder;
typedef struct anim_index_builder {
struct anim_index_builder {
FILE *fp;
char filepath[FILE_MAX];
char filepath_temp[FILE_MAX];
void *private_data;
void (*delete_priv_data)(struct anim_index_builder *idx);
void (*proc_frame)(struct anim_index_builder *idx,
void (*delete_priv_data)(anim_index_builder *idx);
void (*proc_frame)(anim_index_builder *idx,
unsigned char *buffer,
int data_size,
struct anim_index_entry *entry);
} anim_index_builder;
anim_index_entry *entry);
};
anim_index_builder *IMB_index_builder_create(const char *filepath);
void IMB_index_builder_add_entry(anim_index_builder *fp,
@ -84,23 +84,23 @@ void IMB_index_builder_proc_frame(anim_index_builder *fp,
void IMB_index_builder_finish(anim_index_builder *fp, int rollback);
struct ImBufAnimIndex *IMB_indexer_open(const char *name);
uint64_t IMB_indexer_get_seek_pos(struct ImBufAnimIndex *idx, int frame_index);
uint64_t IMB_indexer_get_seek_pos_pts(struct ImBufAnimIndex *idx, int frame_index);
uint64_t IMB_indexer_get_seek_pos_dts(struct ImBufAnimIndex *idx, int frame_index);
ImBufAnimIndex *IMB_indexer_open(const char *name);
uint64_t IMB_indexer_get_seek_pos(ImBufAnimIndex *idx, int frame_index);
uint64_t IMB_indexer_get_seek_pos_pts(ImBufAnimIndex *idx, int frame_index);
uint64_t IMB_indexer_get_seek_pos_dts(ImBufAnimIndex *idx, int frame_index);
int IMB_indexer_get_frame_index(struct ImBufAnimIndex *idx, int frameno);
uint64_t IMB_indexer_get_pts(struct ImBufAnimIndex *idx, int frame_index);
int IMB_indexer_get_duration(struct ImBufAnimIndex *idx);
int IMB_indexer_get_frame_index(ImBufAnimIndex *idx, int frameno);
uint64_t IMB_indexer_get_pts(ImBufAnimIndex *idx, int frame_index);
int IMB_indexer_get_duration(ImBufAnimIndex *idx);
int IMB_indexer_can_scan(struct ImBufAnimIndex *idx, int old_frame_index, int new_frame_index);
int IMB_indexer_can_scan(ImBufAnimIndex *idx, int old_frame_index, int new_frame_index);
void IMB_indexer_close(struct ImBufAnimIndex *idx);
void IMB_indexer_close(ImBufAnimIndex *idx);
void IMB_free_indices(struct ImBufAnim *anim);
void IMB_free_indices(ImBufAnim *anim);
struct ImBufAnim *IMB_anim_open_proxy(struct ImBufAnim *anim, IMB_Proxy_Size preview_size);
struct ImBufAnimIndex *IMB_anim_open_index(struct ImBufAnim *anim, IMB_Timecode_Type tc);
ImBufAnim *IMB_anim_open_proxy(ImBufAnim *anim, IMB_Proxy_Size preview_size);
ImBufAnimIndex *IMB_anim_open_index(ImBufAnim *anim, IMB_Timecode_Type tc);
int IMB_proxy_size_to_array_index(IMB_Proxy_Size pr_size);
int IMB_timecode_to_array_index(IMB_Timecode_Type tc);