Blender  V3.3
Macros | Typedefs | Enumerations | Functions | Variables
BKE_image.h File Reference
#include "BLI_compiler_attrs.h"
#include "BLI_utildefines.h"
#include "BLI_rect.h"

Go to the source code of this file.

Macros

#define IMA_MAX_SPACE   64
 
#define IMA_UDIM_MAX   2000
 
#define IMA_SIGNAL_RELOAD   0
 
#define IMA_SIGNAL_FREE   1
 
#define IMA_SIGNAL_SRC_CHANGE   5
 
#define IMA_SIGNAL_USER_NEW_IMAGE   6
 
#define IMA_SIGNAL_COLORMANAGE   7
 

Typedefs

typedef void() StampCallback(void *data, const char *propname, char *propvalue, int len)
 

Enumerations

enum  eUDIM_TILE_FORMAT { UDIM_TILE_FORMAT_NONE = 0 , UDIM_TILE_FORMAT_UDIM = 1 , UDIM_TILE_FORMAT_UVTILE = 2 }
 

Functions

void BKE_image_free_packedfiles (struct Image *image)
 
void BKE_image_free_views (struct Image *image)
 
void BKE_image_free_buffers (struct Image *image)
 
void BKE_image_free_buffers_ex (struct Image *image, bool do_lock)
 
void BKE_image_free_gputextures (struct Image *ima)
 
void BKE_image_free_data (struct Image *image)
 
void BKE_render_result_stamp_info (struct Scene *scene, struct Object *camera, struct RenderResult *rr, bool allocate_only)
 
struct StampData * BKE_stamp_info_from_scene_static (const struct Scene *scene)
 
bool BKE_stamp_is_known_field (const char *field_name)
 
void BKE_imbuf_stamp_info (const struct RenderResult *rr, struct ImBuf *ibuf)
 
void BKE_stamp_info_from_imbuf (struct RenderResult *rr, struct ImBuf *ibuf)
 
void BKE_stamp_info_callback (void *data, struct StampData *stamp_data, StampCallback callback, bool noskip)
 
void BKE_render_result_stamp_data (struct RenderResult *rr, const char *key, const char *value)
 
struct StampData * BKE_stamp_data_copy (const struct StampData *stamp_data)
 
void BKE_stamp_data_free (struct StampData *stamp_data)
 
void BKE_image_stamp_buf (struct Scene *scene, struct Object *camera, const struct StampData *stamp_data_template, unsigned char *rect, float *rectf, int width, int height, int channels)
 
bool BKE_imbuf_alpha_test (struct ImBuf *ibuf)
 
int BKE_imbuf_write_stamp (const struct Scene *scene, const struct RenderResult *rr, struct ImBuf *ibuf, const char *name, const struct ImageFormatData *imf)
 
int BKE_imbuf_write (struct ImBuf *ibuf, const char *name, const struct ImageFormatData *imf)
 
int BKE_imbuf_write_as (struct ImBuf *ibuf, const char *name, const struct ImageFormatData *imf, bool save_copy)
 
struct anim * openanim (const char *name, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
 
struct anim * openanim_noload (const char *name, int flags, int streamindex, char colorspace[IMA_MAX_SPACE])
 
void BKE_image_tag_time (struct Image *ima)
 
bool BKE_image_has_ibuf (struct Image *ima, struct ImageUser *iuser)
 
struct ImBuf * BKE_image_acquire_ibuf (struct Image *ima, struct ImageUser *iuser, void **r_lock)
 
void BKE_image_release_ibuf (struct Image *ima, struct ImBuf *ibuf, void *lock)
 
struct ImagePool * BKE_image_pool_new (void)
 
void BKE_image_pool_free (struct ImagePool *pool)
 
struct ImBuf * BKE_image_pool_acquire_ibuf (struct Image *ima, struct ImageUser *iuser, struct ImagePool *pool)
 
void BKE_image_pool_release_ibuf (struct Image *ima, struct ImBuf *ibuf, struct ImagePool *pool)
 
char BKE_image_alpha_mode_from_extension_ex (const char *filepath)
 
void BKE_image_alpha_mode_from_extension (struct Image *image)
 
struct Image * BKE_image_load (struct Main *bmain, const char *filepath)
 
struct Image * BKE_image_load_exists_ex (struct Main *bmain, const char *filepath, bool *r_exists)
 
struct Image * BKE_image_load_exists (struct Main *bmain, const char *filepath)
 
struct Image * BKE_image_add_generated (struct Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, const float color[4], bool stereo3d, bool is_data, bool tiled)
 
struct Image * BKE_image_add_from_imbuf (struct Main *bmain, struct ImBuf *ibuf, const char *name)
 
void BKE_image_replace_imbuf (struct Image *image, struct ImBuf *ibuf)
 
void BKE_imageuser_default (struct ImageUser *iuser)
 
void BKE_image_init_imageuser (struct Image *ima, struct ImageUser *iuser)
 
void BKE_image_signal (struct Main *bmain, struct Image *ima, struct ImageUser *iuser, int signal)
 
void BKE_image_walk_all_users (const struct Main *mainp, void *customdata, void callback(struct Image *ima, struct ID *iuser_id, struct ImageUser *iuser, void *customdata))
 
struct Image * BKE_image_ensure_viewer (struct Main *bmain, int type, const char *name)
 
void BKE_image_ensure_viewer_views (const struct RenderData *rd, struct Image *ima, struct ImageUser *iuser)
 
void BKE_image_user_frame_calc (struct Image *ima, struct ImageUser *iuser, int cfra)
 
int BKE_image_user_frame_get (const struct ImageUser *iuser, int cfra, bool *r_is_in_range)
 
void BKE_image_user_file_path (const struct ImageUser *iuser, const struct Image *ima, char *path)
 
void BKE_image_user_file_path_ex (const struct Main *bmain, const struct ImageUser *iuser, const struct Image *ima, char *path, const bool resolve_udim, const bool resolve_multiview)
 
void BKE_image_editors_update_frame (const struct Main *bmain, int cfra)
 
bool BKE_image_user_id_has_animation (struct ID *id)
 
void BKE_image_user_id_eval_animation (struct Depsgraph *depsgraph, struct ID *id)
 
struct RenderPass * BKE_image_multilayer_index (struct RenderResult *rr, struct ImageUser *iuser)
 
void BKE_image_multiview_index (const struct Image *ima, struct ImageUser *iuser)
 
bool BKE_image_is_multilayer (const struct Image *ima)
 
bool BKE_image_is_multiview (const struct Image *ima)
 
bool BKE_image_is_stereo (const struct Image *ima)
 
struct RenderResult * BKE_image_acquire_renderresult (struct Scene *scene, struct Image *ima)
 
void BKE_image_release_renderresult (struct Scene *scene, struct Image *ima)
 
bool BKE_image_is_openexr (struct Image *ima)
 
void BKE_image_backup_render (struct Scene *scene, struct Image *ima, bool free_current_slot)
 
void BKE_image_free_all_textures (struct Main *bmain)
 
void BKE_image_free_anim_ibufs (struct Image *ima, int except_frame)
 
void BKE_image_all_free_anim_ibufs (struct Main *bmain, int cfra)
 
void BKE_image_free_all_gputextures (struct Main *bmain)
 
void BKE_image_free_anim_gputextures (struct Main *bmain)
 
void BKE_image_free_old_gputextures (struct Main *bmain)
 
bool BKE_image_memorypack (struct Image *ima)
 
void BKE_image_packfiles (struct ReportList *reports, struct Image *ima, const char *basepath)
 
void BKE_image_packfiles_from_mem (struct ReportList *reports, struct Image *ima, char *data, size_t data_len)
 
void BKE_image_print_memlist (struct Main *bmain)
 
void BKE_image_merge (struct Main *bmain, struct Image *dest, struct Image *source)
 
bool BKE_image_scale (struct Image *image, int width, int height)
 
bool BKE_image_has_alpha (struct Image *image)
 
bool BKE_image_has_opengl_texture (struct Image *ima)
 
void BKE_image_get_tile_label (struct Image *ima, struct ImageTile *tile, char *label, int len_label)
 
bool BKE_image_get_tile_info (char *filepath, struct ListBase *tiles, int *r_tile_start, int *r_tile_range)
 
struct ImageTile * BKE_image_add_tile (struct Image *ima, int tile_number, const char *label)
 
bool BKE_image_remove_tile (struct Image *ima, struct ImageTile *tile)
 
void BKE_image_reassign_tile (struct Image *ima, struct ImageTile *tile, int new_tile_number)
 
void BKE_image_sort_tiles (struct Image *ima)
 
bool BKE_image_fill_tile (struct Image *ima, struct ImageTile *tile, int width, int height, const float color[4], int gen_type, int planes, bool is_float)
 
bool BKE_image_is_filename_tokenized (char *filepath)
 
void BKE_image_ensure_tile_token (char *filename)
 
bool BKE_image_tile_filepath_exists (const char *filepath)
 
char * BKE_image_get_tile_strformat (const char *filepath, eUDIM_TILE_FORMAT *r_tile_format)
 
bool BKE_image_get_tile_number_from_filepath (const char *filepath, const char *pattern, eUDIM_TILE_FORMAT tile_format, int *r_tile_number)
 
void BKE_image_set_filepath_from_tile_number (char *filepath, const char *pattern, eUDIM_TILE_FORMAT tile_format, int tile_number)
 
struct ImageTile * BKE_image_get_tile (struct Image *ima, int tile_number)
 
struct ImageTile * BKE_image_get_tile_from_iuser (struct Image *ima, const struct ImageUser *iuser)
 
int BKE_image_get_tile_from_pos (struct Image *ima, const float uv[2], float r_uv[2], float r_ofs[2])
 
void BKE_image_get_tile_uv (const struct Image *ima, const int tile_number, float r_uv[2])
 
int BKE_image_find_nearest_tile_with_offset (const struct Image *image, const float co[2], float r_uv_offset[2]) ATTR_NONNULL(1
 
int int BKE_image_find_nearest_tile (const struct Image *image, const float co[2]) ATTR_NONNULL(1
 
void BKE_image_get_size (struct Image *image, struct ImageUser *iuser, int *r_width, int *r_height)
 
void BKE_image_get_size_fl (struct Image *image, struct ImageUser *iuser, float r_size[2])
 
void BKE_image_get_aspect (struct Image *image, float *r_aspx, float *r_aspy)
 
void BKE_image_buf_fill_color (unsigned char *rect, float *rect_float, int width, int height, const float color[4])
 
void BKE_image_buf_fill_checker (unsigned char *rect, float *rect_float, int width, int height)
 
void BKE_image_buf_fill_checker_color (unsigned char *rect, float *rect_float, int width, int height)
 
unsigned char * BKE_image_get_pixels_for_frame (struct Image *image, int frame, int tile)
 
float * BKE_image_get_float_pixels_for_frame (struct Image *image, int frame, int tile)
 
bool BKE_image_is_dirty (struct Image *image)
 
void BKE_image_mark_dirty (struct Image *image, struct ImBuf *ibuf)
 
bool BKE_image_buffer_format_writable (struct ImBuf *ibuf)
 
bool BKE_image_is_dirty_writable (struct Image *image, bool *r_is_writable)
 
int BKE_image_sequence_guess_offset (struct Image *image)
 
bool BKE_image_has_anim (struct Image *image)
 
bool BKE_image_has_packedfile (const struct Image *image)
 
bool BKE_image_has_filepath (const struct Image *ima)
 
bool BKE_image_is_animated (struct Image *image)
 
bool BKE_image_has_multiple_ibufs (struct Image *image)
 
void BKE_image_file_format_set (struct Image *image, int ftype, const struct ImbFormatOptions *options)
 
bool BKE_image_has_loaded_ibuf (struct Image *image)
 
struct ImBuf * BKE_image_get_ibuf_with_name (struct Image *image, const char *name)
 
struct ImBuf * BKE_image_get_first_ibuf (struct Image *image)
 
struct GPUTexture * BKE_image_create_gpu_texture_from_ibuf (struct Image *image, struct ImBuf *ibuf)
 
struct GPUTexture * BKE_image_get_gpu_texture (struct Image *image, struct ImageUser *iuser, struct ImBuf *ibuf)
 
struct GPUTexture * BKE_image_get_gpu_tiles (struct Image *image, struct ImageUser *iuser, struct ImBuf *ibuf)
 
struct GPUTexture * BKE_image_get_gpu_tilemap (struct Image *image, struct ImageUser *iuser, struct ImBuf *ibuf)
 
bool BKE_image_has_gpu_texture_premultiplied_alpha (struct Image *image, struct ImBuf *ibuf)
 
void BKE_image_update_gputexture (struct Image *ima, struct ImageUser *iuser, int x, int y, int w, int h)
 
void BKE_image_update_gputexture_delayed (struct Image *ima, struct ImageTile *image_tile, struct ImBuf *ibuf, int x, int y, int w, int h)
 
void BKE_image_paint_set_mipmap (struct Main *bmain, bool mipmap)
 
void BKE_image_free_unused_gpu_textures (void)
 
struct RenderSlot * BKE_image_add_renderslot (struct Image *ima, const char *name)
 
bool BKE_image_remove_renderslot (struct Image *ima, struct ImageUser *iuser, int slot)
 
struct RenderSlot * BKE_image_get_renderslot (struct Image *ima, int index)
 
bool BKE_image_clear_renderslot (struct Image *ima, struct ImageUser *iuser, int slot)
 
struct PartialUpdateUser * BKE_image_partial_update_create (const struct Image *image)
 Create a new PartialUpdateUser. An Object that contains data to use partial updates. More...
 
void BKE_image_partial_update_free (struct PartialUpdateUser *user)
 free a partial update user. More...
 
void BKE_image_partial_update_register_free (struct Image *image)
 
void BKE_image_partial_update_mark_region (struct Image *image, const struct ImageTile *image_tile, const struct ImBuf *image_buffer, const rcti *updated_region)
 Mark a region of the image to update. More...
 
void BKE_image_partial_update_mark_full_update (struct Image *image)
 Mark the whole image to be updated. More...
 

Variables

int int ATTR_WARN_UNUSED_RESULT
 

Macro Definition Documentation

◆ IMA_MAX_SPACE

#define IMA_MAX_SPACE   64

Definition at line 35 of file BKE_image.h.

◆ IMA_SIGNAL_COLORMANAGE

#define IMA_SIGNAL_COLORMANAGE   7

Definition at line 135 of file BKE_image.h.

◆ IMA_SIGNAL_FREE

#define IMA_SIGNAL_FREE   1

Definition at line 130 of file BKE_image.h.

◆ IMA_SIGNAL_RELOAD

#define IMA_SIGNAL_RELOAD   0

Definition at line 129 of file BKE_image.h.

◆ IMA_SIGNAL_SRC_CHANGE

#define IMA_SIGNAL_SRC_CHANGE   5

Definition at line 132 of file BKE_image.h.

◆ IMA_SIGNAL_USER_NEW_IMAGE

#define IMA_SIGNAL_USER_NEW_IMAGE   6

Definition at line 134 of file BKE_image.h.

◆ IMA_UDIM_MAX

#define IMA_UDIM_MAX   2000

Definition at line 36 of file BKE_image.h.

Typedef Documentation

◆ StampCallback

typedef void() StampCallback(void *data, const char *propname, char *propvalue, int len)

Definition at line 53 of file BKE_image.h.

Enumeration Type Documentation

◆ eUDIM_TILE_FORMAT

Enumerator
UDIM_TILE_FORMAT_NONE 
UDIM_TILE_FORMAT_UDIM 
UDIM_TILE_FORMAT_UVTILE 

Definition at line 378 of file BKE_image.h.

Function Documentation

◆ BKE_image_acquire_ibuf()

struct ImBuf* BKE_image_acquire_ibuf ( struct Image *  ima,
struct ImageUser *  iuser,
void **  r_lock 
)

Return image buffer for given image and user:

  • will lock render result if image type is render result and lock is not NULL
  • will return NULL if image is NULL or image type is render or composite result and lock is NULL

References the result, BKE_image_release_ibuf should be used to de-reference.

Definition at line 4668 of file source/blender/blenkernel/intern/image.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), Image_Runtime::cache_mutex, image_acquire_ibuf(), and Image::runtime.

Referenced by blender::draw::image_engine::SpaceNodeAccessor::acquire_image_buffer(), blender::bke::pbvh::pixels::apply_watertight_check(), blender::ed::space_node::backimage_fit_exec(), bake_images(), bake_object_check(), bake_targets_init_internal(), BKE_gpencil_from_image(), BKE_image_get_float_pixels_for_frame(), BKE_image_get_pixels_for_frame(), BKE_image_get_size(), BKE_image_has_alpha(), BKE_image_pool_acquire_ibuf(), BKE_image_save_options_init(), BKE_image_scale(), BKE_image_update_gputexture(), BKE_paint_canvas_key_get(), blender::bke::pbvh::pixels::BKE_pbvh_pixels_mark_image_dirty(), clear_single_image(), cmp_node_image_create_outputs(), colorfn(), blender::compositor::ImageNode::convert_to_operations(), cryptomatte_init_from_node_image(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), blender::ed::sculpt_paint::paint::image::do_push_undo_tile(), blender::ed::space_node::draw_nodespace_back_pix(), draw_plane_marker_image(), ED_space_image_acquire_buffer(), ED_space_node_color_sample(), ED_space_node_get_position(), blender::io::usd::export_in_memory_texture(), eyedropper_cryptomatte_sample_image_fl(), finish_images(), blender::compositor::BaseImageOperation::get_im_buf(), blender::io::usd::get_in_memory_texture_filename(), gpencil_boundaryfill_area(), gpencil_erase_processed_area(), gpencil_find_and_mark_empty_areas(), gpencil_get_outline_points(), gpencil_image_texture_get(), gpencil_invert_image(), gpencil_set_borders(), gpu_texture_create_tile_array(), icon_preview_startjob(), image_camera_background_texture_get(), image_file_format_writable(), image_flip_exec(), image_from_context_has_data_poll(), image_get_gpu_texture(), image_invert_exec(), image_rect_update(), image_save_single(), image_scale_exec(), image_scale_invoke(), image_undosys_step_encode(), blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::ImageFieldsFunction(), blender::bke::image::partial_update::ImageTileData::init_data(), metadata_panel_context_draw(), multiresbake_check(), OVERLAY_edit_uv_cache_init(), paint_2d_bucket_fill(), paint_2d_canvas_set(), paint_2d_ensure_tile_canvas(), paint_2d_gradient_fill(), paint_2d_new_stroke(), paint_2d_redraw(), paint_sample_color(), palette_extract_img_exec(), project_paint_build_proj_ima(), project_paint_PickColor(), project_paint_uvpixel_init(), project_paint_uvpixel_mask(), ptile_restore_runtime_map(), RE_bake_ibuf_clear(), render_endjob(), blender::ed::space_node::sample_apply(), screen_opengl_render_apply(), blender::bke::image::partial_update::ImagePartialUpdateTest::SetUp(), blender::ed::space_node::snode_bg_viewmove_invoke(), texture_paint_camera_project_exec(), tile_fill_init(), trace_start_job(), uhandle_restore_list(), uiTemplateImage(), uiTemplateImageInfo(), blender::ed::space_node::viewer_border_exec(), blender::ed::space_node::WIDGETGROUP_node_corner_pin_refresh(), blender::ed::space_node::WIDGETGROUP_node_crop_refresh(), blender::ed::space_node::WIDGETGROUP_node_sbeam_refresh(), blender::ed::space_node::WIDGETGROUP_node_transform_refresh(), and write_internal_bake_pixels().

◆ BKE_image_acquire_renderresult()

struct RenderResult* BKE_image_acquire_renderresult ( struct Scene *  scene,
struct Image *  ima 
)

◆ BKE_image_add_from_imbuf()

struct Image* BKE_image_add_from_imbuf ( struct Main *  bmain,
struct ImBuf *  ibuf,
const char *  name 
)

Create an image from ibuf. The reference-count of ibuf is increased, caller should take care to drop its reference by calling IMB_freeImBuf if needed.

Definition at line 1215 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_replace_imbuf(), BLI_path_basename(), IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_TYPE_IMAGE, image_alloc(), and ImBuf::name.

Referenced by gpencil_render_offscreen(), new_image_from_plane_marker_exec(), and texture_paint_image_from_view_exec().

◆ BKE_image_add_generated()

struct Image* BKE_image_add_generated ( struct Main *  bmain,
unsigned int  width,
unsigned int  height,
const char *  name,
int  depth,
int  floatbuf,
short  gen_type,
const float  color[4],
bool  stereo3d,
bool  is_data,
bool  tiled 
)

◆ BKE_image_add_renderslot()

struct RenderSlot* BKE_image_add_renderslot ( struct Image *  ima,
const char *  name 
)

◆ BKE_image_add_tile()

struct ImageTile* BKE_image_add_tile ( struct Image *  ima,
int  tile_number,
const char *  label 
)

◆ BKE_image_all_free_anim_ibufs()

void BKE_image_all_free_anim_ibufs ( struct Main *  bmain,
int  cfra 
)

Does all images with type MOVIE or SEQUENCE.

Definition at line 1556 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_free_anim_ibufs(), BKE_image_is_animated(), ListBase::first, Image::id, Main::images, and ID::next.

Referenced by do_render_full_pipeline().

◆ BKE_image_alpha_mode_from_extension()

void BKE_image_alpha_mode_from_extension ( struct Image *  image)

◆ BKE_image_alpha_mode_from_extension_ex()

char BKE_image_alpha_mode_from_extension_ex ( const char *  filepath)

◆ BKE_image_backup_render()

void BKE_image_backup_render ( struct Scene *  scene,
struct Image *  ima,
bool  free_current_slot 
)

◆ BKE_image_buf_fill_checker()

void BKE_image_buf_fill_checker ( unsigned char *  rect,
float *  rect_float,
int  width,
int  height 
)

◆ BKE_image_buf_fill_checker_color()

void BKE_image_buf_fill_checker_color ( unsigned char *  rect,
float *  rect_float,
int  width,
int  height 
)

◆ BKE_image_buf_fill_color()

void BKE_image_buf_fill_color ( unsigned char *  rect,
float *  rect_float,
int  width,
int  height,
const float  color[4] 
)

◆ BKE_image_buffer_format_writable()

bool BKE_image_buffer_format_writable ( struct ImBuf *  ibuf)

◆ BKE_image_clear_renderslot()

bool BKE_image_clear_renderslot ( struct Image *  ima,
struct ImageUser *  iuser,
int  slot 
)

◆ BKE_image_create_gpu_texture_from_ibuf()

struct GPUTexture* BKE_image_create_gpu_texture_from_ibuf ( struct Image *  image,
struct ImBuf *  ibuf 
)

Not to be use directly.

◆ BKE_image_editors_update_frame()

void BKE_image_editors_update_frame ( const struct Main *  bmain,
int  cfra 
)

◆ BKE_image_ensure_tile_token()

void BKE_image_ensure_tile_token ( char *  filename)

Ensures that filename contains a UDIM token if we find a supported format pattern.

Note
This must only be the name component (without slashes).

Definition at line 3429 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_is_filename_tokenized(), BLI_assert_msg, BLI_path_slash_find(), BLI_strncpy(), FILE_MAX, and direntry::path.

Referenced by BKE_image_get_tile_info(), BKE_packedfile_unpack_image(), do_versions_after_linking_300(), image_file_browse_exec(), and blender::bke::tests::TEST().

◆ BKE_image_ensure_viewer()

struct Image* BKE_image_ensure_viewer ( struct Main *  bmain,
int  type,
const char *  name 
)

◆ BKE_image_ensure_viewer_views()

void BKE_image_ensure_viewer_views ( const struct RenderData *  rd,
struct Image *  ima,
struct ImageUser *  iuser 
)

Ensures the view node cache is compatible with the scene views. Reset the image cache and views when the Viewer Nodes views don't match the scene views.

◆ BKE_image_file_format_set()

void BKE_image_file_format_set ( struct Image *  image,
int  ftype,
const struct ImbFormatOptions *  options 
)

◆ BKE_image_fill_tile()

bool BKE_image_fill_tile ( struct Image *  ima,
struct ImageTile *  tile,
int  width,
int  height,
const float  color[4],
int  gen_type,
int  planes,
bool  is_float 
)

◆ BKE_image_find_nearest_tile()

int int BKE_image_find_nearest_tile ( const struct Image *  image,
const float  co[2] 
)

◆ BKE_image_find_nearest_tile_with_offset()

int BKE_image_find_nearest_tile_with_offset ( const struct Image *  image,
const float  co[2],
float  r_uv_offset[2] 
)

Return the tile_number for the closest UDIM tile.

Referenced by clip_uv_transform_resize(), clip_uv_transform_translation(), and uv_nearest_image_tile_distance().

◆ BKE_image_free_all_gputextures()

void BKE_image_free_all_gputextures ( struct Main *  bmain)

◆ BKE_image_free_all_textures()

void BKE_image_free_all_textures ( struct Main *  bmain)

◆ BKE_image_free_anim_gputextures()

void BKE_image_free_anim_gputextures ( struct Main *  bmain)

Same as above but only free animated images.

Definition at line 530 of file image_gpu.cc.

References BKE_image_free_gputextures(), BKE_image_is_animated(), Main::images, and LISTBASE_FOREACH.

Referenced by ED_view3d_draw_offscreen().

◆ BKE_image_free_anim_ibufs()

void BKE_image_free_anim_ibufs ( struct Image *  ima,
int  except_frame 
)

Operates on one image only!

Parameters
except_frameThis is weak, only works for sequences without offset.

Definition at line 1547 of file source/blender/blenkernel/intern/image.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), Image::cache, Image_Runtime::cache_mutex, imagecache_check_free_anim(), IMB_moviecache_cleanup(), and Image::runtime.

Referenced by BKE_image_all_free_anim_ibufs().

◆ BKE_image_free_buffers()

void BKE_image_free_buffers ( struct Image *  image)

◆ BKE_image_free_buffers_ex()

void BKE_image_free_buffers_ex ( struct Image *  image,
bool  do_lock 
)

Simply free the image data from memory, on display the image can load again (except for render buffers).

Definition at line 599 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_free_gputextures(), BLI_mutex_lock(), BLI_mutex_unlock(), Image_Runtime::cache_mutex, image_free_anims(), image_free_cached_frames(), RE_FreeRenderResult(), Image::rr, and Image::runtime.

Referenced by BKE_image_free_buffers().

◆ BKE_image_free_data()

void BKE_image_free_data ( struct Image *  image)

Free (or release) any data used by this image (does not free the image itself).

Note
Call from library.

Definition at line 625 of file source/blender/blenkernel/intern/image.cc.

References Image::id, and image_free_data().

◆ BKE_image_free_gputextures()

void BKE_image_free_gputextures ( struct Image *  ima)

◆ BKE_image_free_old_gputextures()

void BKE_image_free_old_gputextures ( struct Main *  bmain)

◆ BKE_image_free_packedfiles()

void BKE_image_free_packedfiles ( struct Image *  image)

Definition at line 576 of file source/blender/blenkernel/intern/image.cc.

References image_free_packedfiles().

Referenced by image_save_as_exec().

◆ BKE_image_free_unused_gpu_textures()

void BKE_image_free_unused_gpu_textures ( void  )

Delayed free of OpenGL buffers by main thread.

Definition at line 481 of file image_gpu.cc.

References BLI_thread_is_main(), and gpu_free_unused_buffers().

Referenced by wm_draw_update(), and WM_exit_ex().

◆ BKE_image_free_views()

void BKE_image_free_views ( struct Image *  image)

◆ BKE_image_get_aspect()

void BKE_image_get_aspect ( struct Image *  image,
float *  r_aspx,
float *  r_aspy 
)

◆ BKE_image_get_first_ibuf()

struct ImBuf* BKE_image_get_first_ibuf ( struct Image *  image)

References the result, BKE_image_release_ibuf is to be called to de-reference. Use lock=NULL when calling BKE_image_release_ibuf().

TODO(sergey): This is actually "get first item from the cache", which is not so much predictable. But using first loaded image buffer was also malicious logic and all the areas which uses this function are to be re-considered.

Definition at line 5351 of file source/blender/blenkernel/intern/image.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), image(), IMB_moviecacheIter_done(), IMB_moviecacheIter_free(), IMB_moviecacheIter_getImBuf(), IMB_moviecacheIter_new(), and IMB_refImBuf().

◆ BKE_image_get_float_pixels_for_frame()

float* BKE_image_get_float_pixels_for_frame ( struct Image *  image,
int  frame,
int  tile 
)

◆ BKE_image_get_gpu_texture()

struct GPUTexture* BKE_image_get_gpu_texture ( struct Image *  image,
struct ImageUser *  iuser,
struct ImBuf *  ibuf 
)

◆ BKE_image_get_gpu_tilemap()

struct GPUTexture* BKE_image_get_gpu_tilemap ( struct Image *  image,
struct ImageUser *  iuser,
struct ImBuf *  ibuf 
)

◆ BKE_image_get_gpu_tiles()

struct GPUTexture* BKE_image_get_gpu_tiles ( struct Image *  image,
struct ImageUser *  iuser,
struct ImBuf *  ibuf 
)

◆ BKE_image_get_ibuf_with_name()

struct ImBuf* BKE_image_get_ibuf_with_name ( struct Image *  image,
const char *  name 
)

◆ BKE_image_get_pixels_for_frame()

unsigned char* BKE_image_get_pixels_for_frame ( struct Image *  image,
int  frame,
int  tile 
)

◆ BKE_image_get_renderslot()

struct RenderSlot* BKE_image_get_renderslot ( struct Image *  ima,
int  index 
)

◆ BKE_image_get_size()

void BKE_image_get_size ( struct Image *  image,
struct ImageUser *  iuser,
int *  r_width,
int *  r_height 
)

◆ BKE_image_get_size_fl()

void BKE_image_get_size_fl ( struct Image *  image,
struct ImageUser *  iuser,
float  r_size[2] 
)

◆ BKE_image_get_tile()

struct ImageTile* BKE_image_get_tile ( struct Image *  ima,
int  tile_number 
)

◆ BKE_image_get_tile_from_iuser()

struct ImageTile* BKE_image_get_tile_from_iuser ( struct Image *  ima,
const struct ImageUser *  iuser 
)

◆ BKE_image_get_tile_from_pos()

int BKE_image_get_tile_from_pos ( struct Image *  ima,
const float  uv[2],
float  r_uv[2],
float  r_ofs[2] 
)

◆ BKE_image_get_tile_info()

bool BKE_image_get_tile_info ( char *  filepath,
struct ListBase *  tiles,
int *  r_tile_start,
int *  r_tile_range 
)

Checks whether the given filepath refers to a UDIM tiled texture. If yes, the range from the lowest to the highest tile is returned.

Parameters
filepathmay be modified to ensure a UDIM token is present.
tilesmay be filled even if the result ultimately is false!

Definition at line 3215 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_ensure_tile_token(), BKE_image_get_tile_number_from_filepath(), BKE_image_get_tile_strformat(), BKE_image_is_filename_tokenized(), BLI_addtail(), BLI_filelist_dir_contents(), BLI_filelist_free(), BLI_genericNodeN(), BLI_join_dirfile(), BLI_split_dirfile(), dirname(), FILE_MAX, FILE_MAXDIR, FILE_MAXFILE, id, IMA_UDIM_MAX, max_ii(), MEM_SAFE_FREE, min_ii(), POINTER_FROM_INT, direntry::relname, tiles, and type.

Referenced by BKE_image_signal(), and image_detect_frame_range().

◆ BKE_image_get_tile_label()

void BKE_image_get_tile_label ( struct Image *  ima,
struct ImageTile *  tile,
char *  label,
int  len_label 
)

Get tile index for tiled images.

Definition at line 3200 of file source/blender/blenkernel/intern/image.cc.

References BLI_snprintf(), BLI_strncpy(), label, and tile.

◆ BKE_image_get_tile_number_from_filepath()

bool BKE_image_get_tile_number_from_filepath ( const char *  filepath,
const char *  pattern,
eUDIM_TILE_FORMAT  tile_format,
int *  r_tile_number 
)

◆ BKE_image_get_tile_strformat()

char* BKE_image_get_tile_strformat ( const char *  filepath,
eUDIM_TILE_FORMAT *  r_tile_format 
)

◆ BKE_image_get_tile_uv()

void BKE_image_get_tile_uv ( const struct Image *  ima,
const int  tile_number,
float  r_uv[2] 
)

◆ BKE_image_has_alpha()

bool BKE_image_has_alpha ( struct Image *  image)

Check if texture has alpha planes == 32 || planes == 16.

Definition at line 5083 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), image(), lock, and ImBuf::planes.

Referenced by uiTemplateImage().

◆ BKE_image_has_anim()

bool BKE_image_has_anim ( struct Image *  image)

◆ BKE_image_has_filepath()

bool BKE_image_has_filepath ( const struct Image *  ima)

◆ BKE_image_has_gpu_texture_premultiplied_alpha()

bool BKE_image_has_gpu_texture_premultiplied_alpha ( struct Image *  image,
struct ImBuf *  ibuf 
)

◆ BKE_image_has_ibuf()

bool BKE_image_has_ibuf ( struct Image *  ima,
struct ImageUser *  iuser 
)

◆ BKE_image_has_loaded_ibuf()

bool BKE_image_has_loaded_ibuf ( struct Image *  image)

◆ BKE_image_has_multiple_ibufs()

bool BKE_image_has_multiple_ibufs ( struct Image *  image)

Checks whether the image consists of multiple buffers.

Definition at line 5233 of file source/blender/blenkernel/intern/image.cc.

References ELEM, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, IMA_SRC_TILED, and image().

Referenced by image_get_multiview_index().

◆ BKE_image_has_opengl_texture()

bool BKE_image_has_opengl_texture ( struct Image *  ima)

Check if texture has GPU texture code.

Definition at line 776 of file source/blender/blenkernel/intern/image.cc.

References Image::gputexture, and TEXTARGET_COUNT.

Referenced by BKE_image_free_old_gputextures(), and BKE_image_paint_set_mipmap().

◆ BKE_image_has_packedfile()

bool BKE_image_has_packedfile ( const struct Image *  image)

◆ BKE_image_init_imageuser()

void BKE_image_init_imageuser ( struct Image *  ima,
struct ImageUser *  iuser 
)

◆ BKE_image_is_animated()

bool BKE_image_is_animated ( struct Image *  image)

◆ BKE_image_is_dirty()

bool BKE_image_is_dirty ( struct Image *  image)

◆ BKE_image_is_dirty_writable()

bool BKE_image_is_dirty_writable ( struct Image *  image,
bool *  r_is_writable 
)

◆ BKE_image_is_filename_tokenized()

bool BKE_image_is_filename_tokenized ( char *  filepath)

Checks if the filename portion of the path contains a UDIM token.

Definition at line 3423 of file source/blender/blenkernel/intern/image.cc.

References BLI_path_basename().

Referenced by BKE_image_ensure_tile_token(), and BKE_image_get_tile_info().

◆ BKE_image_is_multilayer()

bool BKE_image_is_multilayer ( const struct Image *  ima)

For multi-layer images as well as for render-viewer and because rendered results use fake layer/passes, don't correct for wrong indices here.

Referenced by blender::compositor::BaseImageOperation::get_im_buf().

◆ BKE_image_is_multiview()

bool BKE_image_is_multiview ( const struct Image *  ima)

◆ BKE_image_is_openexr()

bool BKE_image_is_openexr ( struct Image *  ima)

For multi-layer images as well as for single-layer.

Definition at line 3707 of file source/blender/blenkernel/intern/image.cc.

References BLI_path_extension_check(), ELEM, Image::filepath, IMA_SRC_FILE, IMA_SRC_SEQUENCE, IMA_SRC_TILED, Image::source, and UNUSED_VARS.

◆ BKE_image_is_stereo()

bool BKE_image_is_stereo ( const struct Image *  ima)

◆ BKE_image_load()

struct Image* BKE_image_load ( struct Main *  bmain,
const char *  filepath 
)

◆ BKE_image_load_exists()

struct Image* BKE_image_load_exists ( struct Main *  bmain,
const char *  filepath 
)

◆ BKE_image_load_exists_ex()

struct Image* BKE_image_load_exists_ex ( struct Main *  bmain,
const char *  filepath,
bool *  r_exists 
)

Returns existing Image when filename/type is same.

Checks if image was already loaded, then returns same image otherwise creates new (does not load ibuf itself).

Definition at line 980 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_has_anim(), BKE_image_load(), BLI_path_abs(), BLI_path_cmp, ELEM, FILE_MAX, Main::filepath, Image::filepath, ListBase::first, Image::id, ID_BLEND_PATH, id_us_plus(), IMA_SRC_GENERATED, IMA_SRC_VIEWER, Main::images, ID::next, Image::source, str, STRNCPY, and ID::us.

Referenced by BKE_image_load_exists(), image_open_single(), and WM_operator_drop_load_path().

◆ BKE_image_mark_dirty()

void BKE_image_mark_dirty ( struct Image *  image,
struct ImBuf *  ibuf 
)

◆ BKE_image_memorypack()

bool BKE_image_memorypack ( struct Image *  ima)

◆ BKE_image_merge()

void BKE_image_merge ( struct Main *  bmain,
struct Image *  dest,
struct Image *  source 
)

◆ BKE_image_multilayer_index()

struct RenderPass* BKE_image_multilayer_index ( struct RenderResult *  rr,
struct ImageUser *  iuser 
)

◆ BKE_image_multiview_index()

void BKE_image_multiview_index ( const struct Image *  ima,
struct ImageUser *  iuser 
)

◆ BKE_image_packfiles()

void BKE_image_packfiles ( struct ReportList *  reports,
struct Image *  ima,
const char *  basepath 
)

◆ BKE_image_packfiles_from_mem()

void BKE_image_packfiles_from_mem ( struct ReportList *  reports,
struct Image *  ima,
char *  data,
size_t  data_len 
)

◆ BKE_image_paint_set_mipmap()

void BKE_image_paint_set_mipmap ( struct Main *  bmain,
bool  mipmap 
)

Called on entering and exiting texture paint mode, temporary disabling/enabling mipmapping on all images for quick texture updates with glTexSubImage2D. images that didn't change don't have to be re-uploaded to OpenGL.

Definition at line 866 of file image_gpu.cc.

References Freestyle::a, BKE_image_free_gputextures(), BKE_image_has_opengl_texture(), ELEM, GPU_texture_mipmap_mode(), IMA_GPU_MIPMAP_COMPLETE, Main::images, LISTBASE_FOREACH, tex, TEXTARGET_2D, TEXTARGET_2D_ARRAY, and TEXTARGET_COUNT.

Referenced by ED_object_texture_paint_mode_enter_ex(), and ED_object_texture_paint_mode_exit_ex().

◆ BKE_image_partial_update_create()

struct PartialUpdateUser* BKE_image_partial_update_create ( const struct Image *  image)

Create a new PartialUpdateUser. An Object that contains data to use partial updates.

Definition at line 546 of file image_partial_update.cc.

References image(), UNUSED_VARS, and blender::bke::image::partial_update::wrap().

Referenced by image_get_gpu_texture(), and blender::bke::image::partial_update::ImagePartialUpdateTest::SetUp().

◆ BKE_image_partial_update_free()

void BKE_image_partial_update_free ( struct PartialUpdateUser *  user)

◆ BKE_image_partial_update_mark_full_update()

void BKE_image_partial_update_mark_full_update ( struct Image *  image)

◆ BKE_image_partial_update_mark_region()

void BKE_image_partial_update_mark_region ( struct Image *  image,
const struct ImageTile *  image_tile,
const struct ImBuf *  image_buffer,
const rcti *  updated_region 
)

◆ BKE_image_partial_update_register_free()

void BKE_image_partial_update_register_free ( struct Image *  image)

◆ BKE_image_pool_acquire_ibuf()

struct ImBuf* BKE_image_pool_acquire_ibuf ( struct Image *  ima,
struct ImageUser *  iuser,
struct ImagePool *  pool 
)

◆ BKE_image_pool_free()

void BKE_image_pool_free ( struct ImagePool *  pool)

◆ BKE_image_pool_new()

struct ImagePool* BKE_image_pool_new ( void  )

◆ BKE_image_pool_release_ibuf()

void BKE_image_pool_release_ibuf ( struct Image *  ima,
struct ImBuf *  ibuf,
struct ImagePool *  pool 
)

◆ BKE_image_print_memlist()

void BKE_image_print_memlist ( struct Main *  bmain)

Prints memory statistics for images.

Definition at line 1466 of file source/blender/blenkernel/intern/image.cc.

References ListBase::first, Image::id, image_mem_size(), Main::images, ID::name, ID::next, and size().

◆ BKE_image_reassign_tile()

void BKE_image_reassign_tile ( struct Image *  ima,
struct ImageTile *  tile,
int  new_tile_number 
)

◆ BKE_image_release_ibuf()

void BKE_image_release_ibuf ( struct Image *  ima,
struct ImBuf *  ibuf,
void *  lock 
)

Definition at line 4688 of file source/blender/blenkernel/intern/image.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), BLI_thread_unlock(), Image_Runtime::cache_mutex, IMB_freeImBuf(), lock, LOCK_VIEWER, RE_ReleaseResultImage(), and Image::runtime.

Referenced by blender::bke::pbvh::pixels::apply_watertight_check(), blender::ed::space_node::backimage_fit_exec(), bake_images(), bake_object_check(), bake_targets_init_internal(), BKE_gpencil_from_image(), BKE_image_fill_tile(), BKE_image_get_float_pixels_for_frame(), BKE_image_get_pixels_for_frame(), BKE_image_get_size(), BKE_image_has_alpha(), BKE_image_pool_release_ibuf(), BKE_image_save_options_init(), BKE_image_scale(), BKE_image_update_gputexture(), BKE_paint_canvas_key_get(), blender::bke::pbvh::pixels::BKE_pbvh_pixels_mark_image_dirty(), clear_single_image(), cmp_node_image_create_outputs(), colorfn(), blender::compositor::ImageNode::convert_to_operations(), cryptomatte_init_from_node_image(), blender::compositor::BaseImageOperation::deinit_execution(), blender::compositor::BaseImageOperation::determine_canvas(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), blender::ed::sculpt_paint::paint::image::do_push_undo_tile(), blender::ed::space_node::draw_nodespace_back_pix(), draw_plane_marker_image(), ED_space_image_acquire_buffer(), ED_space_image_release_buffer(), ED_space_node_color_sample(), ED_space_node_get_position(), eyedropper_cryptomatte_sample_image_fl(), finish_images(), blender::bke::image::partial_update::ImageTileData::free_data(), blender::compositor::BaseImageOperation::get_im_buf(), gpencil_boundaryfill_area(), gpencil_erase_processed_area(), gpencil_find_and_mark_empty_areas(), gpencil_get_outline_points(), gpencil_image_texture_get(), gpencil_invert_image(), gpencil_render_offscreen(), gpencil_set_borders(), gpu_texture_create_tile_array(), icon_preview_startjob(), image_camera_background_texture_get(), image_file_format_writable(), image_flip_exec(), image_from_context_has_data_poll(), image_get_gpu_texture(), image_invert_exec(), image_rect_update(), image_save_single(), image_scale_exec(), image_scale_invoke(), image_undosys_step_encode(), blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::ImageFieldsFunction(), metadata_panel_context_draw(), multiresbake_check(), OVERLAY_edit_uv_draw_finish(), paint_2d_bucket_fill(), paint_2d_canvas_free(), paint_2d_canvas_set(), paint_2d_ensure_tile_canvas(), paint_2d_gradient_fill(), paint_2d_new_stroke(), paint_2d_redraw(), paint_sample_color(), palette_extract_img_exec(), project_paint_end(), project_paint_PickColor(), project_paint_uvpixel_init(), project_paint_uvpixel_mask(), ptile_restore_runtime_map(), RE_bake_ibuf_clear(), blender::draw::image_engine::SpaceNodeAccessor::release_buffer(), render_endjob(), blender::ed::space_node::sample_apply(), screen_opengl_render_apply(), blender::ed::space_node::snode_bg_viewmove_invoke(), blender::bke::image::partial_update::ImagePartialUpdateTest::TearDown(), tile_fill_init(), trace_start_job(), uhandle_restore_list(), uiTemplateImage(), uiTemplateImageInfo(), blender::ed::space_node::viewer_border_exec(), blender::ed::space_node::WIDGETGROUP_node_corner_pin_refresh(), blender::ed::space_node::WIDGETGROUP_node_crop_refresh(), blender::ed::space_node::WIDGETGROUP_node_sbeam_refresh(), blender::ed::space_node::WIDGETGROUP_node_transform_refresh(), write_internal_bake_pixels(), and blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::~ImageFieldsFunction().

◆ BKE_image_release_renderresult()

void BKE_image_release_renderresult ( struct Scene *  scene,
struct Image *  ima 
)

◆ BKE_image_remove_renderslot()

bool BKE_image_remove_renderslot ( struct Image *  ima,
struct ImageUser *  iuser,
int  slot 
)

◆ BKE_image_remove_tile()

bool BKE_image_remove_tile ( struct Image *  ima,
struct ImageTile *  tile 
)

◆ BKE_image_replace_imbuf()

void BKE_image_replace_imbuf ( struct Image *  image,
struct ImBuf *  ibuf 
)

For a non-viewer single-buffer image (single frame file, or generated image) replace its image buffer with the given one. If an unsupported image type (multi-layer, image sequence, ...) the function will assert in the debug mode and will have an undefined behavior in the release mode.

Definition at line 1237 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_free_buffers(), BKE_image_mark_dirty(), BLI_assert, ELEM, IMA_GEN_FLOAT, IMA_NO_INDEX, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_TYPE_IMAGE, image(), image_assign_ibuf(), image_colorspace_from_imbuf(), ImBuf::rect_float, ImBuf::x, and ImBuf::y.

Referenced by BKE_image_add_from_imbuf(), and update_image_from_plane_marker_exec().

◆ BKE_image_scale()

bool BKE_image_scale ( struct Image *  image,
int  width,
int  height 
)

◆ BKE_image_sequence_guess_offset()

int BKE_image_sequence_guess_offset ( struct Image *  image)

Guess offset for the first frame in the sequence.

Definition at line 5206 of file source/blender/blenkernel/intern/image.cc.

References BLI_path_sequence_decode(), and image().

Referenced by cmp_node_image_create_outputs().

◆ BKE_image_set_filepath_from_tile_number()

void BKE_image_set_filepath_from_tile_number ( char *  filepath,
const char *  pattern,
eUDIM_TILE_FORMAT  tile_format,
int  tile_number 
)

◆ BKE_image_signal()

void BKE_image_signal ( struct Main *  bmain,
struct Image *  ima,
struct ImageUser *  iuser,
int  signal 
)

Definition at line 2982 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_add_tile(), BKE_image_free_buffers(), BKE_image_get_tile(), BKE_image_get_tile_info(), BKE_image_has_packedfile(), BKE_image_init_imageuser(), BKE_image_packfiles(), BKE_image_remove_tile(), BKE_image_walk_all_users(), BKE_ntree_update_main(), BKE_ntree_update_tag_id_changed(), BKE_packedfile_free(), BKE_packedfile_new(), BLI_assert, BLI_freelistN(), BLI_listbase_count(), BLI_listbase_count_at_most(), BLI_mutex_lock(), BLI_mutex_unlock(), BLI_path_abs(), BLI_strncpy(), Image_Runtime::cache_mutex, ELEM, FILE_MAX, ImagePackedFile::filepath, Image::filepath, ListBase::first, Image::gen_x, Image::gen_y, Image::id, ID_BLEND_PATH, ID_BLEND_PATH_FROM_GLOBAL, IMA_NO_INDEX, IMA_SIGNAL_COLORMANAGE, IMA_SIGNAL_FREE, IMA_SIGNAL_RELOAD, IMA_SIGNAL_SRC_CHANGE, IMA_SIGNAL_USER_NEW_IMAGE, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_SEQUENCE, IMA_SRC_TILED, IMA_TYPE_IMAGE, IMA_TYPE_MULTILAYER, IMA_TYPE_UV_TEST, image_free_packedfiles(), image_free_tile(), image_get_cached_ibuf_for_index_entry(), image_num_viewfiles(), image_tag_frame_recalc(), image_tag_reload(), image_update_views_format(), IMB_freeImBuf(), ListBase::last, LISTBASE_FOREACH, MEM_freeN, ImagePackedFile::next, ImageTile::next, ImagePackedFile::packedfile, Image::packedfiles, pf, POINTER_AS_INT, result, Image::runtime, ImageUser::scene, Image::source, tile, ImageTile::tile_number, Image::tiles, Image::type, ImBuf::x, and ImBuf::y.

Referenced by BKE_image_save(), BKE_packedfile_unpack_image(), blender::compositor::CompositorOperation::deinit_execution(), ED_space_image_auto_set(), ED_space_image_set(), image_foreach_path(), image_new_exec(), image_open_exec(), image_reload_exec(), image_replace_exec(), blender::ed::space_node::node_add_file_exec(), proj_paint_add_slot(), screen_opengl_render_init(), screen_render_exec(), and screen_render_invoke().

◆ BKE_image_sort_tiles()

void BKE_image_sort_tiles ( struct Image *  ima)

◆ BKE_image_stamp_buf()

void BKE_image_stamp_buf ( struct Scene *  scene,
struct Object *  camera,
const struct StampData *  stamp_data_template,
unsigned char *  rect,
float *  rectf,
int  width,
int  height,
int  channels 
)

◆ BKE_image_tag_time()

void BKE_image_tag_time ( struct Image *  ima)

◆ BKE_image_tile_filepath_exists()

bool BKE_image_tile_filepath_exists ( const char *  filepath)

When provided with an absolute virtual filepath, check to see if at least one concrete file exists. NOTE: This function requires directory traversal and may be inefficient in time-critical, or iterative, code paths.

Definition at line 3458 of file source/blender/blenkernel/intern/image.cc.

References BKE_image_get_tile_number_from_filepath(), BKE_image_get_tile_strformat(), BLI_assert, BLI_filelist_dir_contents(), BLI_filelist_free(), BLI_path_is_rel(), BLI_split_dir_part(), dirname(), FILE_MAXDIR, id, IMA_UDIM_MAX, MEM_SAFE_FREE, direntry::path, and type.

Referenced by BKE_image_load().

◆ BKE_image_update_gputexture()

void BKE_image_update_gputexture ( struct Image *  ima,
struct ImageUser *  iuser,
int  x,
int  y,
int  w,
int  h 
)

Partial update of texture for texture painting. This is often much quicker than fully updating the texture for high resolution images.

Definition at line 838 of file image_gpu.cc.

References BKE_image_acquire_ibuf(), BKE_image_get_tile_from_iuser, BKE_image_release_ibuf(), BKE_image_update_gputexture_delayed(), w(), x, and y.

Referenced by imapaint_image_update().

◆ BKE_image_update_gputexture_delayed()

void BKE_image_update_gputexture_delayed ( struct Image *  ima,
struct ImageTile *  image_tile,
struct ImBuf *  ibuf,
int  x,
int  y,
int  w,
int  h 
)

Mark areas on the GPUTexture that needs to be updated. The areas are marked in chunks. The next time the GPUTexture is used these tiles will be refreshes. This saves time when writing to the same place multiple times This happens for during foreground rendering.

Definition at line 846 of file image_gpu.cc.

References BKE_image_partial_update_mark_full_update(), BKE_image_partial_update_mark_region(), BLI_rcti_init(), IMA_SRC_TILED, Image::source, w(), x, ImBuf::x, y, and ImBuf::y.

Referenced by BKE_image_update_gputexture(), and image_rect_update().

◆ BKE_image_user_file_path()

void BKE_image_user_file_path ( const struct ImageUser *  iuser,
const struct Image *  ima,
char *  path 
)

◆ BKE_image_user_file_path_ex()

void BKE_image_user_file_path_ex ( const struct Main *  bmain,
const struct ImageUser *  iuser,
const struct Image *  ima,
char *  path,
const bool  resolve_udim,
const bool  resolve_multiview 
)

◆ BKE_image_user_frame_calc()

void BKE_image_user_frame_calc ( struct Image *  ima,
struct ImageUser *  iuser,
int  cfra 
)

◆ BKE_image_user_frame_get()

int BKE_image_user_frame_get ( const struct ImageUser *  iuser,
int  cfra,
bool *  r_is_in_range 
)

◆ BKE_image_user_id_eval_animation()

void BKE_image_user_id_eval_animation ( struct Depsgraph *  depsgraph,
struct ID *  id 
)

◆ BKE_image_user_id_has_animation()

bool BKE_image_user_id_has_animation ( struct ID *  id)

◆ BKE_image_walk_all_users()

void BKE_image_walk_all_users ( const struct Main *  mainp,
void *  customdata,
void   callbackstruct Image *ima, struct ID *iuser_id, struct ImageUser *iuser, void *customdata 
)

◆ BKE_imageuser_default()

void BKE_imageuser_default ( struct ImageUser *  iuser)

◆ BKE_imbuf_alpha_test()

bool BKE_imbuf_alpha_test ( struct ImBuf *  ibuf)

◆ BKE_imbuf_stamp_info()

void BKE_imbuf_stamp_info ( const struct RenderResult *  rr,
struct ImBuf *  ibuf 
)

Referenced by image_save_single().

◆ BKE_imbuf_write()

int BKE_imbuf_write ( struct ImBuf *  ibuf,
const char *  name,
const struct ImageFormatData *  imf 
)

◆ BKE_imbuf_write_as()

int BKE_imbuf_write_as ( struct ImBuf *  ibuf,
const char *  name,
const struct ImageFormatData *  imf,
bool  save_copy 
)

Same as BKE_imbuf_write() but crappy workaround not to permanently modify some, values in the imbuf.

Referenced by blender::io::usd::export_in_memory_texture(), and image_save_single().

◆ BKE_imbuf_write_stamp()

int BKE_imbuf_write_stamp ( const struct Scene *  scene,
const struct RenderResult *  rr,
struct ImBuf *  ibuf,
const char *  name,
const struct ImageFormatData *  imf 
)

◆ BKE_render_result_stamp_data()

void BKE_render_result_stamp_data ( struct RenderResult *  rr,
const char *  key,
const char *  value 
)

◆ BKE_render_result_stamp_info()

void BKE_render_result_stamp_info ( struct Scene *  scene,
struct Object *  camera,
struct RenderResult *  rr,
bool  allocate_only 
)

◆ BKE_stamp_data_copy()

struct StampData* BKE_stamp_data_copy ( const struct StampData *  stamp_data)

◆ BKE_stamp_data_free()

void BKE_stamp_data_free ( struct StampData *  stamp_data)

◆ BKE_stamp_info_callback()

void BKE_stamp_info_callback ( void *  data,
struct StampData *  stamp_data,
StampCallback  callback,
bool  noskip 
)

◆ BKE_stamp_info_from_imbuf()

void BKE_stamp_info_from_imbuf ( struct RenderResult *  rr,
struct ImBuf *  ibuf 
)

◆ BKE_stamp_info_from_scene_static()

struct StampData* BKE_stamp_info_from_scene_static ( const struct Scene *  scene)

Fills in the static stamp data (i.e. everything except things that can change per frame). The caller is responsible for freeing the allocated memory.

Referenced by blender::compositor::OutputOpenExrMultiLayerOperation::create_stamp_data().

◆ BKE_stamp_is_known_field()

bool BKE_stamp_is_known_field ( const char *  field_name)

Check whether the given metadata field name translates to a known field of a stamp.

Definition at line 2346 of file source/blender/blenkernel/intern/image.cc.

References stamp_metadata_fields, and STREQ.

Referenced by metadata_copy_custom_fields(), and metadata_is_custom_drawable().

◆ openanim()

struct anim* openanim ( const char *  name,
int  flags,
int  streamindex,
char  colorspace[IMA_MAX_SPACE] 
)

◆ openanim_noload()

struct anim* openanim_noload ( const char *  name,
int  flags,
int  streamindex,
char  colorspace[IMA_MAX_SPACE] 
)

Variable Documentation

◆ ATTR_WARN_UNUSED_RESULT

int int ATTR_WARN_UNUSED_RESULT

Definition at line 434 of file BKE_image.h.