diff options
Diffstat (limited to 'source/blender/imbuf/IMB_imbuf.h')
-rw-r--r-- | source/blender/imbuf/IMB_imbuf.h | 76 |
1 files changed, 20 insertions, 56 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 20c414bb1ad..6881916d1d2 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -41,6 +41,7 @@ /* for bool */ #include "../blenlib/BLI_sys_types.h" +#include "../gpu/GPU_texture.h" #ifdef __cplusplus extern "C" { @@ -49,7 +50,6 @@ extern "C" { #define IM_MAX_SPACE 64 /** - * * \attention defined in ??? */ struct ImBuf; @@ -57,7 +57,6 @@ struct rctf; struct rcti; /** - * * \attention defined in ??? */ struct anim; @@ -66,27 +65,18 @@ struct ColorManagedDisplay; struct GSet; /** - * * \attention defined in DNA_scene_types.h */ struct ImageFormatData; struct Stereo3dFormat; /** - * - * \attention defined in GPU_texture.h - */ -struct GPUTexture; - -/** - * * \attention Defined in allocimbuf.c */ void IMB_init(void); void IMB_exit(void); /** - * * \attention Defined in readimage.c */ struct ImBuf *IMB_ibImageFromMemory(const unsigned char *mem, @@ -96,19 +86,16 @@ struct ImBuf *IMB_ibImageFromMemory(const unsigned char *mem, const char *descr); /** - * * \attention Defined in readimage.c */ struct ImBuf *IMB_testiffname(const char *filepath, int flags); /** - * * \attention Defined in readimage.c */ struct ImBuf *IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE]); /** - * * \attention Defined in readimage.c */ struct ImBuf *IMB_thumb_load_image(const char *filepath, @@ -116,13 +103,11 @@ struct ImBuf *IMB_thumb_load_image(const char *filepath, char colorspace[IM_MAX_SPACE]); /** - * * \attention Defined in allocimbuf.c */ void IMB_freeImBuf(struct ImBuf *ibuf); /** - * * \attention Defined in allocimbuf.c */ struct ImBuf *IMB_allocImBuf(unsigned int x, @@ -159,7 +144,6 @@ struct ImBuf *IMB_allocFromBuffer(const unsigned int *rect, unsigned int channels); /** - * * Increase reference count to imbuf * (to delete an imbuf you have to call freeImBuf as many times as it * is referenced) @@ -171,13 +155,11 @@ void IMB_refImBuf(struct ImBuf *ibuf); struct ImBuf *IMB_makeSingleUser(struct ImBuf *ibuf); /** - * * \attention Defined in allocimbuf.c */ struct ImBuf *IMB_dupImBuf(const struct ImBuf *ibuf1); /** - * * \attention Defined in allocimbuf.c */ bool addzbufImBuf(struct ImBuf *ibuf); @@ -202,7 +184,6 @@ size_t IMB_get_size_in_memory(struct ImBuf *ibuf); size_t IMB_get_rect_len(const struct ImBuf *ibuf); /** - * * \attention Defined in rectop.c */ @@ -309,7 +290,6 @@ void IMB_rectblend_threaded(struct ImBuf *dbuf, bool accumulate); /** - * * \attention Defined in indexer.c */ @@ -404,7 +384,6 @@ double IMD_anim_get_offset(struct anim *anim); bool IMB_anim_get_fps(struct anim *anim, short *frs_sec, float *frs_sec_base, bool no_av_base); /** - * * \attention Defined in anim_movie.c */ struct anim *IMB_open_anim(const char *name, @@ -417,7 +396,6 @@ void IMB_close_anim_proxies(struct anim *anim); bool IMB_anim_can_produce_frames(const struct anim *anim); /** - * * \attention Defined in anim_movie.c */ @@ -427,7 +405,6 @@ int IMB_anim_get_image_height(struct anim *anim); bool IMB_get_gop_decode_time(struct anim *anim); /** - * * \attention Defined in anim_movie.c */ @@ -437,20 +414,17 @@ struct ImBuf *IMB_anim_absolute(struct anim *anim, IMB_Proxy_Size preview_size /* = 0 = IMB_PROXY_NONE */); /** - * * \attention Defined in anim_movie.c * fetches a define preview-frame, usually half way into the movie. */ struct ImBuf *IMB_anim_previewframe(struct anim *anim); /** - * * \attention Defined in anim_movie.c */ void IMB_free_anim(struct anim *anim); /** - * * \attention Defined in filter.c */ @@ -479,7 +453,6 @@ void IMB_remakemipmap(struct ImBuf *ibuf, int use_filter); struct ImBuf *IMB_getmipmap(struct ImBuf *ibuf, int level); /** - * * \attention Defined in cache.c */ @@ -491,19 +464,16 @@ unsigned int *IMB_gettile(struct ImBuf *ibuf, int tx, int ty, int thread); void IMB_tiles_to_rect(struct ImBuf *ibuf); /** - * * \attention Defined in filter.c */ void IMB_filtery(struct ImBuf *ibuf); /** - * * \attention Defined in scaling.c */ struct ImBuf *IMB_onehalf(struct ImBuf *ibuf1); /** - * * \attention Defined in scaling.c * * Return true if \a ibuf is modified. @@ -511,7 +481,6 @@ struct ImBuf *IMB_onehalf(struct ImBuf *ibuf1); bool IMB_scaleImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy); /** - * * \attention Defined in scaling.c */ /** @@ -520,19 +489,16 @@ bool IMB_scaleImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy); bool IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy); /** - * * \attention Defined in scaling.c */ void IMB_scaleImBuf_threaded(struct ImBuf *ibuf, unsigned int newx, unsigned int newy); /** - * * \attention Defined in writeimage.c */ bool IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags); /** - * * \attention Defined in util.c */ bool IMB_ispic(const char *filepath); @@ -541,13 +507,11 @@ int IMB_ispic_type_from_memory(const unsigned char *buf, size_t buf_size); int IMB_ispic_type(const char *filepath); /** - * * \attention Defined in util.c */ bool IMB_isanim(const char *filepath); /** - * * \attention Defined in util.c */ int imb_get_anim_type(const char *filepath); @@ -672,7 +636,6 @@ void IMB_buffer_float_premultiply(float *buf, int width, int height); void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf); /** - * * \attention defined in imageprocess.c */ @@ -723,50 +686,42 @@ void IMB_sampleImageAtLocation( struct ImBuf *ibuf, float x, float y, bool make_linear_rgb, float color[4]); /** - * * \attention defined in readimage.c */ struct ImBuf *IMB_loadifffile( int file, const char *filepath, int flags, char colorspace[IM_MAX_SPACE], const char *descr); /** - * * \attention defined in scaling.c */ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1); /** - * * \attention defined in scaling.c */ struct ImBuf *IMB_double_fast_x(struct ImBuf *ibuf1); /** - * * \attention defined in scaling.c */ struct ImBuf *IMB_double_x(struct ImBuf *ibuf1); /** - * * \attention defined in scaling.c */ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1); /** - * * \attention defined in scaling.c */ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1); /** - * * \attention defined in scaling.c */ struct ImBuf *IMB_double_y(struct ImBuf *ibuf1); /** - * * \attention Defined in rotate.c */ void IMB_flipx(struct ImBuf *ibuf); @@ -778,14 +733,12 @@ void IMB_premultiply_alpha(struct ImBuf *ibuf); void IMB_unpremultiply_alpha(struct ImBuf *ibuf); /** - * * \attention Defined in allocimbuf.c */ void IMB_freezbufImBuf(struct ImBuf *ibuf); void IMB_freezbuffloatImBuf(struct ImBuf *ibuf); /** - * * \attention Defined in rectop.c */ /** @@ -930,25 +883,35 @@ void IMB_ffmpeg_init(void); const char *IMB_ffmpeg_last_error(void); /** - * * \attention defined in util_gpu.c */ -struct GPUTexture *IMB_create_gpu_texture(const char *name, - struct ImBuf *ibuf, - bool use_high_bitdepth, - bool use_premult); +GPUTexture *IMB_create_gpu_texture(const char *name, + struct ImBuf *ibuf, + bool use_high_bitdepth, + bool use_premult); + +eGPUTextureFormat IMB_gpu_get_texture_format(const struct ImBuf *ibuf, + bool high_bitdepth, + bool use_grayscale); + /** * The `ibuf` is only here to detect the storage type. The produced texture will have undefined * content. It will need to be populated by using #IMB_update_gpu_texture_sub(). */ -struct GPUTexture *IMB_touch_gpu_texture( - const char *name, struct ImBuf *ibuf, int w, int h, int layers, bool use_high_bitdepth); +GPUTexture *IMB_touch_gpu_texture(const char *name, + struct ImBuf *ibuf, + int w, + int h, + int layers, + bool use_high_bitdepth, + bool use_grayscale); + /** * Will update a #GPUTexture using the content of the #ImBuf. Only one layer will be updated. * Will resize the ibuf if needed. * Z is the layer to update. Unused if the texture is 2D. */ -void IMB_update_gpu_texture_sub(struct GPUTexture *tex, +void IMB_update_gpu_texture_sub(GPUTexture *tex, struct ImBuf *ibuf, int x, int y, @@ -956,6 +919,7 @@ void IMB_update_gpu_texture_sub(struct GPUTexture *tex, int w, int h, bool use_high_bitdepth, + bool use_grayscale, bool use_premult); /** |