Blender V2.61 - r43446
|
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <math.h>
#include <unistd.h>
#include <time.h>
#include "MEM_guardedalloc.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "DNA_packedFile_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "DNA_camera_types.h"
#include "DNA_sequence_types.h"
#include "DNA_userdef_types.h"
#include "DNA_brush_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "BLI_blenlib.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BLI_bpath.h"
#include "BKE_bmfont.h"
#include "BKE_global.h"
#include "BKE_icons.h"
#include "BKE_image.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_packedFile.h"
#include "BKE_scene.h"
#include "BKE_node.h"
#include "BKE_sequencer.h"
#include "BKE_utildefines.h"
#include "BLF_api.h"
#include "PIL_time.h"
#include "RE_pipeline.h"
#include "GPU_draw.h"
#include "BLO_sys_types.h"
Go to the source code of this file.
Classes | |
struct | StampData |
Defines | |
#define | IMA_NO_INDEX 0x7FEFEFEF |
#define | IMA_MAKE_INDEX(frame, index) ((frame)<<10)+index |
#define | IMA_INDEX_FRAME(index) (index>>10) |
#define | IMA_INDEX_PASS(index) (index & ~1023) |
#define | BUFF_MARGIN_X 2 |
#define | BUFF_MARGIN_Y 1 |
Typedefs | |
typedef struct StampData | StampData |
Functions | |
static void | de_interlace_ng (struct ImBuf *ibuf) |
static void | de_interlace_st (struct ImBuf *ibuf) |
void | image_de_interlace (Image *ima, int odd) |
static void | image_free_buffers (Image *ima) |
void | free_image (Image *ima) |
static Image * | image_alloc (const char *name, short source, short type) |
static ImBuf * | image_get_ibuf (Image *ima, int index, int frame) |
static void | image_remove_ibuf (Image *ima, ImBuf *ibuf) |
static void | image_assign_ibuf (Image *ima, ImBuf *ibuf, int index, int frame) |
Image * | copy_image (Image *ima) |
static void | extern_local_image (Image *UNUSED(ima)) |
void | make_local_image (struct Image *ima) |
void | BKE_image_merge (Image *dest, Image *source) |
Image * | BKE_add_image_file (const char *name) |
static ImBuf * | add_ibuf_size (unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4]) |
Image * | BKE_add_image_size (unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4]) |
Image * | BKE_add_image_imbuf (ImBuf *ibuf) |
void | BKE_image_memorypack (Image *ima) |
void | tag_image_time (Image *ima) |
void | free_old_images (void) |
static uintptr_t | image_mem_size (Image *ima) |
void | BKE_image_print_memlist (void) |
void | BKE_image_free_all_textures (void) |
void | BKE_image_free_anim_ibufs (Image *ima, int except_frame) |
void | BKE_image_all_free_anim_ibufs (int cfra) |
int | BKE_imtype_to_ftype (const char imtype) |
char | BKE_ftype_to_imtype (const int ftype) |
int | BKE_imtype_is_movie (const char imtype) |
int | BKE_imtype_supports_zbuf (const char imtype) |
int | BKE_imtype_supports_compress (const char imtype) |
int | BKE_imtype_supports_quality (const char imtype) |
char | BKE_imtype_valid_channels (const char imtype) |
char | BKE_imtype_valid_depths (const char imtype) |
char | BKE_imtype_from_arg (const char *imtype_arg) |
int | BKE_add_image_extension (char *string, const char imtype) |
static void | stampdata (Scene *scene, Object *camera, StampData *stamp_data, int do_prefix) |
void | BKE_stamp_buf (Scene *scene, Object *camera, unsigned char *rect, float *rectf, int width, int height, int channels) |
void | BKE_stamp_info (Scene *scene, Object *camera, struct ImBuf *ibuf) |
int | BKE_alphatest_ibuf (ImBuf *ibuf) |
int | BKE_write_ibuf (ImBuf *ibuf, const char *name, ImageFormatData *imf) |
int | BKE_write_ibuf_as (ImBuf *ibuf, const char *name, ImageFormatData *imf, const short save_copy) |
int | BKE_write_ibuf_stamp (Scene *scene, struct Object *camera, ImBuf *ibuf, const char *name, struct ImageFormatData *imf) |
void | BKE_makepicstring (char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames) |
struct anim * | openanim (const char *name, int flags, int streamindex) |
Image * | BKE_image_verify_viewer (int type, const char *name) |
void | BKE_image_assign_ibuf (Image *ima, ImBuf *ibuf) |
void | BKE_image_signal (Image *ima, ImageUser *iuser, int signal) |
RenderPass * | BKE_image_multilayer_index (RenderResult *rr, ImageUser *iuser) |
RenderResult * | BKE_image_acquire_renderresult (Scene *scene, Image *ima) |
void | BKE_image_release_renderresult (Scene *scene, Image *ima) |
void | BKE_image_backup_render (Scene *scene, Image *ima) |
static void | image_create_multilayer (Image *ima, ImBuf *ibuf, int framenr) |
static void | image_initialize_after_load (Image *ima, ImBuf *ibuf) |
static ImBuf * | image_load_sequence_file (Image *ima, ImageUser *iuser, int frame) |
static ImBuf * | image_load_sequence_multilayer (Image *ima, ImageUser *iuser, int frame) |
static ImBuf * | image_load_movie_file (Image *ima, ImageUser *iuser, int frame) |
static ImBuf * | image_load_image_file (Image *ima, ImageUser *iuser, int cfra) |
static ImBuf * | image_get_ibuf_multilayer (Image *ima, ImageUser *iuser) |
static ImBuf * | image_get_render_result (Image *ima, ImageUser *iuser, void **lock_r) |
static ImBuf * | image_get_ibuf_threadsafe (Image *ima, ImageUser *iuser, int *frame_r, int *index_r) |
ImBuf * | BKE_image_acquire_ibuf (Image *ima, ImageUser *iuser, void **lock_r) |
void | BKE_image_release_ibuf (Image *ima, void *lock) |
ImBuf * | BKE_image_get_ibuf (Image *ima, ImageUser *iuser) |
int | BKE_image_user_get_frame (const ImageUser *iuser, int cfra, int fieldnr) |
void | BKE_image_user_calc_frame (ImageUser *iuser, int cfra, int fieldnr) |
int | BKE_image_has_alpha (struct Image *image) |
Definition in file image.c.
#define BUFF_MARGIN_X 2 |
Referenced by BKE_stamp_buf().
#define BUFF_MARGIN_Y 1 |
Referenced by BKE_stamp_buf().
#define IMA_INDEX_FRAME | ( | index | ) | (index>>10) |
Definition at line 99 of file image.c.
Referenced by BKE_image_free_anim_ibufs(), and BKE_image_merge().
#define IMA_INDEX_PASS | ( | index | ) | (index & ~1023) |
Definition at line 100 of file image.c.
Referenced by BKE_image_merge().
#define IMA_MAKE_INDEX | ( | frame, | |
index | |||
) | ((frame)<<10)+index |
Definition at line 98 of file image.c.
Referenced by image_assign_ibuf(), and image_get_ibuf().
#define IMA_NO_INDEX 0x7FEFEFEF |
Definition at line 95 of file image.c.
Referenced by BKE_add_image_imbuf(), BKE_add_image_size(), BKE_image_acquire_ibuf(), BKE_image_assign_ibuf(), BKE_image_free_anim_ibufs(), BKE_image_memorypack(), BKE_image_signal(), image_assign_ibuf(), image_get_ibuf(), image_get_ibuf_multilayer(), image_get_ibuf_threadsafe(), image_get_render_result(), and image_load_image_file().
static ImBuf* add_ibuf_size | ( | unsigned int | width, |
unsigned int | height, | ||
const char * | name, | ||
int | depth, | ||
int | floatbuf, | ||
short | uvtestgrid, | ||
float | color[4] | ||
) | [static] |
Definition at line 522 of file image.c.
References BKE_image_buf_fill_checker(), BKE_image_buf_fill_checker_color(), BKE_image_buf_fill_color(), BLI_strncpy(), IB_BITMAPDIRTY, IB_rect, IB_rectfloat, IMB_allocImBuf(), ImBuf::name, NULL, ImBuf::rect, ImBuf::rect_float, and ImBuf::userflags.
Referenced by BKE_add_image_size(), and BKE_image_acquire_ibuf().
int BKE_add_image_extension | ( | char * | string, |
const char | imtype | ||
) |
Definition at line 1035 of file image.c.
References BLI_ensure_extension(), BLI_replace_extension(), BLI_testextensie(), BLI_testextensie_array(), ELEM, ELEM5, FALSE, FILE_MAX, G, imb_ext_image, imb_ext_image_qt, NULL, R_IMF_IMTYPE_BMP, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_IRIZ, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_RAWTGA, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_TIFF, R_IMF_IMTYPE_XVID, and TRUE.
Referenced by BKE_makepicstring(), BL_MakeScreenShot(), do_write_image_or_movie(), dynamicPaint_outputSurfaceImage(), envmap_save_exec(), image_save_as_check(), and screenshot_exec().
Image* BKE_add_image_file | ( | const char * | name | ) | [read] |
Definition at line 472 of file image.c.
References Image::anim, BLI_path_abs(), BLI_strncpy(), BLI_testextensie_array(), FILE_MAX, G, Image::id, IMA_OK, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_MOVIE, IMA_SRC_VIEWER, IMA_TYPE_IMAGE, image_alloc(), imb_ext_movie, len(), Image::name, ID::next, NULL, O_BINARY, Image::ok, Image::source, str, strlen(), and ID::us.
Referenced by background_image_add_invoke(), drop_named_image_invoke(), image_open_exec(), node_add_file_exec(), and DocumentImporter::writeImage().
Definition at line 579 of file image.c.
References BLI_path_basename(), BLI_strncpy(), FILE_MAX, IMA_NO_INDEX, IMA_OK_LOADED, IMA_SRC_FILE, IMA_TYPE_IMAGE, image_alloc(), image_assign_ibuf(), Image::name, ImBuf::name, and Image::ok.
Referenced by texture_paint_image_from_view_exec().
Image* BKE_add_image_size | ( | unsigned int | width, |
unsigned int | height, | ||
const char * | name, | ||
int | depth, | ||
int | floatbuf, | ||
short | uvtestgrid, | ||
float | color[4] | ||
) | [read] |
Definition at line 555 of file image.c.
References add_ibuf_size(), Image::gen_flag, Image::gen_type, Image::gen_x, Image::gen_y, IMA_GEN_FLOAT, IMA_NO_INDEX, IMA_OK_LOADED, IMA_SRC_GENERATED, IMA_TYPE_UV_TEST, image_alloc(), image_assign_ibuf(), Image::name, and Image::ok.
Referenced by image_new_exec().
int BKE_alphatest_ibuf | ( | ImBuf * | ibuf | ) |
Definition at line 1483 of file image.c.
References FALSE, ImBuf::rect, ImBuf::rect_float, TRUE, ImBuf::x, and ImBuf::y.
Referenced by RE_bake_ibuf_filter(), and save_image_doit().
char BKE_ftype_to_imtype | ( | const int | ftype | ) |
Definition at line 847 of file image.c.
References BMP, IMAGIC, OPENEXR, PNG, R_IMF_IMTYPE_BMP, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_RAWTGA, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_TIFF, RAWTGA, and TGA.
Referenced by save_image_options_init().
Definition at line 2383 of file image.c.
References add_ibuf_size(), BLI_lock_thread(), BLI_unlock_thread(), MakeCursor::color, Image::gen_flag, Image::gen_type, Image::gen_x, Image::gen_y, IB_rect, IMA_GEN_FLOAT, IMA_NO_INDEX, IMA_OK_LOADED, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, IMA_SRC_VIEWER, IMA_TYPE_COMPOSITE, IMA_TYPE_IMAGE, IMA_TYPE_MULTILAYER, IMA_TYPE_R_RESULT, image_assign_ibuf(), image_get_ibuf(), image_get_ibuf_multilayer(), image_get_ibuf_threadsafe(), image_get_render_result(), image_load_image_file(), image_load_movie_file(), image_load_sequence_file(), image_load_sequence_multilayer(), IMB_allocImBuf(), ImBuf::index, LOCK_IMAGE, LOCK_VIEWER, Image::name, NULL, Image::ok, ImageUser::ok, Image::source, tag_image_time(), and Image::type.
Referenced by BKE_image_get_ibuf(), BKE_image_has_alpha(), draw_nodespace_back_pix(), ED_image_size(), ED_space_image_acquire_buffer(), image_rect_update(), node_composit_exec_splitviewer(), node_composit_exec_viewer(), sample_apply(), screen_opengl_render_anim_step(), screen_opengl_render_apply(), snode_bg_viewmove_invoke(), and uiTemplateImage().
RenderResult* BKE_image_acquire_renderresult | ( | Scene * | scene, |
Image * | ima | ||
) | [read] |
Definition at line 1845 of file image.c.
References Scene::id, IMA_TYPE_R_RESULT, Image::last_render_slot, ID::name, NULL, RE_AcquireResultRead(), RE_GetRender(), Image::render_slot, Image::renders, Image::rr, and Image::type.
Referenced by draw_render_info(), save_image_doit(), and uiTemplateImageLayers().
void BKE_image_all_free_anim_ibufs | ( | int | cfra | ) |
Definition at line 795 of file image.c.
References BKE_image_free_anim_ibufs(), ELEM, G, Image::id, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, ID::next, and Image::source.
Referenced by do_render_all_options(), and image_record_composite_apply().
Definition at line 1723 of file image.c.
References IMA_NO_INDEX, and image_assign_ibuf().
Definition at line 1869 of file image.c.
References Scene::id, Image::last_render_slot, ID::name, NULL, RE_FreeRenderResult(), RE_GetRender(), RE_SwapResult(), Image::render_slot, and Image::renders.
Referenced by screen_opengl_render_init(), screen_render_exec(), and screen_render_invoke().
void BKE_image_free_all_textures | ( | void | ) |
Definition at line 737 of file image.c.
References ListBase::first, ID::flag, G, IB_BITMAPDIRTY, Image::ibufs, Tex::id, Image::id, Tex::ima, image_free_buffers(), LIB_DOIT, ImBuf::next, ID::next, NULL, and ImBuf::userflags.
Referenced by RE_Database_Free().
void BKE_image_free_anim_ibufs | ( | Image * | ima, |
int | except_frame | ||
) |
Definition at line 773 of file image.c.
References BLI_remlink(), ListBase::first, IB_BITMAPDIRTY, Image::ibufs, IMA_INDEX_FRAME, IMA_NO_INDEX, IMB_freeImBuf(), ImBuf::index, MEM_freeN(), ImBuf::next, NULL, ImBuf::userdata, and ImBuf::userflags.
Referenced by BKE_image_all_free_anim_ibufs(), and load_frame_image_sequence().
Definition at line 2521 of file image.c.
References BKE_image_acquire_ibuf(), and NULL.
Referenced by apply_heights_callback(), apply_heights_data(), apply_tangmat_callback(), bake_images(), brush_gen_texture_cache(), clear_images(), colorfn(), compatible_bump_compute(), do_halo_tex(), do_lamp_tex(), do_material_tex(), do_multires_bake(), do_sky_tex(), draw_bgpic(), draw_empty_image(), draw_mesh_text(), envmaptex(), finish_bake_internal(), finish_images(), get_alpha_clone_image(), get_next_bake_face(), gpu_make_repbind(), GPU_paint_update_image(), GPU_verify_image(), icon_preview_startjob(), image_aspect(), image_de_interlace(), image_invert_exec(), image_invert_poll(), image_pack_exec(), image_pack_invoke(), image_record_composite_apply(), image_sample(), image_undo_restore(), imagewrap(), imagewraposa(), imagewraposa_aniso(), imapaint_canvas_set(), imapaint_paint_stroke(), imapaint_paint_sub_stroke(), init_heights_data(), BL_Texture::InitCubeMap(), BL_Texture::InitFromImage(), load_frame_image_sequence(), multiresbake_check(), multitex_nodes(), node_composit_exec_image(), node_composit_get_image(), node_composit_get_zimage(), ntap_bump_compute(), pack_all_invoke(), project_paint_begin(), project_paint_uvpixel_init(), project_paint_uvpixel_mask(), RE_bake_shade_all_selected(), shade_tface(), BL_Texture::SplitEnvMap(), and texture_paint_camera_project_exec().
int BKE_image_has_alpha | ( | struct Image * | image | ) |
Definition at line 2580 of file image.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), NULL, and ImBuf::planes.
Referenced by BL_ConvertMesh(), ConvertMaterial(), set_draw_settings_cached(), and set_facetexture_flags().
void BKE_image_memorypack | ( | Image * | ima | ) |
Definition at line 596 of file image.c.
References PackedFile::data, ImBuf::encodedbuffer, ImBuf::encodedsize, freePackedFile(), ImBuf::ftype, IB_BITMAPDIRTY, IB_mem, IB_rect, IMA_NO_INDEX, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_TYPE_IMAGE, image_get_ibuf(), IMB_saveiff(), MEM_callocN(), ImBuf::name, NULL, Image::packedfile, pf, ImBuf::planes, PNG, R_IMF_PLANES_RGBA, PackedFile::size, Image::source, Image::type, and ImBuf::userflags.
Referenced by image_pack_exec().
Definition at line 451 of file image.c.
References BLI_remlink(), ListBase::first, free_libblock(), G, Image::ibufs, IMA_INDEX_FRAME, IMA_INDEX_PASS, image_assign_ibuf(), and ImBuf::index.
Referenced by local_merge().
RenderPass* BKE_image_multilayer_index | ( | RenderResult * | rr, |
ImageUser * | iuser | ||
) | [read] |
Definition at line 1811 of file image.c.
References ListBase::first, ImBuf::index, ImageUser::layer, RenderResult::layers, ImageUser::multi_index, RenderPass::next, RenderLayer::next, NULL, ImageUser::pass, and RenderLayer::passes.
Referenced by compbuf_multilayer_get(), image_get_ibuf_multilayer(), image_load_sequence_multilayer(), image_multi_cb(), image_multi_declay_cb(), image_multi_decpass_cb(), image_multi_inclay_cb(), and image_multi_incpass_cb().
void BKE_image_print_memlist | ( | void | ) |
Definition at line 719 of file image.c.
References G, Image::id, image_mem_size(), ID::name, ID::next, and size().
Referenced by RE_Database_Free().
void BKE_image_release_ibuf | ( | Image * | ima, |
void * | lock | ||
) |
Definition at line 2508 of file image.c.
References BLI_unlock_thread(), LOCK_VIEWER, and RE_ReleaseResultImage().
Referenced by BKE_image_has_alpha(), draw_nodespace_back_pix(), ED_image_size(), ED_space_image_release_buffer(), image_rect_update(), node_composit_exec_splitviewer(), node_composit_exec_viewer(), sample_apply(), screen_opengl_render_anim_step(), screen_opengl_render_apply(), snode_bg_viewmove_invoke(), and uiTemplateImage().
Definition at line 1860 of file image.c.
References Scene::id, IMA_TYPE_R_RESULT, Image::last_render_slot, ID::name, RE_GetRender(), RE_ReleaseResult(), Image::render_slot, Image::rr, and Image::type.
Referenced by draw_render_info(), save_image_doit(), and uiTemplateImageLayers().
Definition at line 1728 of file image.c.
References freePackedFile(), G, Image::gen_x, Image::gen_y, Scene::id, Image::id, ID_BLEND_PATH, IMA_NO_INDEX, 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_TYPE_IMAGE, IMA_TYPE_MULTILAYER, IMA_TYPE_UV_TEST, image_free_buffers(), image_get_ibuf(), ImageUser::layer, ImageUser::multi_index, Image::name, newPackedFile(), ID::next, Scene::nodetree, nodeUpdateID(), NULL, Image::ok, ImageUser::ok, Image::packedfile, ImageUser::pass, pf, Image::source, Image::type, ImBuf::x, and ImBuf::y.
Referenced by ED_space_image_set(), image_new_exec(), image_open_exec(), image_reload_exec(), image_replace_exec(), node_composit_exec_composite(), screen_opengl_render_init(), screen_render_exec(), screen_render_invoke(), and unpackImage().
void BKE_image_user_calc_frame | ( | ImageUser * | iuser, |
int | cfra, | ||
int | fieldnr | ||
) |
Definition at line 2567 of file image.c.
References BKE_image_user_get_frame(), ImageUser::flag, ImageUser::framenr, IMA_ANIM_ALWAYS, IMA_ANIM_REFRESHED, and ImageUser::ok.
Referenced by draw_bgpic(), ED_image_update_frame(), image_refresh(), init_render_texture(), node_composit_exec_image(), node_composit_exec_splitviewer(), node_composit_exec_viewer(), RE_init_sample_material(), set_frames_cb(), and space_view3d_listener().
int BKE_image_user_get_frame | ( | const ImageUser * | iuser, |
int | cfra, | ||
int | fieldnr | ||
) |
Definition at line 2527 of file image.c.
References ImageUser::cycl, ImageUser::fie_ima, ImageUser::frames, len(), ImageUser::offset, and ImageUser::sfra.
Image* BKE_image_verify_viewer | ( | int | type, |
const char * | name | ||
) | [read] |
Definition at line 1704 of file image.c.
References G, Image::id, id_us_plus(), IMA_SRC_VIEWER, image_alloc(), ID::next, NULL, Image::source, Image::type, and ID::us.
Referenced by draw_nodespace_back_pix(), ED_node_set_active(), node_composit_exec_composite(), render_view_open(), sample_apply(), screen_opengl_render_init(), screen_render_exec(), screen_render_invoke(), and snode_bg_viewmove_invoke().
char BKE_imtype_from_arg | ( | const char * | imtype_arg | ) |
Definition at line 997 of file image.c.
References R_IMF_IMTYPE_AVICODEC, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_BMP, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_FRAMESERVER, R_IMF_IMTYPE_INVALID, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_IRIZ, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_QUICKTIME, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_RAWTGA, R_IMF_IMTYPE_TARGA, and R_IMF_IMTYPE_TIFF.
Referenced by set_image_type().
int BKE_imtype_is_movie | ( | const char | imtype | ) |
Definition at line 890 of file image.c.
References R_IMF_IMTYPE_AVICODEC, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_FRAMESERVER, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_QUICKTIME, R_IMF_IMTYPE_THEORA, and R_IMF_IMTYPE_XVID.
Referenced by do_write_image_or_movie(), node_composit_init_output_file(), RE_BlenderAnim(), RE_BlenderFrame(), RE_InitState(), screen_opengl_render_anim_initialize(), screen_opengl_render_anim_step(), screen_opengl_render_end(), screen_opengl_render_init(), screen_render_exec(), screen_render_invoke(), and screenshot_startjob().
int BKE_imtype_supports_compress | ( | const char | imtype | ) |
Definition at line 917 of file image.c.
References R_IMF_IMTYPE_PNG.
Referenced by uiTemplateImageSettings().
int BKE_imtype_supports_quality | ( | const char | imtype | ) |
Definition at line 926 of file image.c.
References R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JP2, and R_IMF_IMTYPE_JPEG90.
Referenced by uiTemplateImageSettings().
int BKE_imtype_supports_zbuf | ( | const char | imtype | ) |
Definition at line 907 of file image.c.
References R_IMF_IMTYPE_IRIZ, and R_IMF_IMTYPE_OPENEXR.
Referenced by uiTemplateImageSettings().
int BKE_imtype_to_ftype | ( | const char | imtype | ) |
Definition at line 807 of file image.c.
References BMP, IMAGIC, JPG, OPENEXR, PNG, R_IMF_IMTYPE_BMP, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_RAWTGA, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_TIFF, RAWTGA, and TGA.
char BKE_imtype_valid_channels | ( | const char | imtype | ) |
Definition at line 937 of file image.c.
References IMA_CHAN_FLAG_ALPHA, IMA_CHAN_FLAG_BW, IMA_CHAN_FLAG_RGB, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_QUICKTIME, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_RAWTGA, R_IMF_IMTYPE_TARGA, and R_IMF_IMTYPE_TIFF.
char BKE_imtype_valid_depths | ( | const char | imtype | ) |
Definition at line 971 of file image.c.
References R_IMF_CHAN_DEPTH_12, R_IMF_CHAN_DEPTH_16, R_IMF_CHAN_DEPTH_32, R_IMF_CHAN_DEPTH_8, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_RADHDR, and R_IMF_IMTYPE_TIFF.
Referenced by imtype_best_depth(), render_result_rect_to_ibuf(), and uiTemplateImageSettings().
void BKE_makepicstring | ( | char * | string, |
const char * | base, | ||
const char * | relbase, | ||
int | frame, | ||
const char | imtype, | ||
const short | use_ext, | ||
const short | use_frames | ||
) |
Definition at line 1643 of file image.c.
References BKE_add_image_extension(), BLI_path_abs(), BLI_path_frame(), BLI_strncpy(), FILE_MAX, and NULL.
Referenced by do_write_image_or_movie(), node_composit_exec_output_file(), RE_BlenderAnim(), RE_BlenderFrame(), screen_opengl_render_anim_step(), screen_opengl_render_apply(), and screenshot_startjob().
void BKE_stamp_buf | ( | Scene * | scene, |
Object * | camera, | ||
unsigned char * | rect, | ||
float * | rectf, | ||
int | width, | ||
int | height, | ||
int | channels | ||
) |
Definition at line 1266 of file image.c.
References RenderData::bg_stamp, BLF_buffer(), BLF_buffer_col(), BLF_descender(), BLF_draw_buffer(), BLF_height_max(), blf_mono_font_render, BLF_position(), BLF_size(), BLF_width_and_height(), BLF_width_max(), buf_rectfill_area(), BUFF_MARGIN_X, BUFF_MARGIN_Y, StampData::camera, StampData::cameralens, StampData::date, RenderData::fg_stamp, StampData::file, StampData::frame, StampData::marker, mono, StampData::note, NULL, Scene::r, StampData::rendertime, StampData::scene, RenderData::stamp_font_id, stampdata(), StampData::strip, StampData::time, and simple_enum_gen::w.
Referenced by renderresult_stampinfo(), and screen_opengl_render_apply().
Definition at line 1461 of file image.c.
References StampData::camera, StampData::cameralens, StampData::date, StampData::file, StampData::frame, IMB_metadata_change_field(), StampData::marker, StampData::note, StampData::rendertime, StampData::scene, stampdata(), StampData::strip, and StampData::time.
Referenced by BKE_write_ibuf_stamp().
int BKE_write_ibuf | ( | ImBuf * | ibuf, |
const char * | name, | ||
ImageFormatData * | imf | ||
) |
Definition at line 1508 of file image.c.
References BLI_make_existing_file(), BMP, ImageFormatData::compress, ImageFormatData::depth, ELEM5, ImageFormatData::exr_codec, ImageFormatData::flag, ImBuf::ftype, IB_rect, IB_zbuf, IB_zbuffloat, IMAGIC, IMB_saveiff(), ImageFormatData::imtype, ImageFormatData::jp2_flag, JPG, NULL, OPENEXR, OPENEXR_COMPRESS, OPENEXR_HALF, PNG, ImageFormatData::quality, R_IMF_CHAN_DEPTH_12, R_IMF_CHAN_DEPTH_16, R_IMF_FLAG_ZBUF, R_IMF_IMTYPE_BMP, R_IMF_IMTYPE_CINEON, R_IMF_IMTYPE_DDS, R_IMF_IMTYPE_DPX, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_IRIS, R_IMF_IMTYPE_JP2, R_IMF_IMTYPE_MULTILAYER, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_RAWTGA, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_TIFF, R_IMF_IMTYPE_XVID, R_IMF_JP2_FLAG_CINE_48, R_IMF_JP2_FLAG_CINE_PRESET, R_IMF_JP2_FLAG_YCC, RAWTGA, TGA, and ImBuf::zbuf_float.
Referenced by BKE_write_ibuf_as(), BKE_write_ibuf_stamp(), node_composit_exec_output_file(), RE_WriteEnvmapResult(), screenshot_exec(), and screenshot_startjob().
int BKE_write_ibuf_as | ( | ImBuf * | ibuf, |
const char * | name, | ||
ImageFormatData * | imf, | ||
const short | save_copy | ||
) |
Definition at line 1613 of file image.c.
References BKE_write_ibuf(), ImBuf::ftype, ImageFormatData::planes, and ImBuf::planes.
Referenced by save_image_doit(), and screen_opengl_render_apply().
int BKE_write_ibuf_stamp | ( | Scene * | scene, |
struct Object * | camera, | ||
ImBuf * | ibuf, | ||
const char * | name, | ||
struct ImageFormatData * | imf | ||
) |
Definition at line 1634 of file image.c.
References BKE_stamp_info(), BKE_write_ibuf(), Scene::r, R_STAMP_ALL, and RenderData::stamp.
Referenced by do_write_image_or_movie(), and screen_opengl_render_anim_step().
Definition at line 303 of file image.c.
References Image::animspeed, Image::aspx, Image::aspy, BLI_strncpy(), Image::flag, Image::gen_type, Image::gen_x, Image::gen_y, Image::id, image_alloc(), Image::name, ID::name, Image::source, Image::tpageflag, and Image::type.
Referenced by id_copy(), localize(), and make_local_image().
static void de_interlace_ng | ( | struct ImBuf * | ibuf | ) | [static] |
Definition at line 104 of file image.c.
References ImBuf::flags, IB_fields, IB_rect, IMB_allocImBuf(), IMB_freeImBuf(), IMB_rectcpy(), NULL, ImBuf::rect, ImBuf::x, and ImBuf::y.
Referenced by image_de_interlace(), and image_initialize_after_load().
static void de_interlace_st | ( | struct ImBuf * | ibuf | ) | [static] |
Definition at line 132 of file image.c.
References ImBuf::flags, IB_fields, IB_rect, IMB_allocImBuf(), IMB_freeImBuf(), IMB_rectcpy(), NULL, ImBuf::rect, ImBuf::x, and ImBuf::y.
Referenced by image_de_interlace(), and image_initialize_after_load().
static void extern_local_image | ( | Image * | UNUSEDima | ) | [static] |
Definition at line 324 of file image.c.
Referenced by make_local_image().
void free_image | ( | Image * | ima | ) |
Definition at line 201 of file image.c.
References BKE_icon_delete(), BKE_previewimg_free(), freePackedFile(), ID::icon_id, Image::id, IMA_MAX_RENDER_SLOT, image_free_buffers(), NULL, Image::packedfile, Image::preview, RE_FreeRenderResult(), and Image::renders.
Referenced by free_libblock().
void free_old_images | ( | void | ) |
Definition at line 652 of file image.c.
References Image::bindcode, ListBase::first, Image::flag, G, GPU_free_image(), Image::ibufs, Image::id, IMA_NOCOLLECT, image_free_buffers(), Image::lastused, ID::next, PIL_check_seconds_timer(), Image::repbind, UserDef::texcollectrate, UserDef::textimeout, and U.
Referenced by draw_object().
static Image* image_alloc | ( | const char * | name, |
short | source, | ||
short | type | ||
) | [static] |
Definition at line 224 of file image.c.
References alloc_libblock(), Image::aspx, Image::aspy, G, Image::gen_type, Image::gen_x, Image::gen_y, ID_IM, IMA_OK, Image::ok, Image::source, Image::type, Image::xrep, and Image::yrep.
Referenced by BKE_add_image_file(), BKE_add_image_imbuf(), BKE_add_image_size(), BKE_image_verify_viewer(), and copy_image().
Definition at line 274 of file image.c.
References BLI_insertlinkbefore(), ListBase::first, Image::flag, ImBuf::flags, IB_cm_predivide, Image::ibufs, IMA_CM_PREDIVIDE, IMA_MAKE_INDEX, IMA_NO_INDEX, image_remove_ibuf(), ImBuf::index, link(), and ImBuf::next.
Referenced by BKE_add_image_imbuf(), BKE_add_image_size(), BKE_image_acquire_ibuf(), BKE_image_assign_ibuf(), BKE_image_merge(), image_get_ibuf_multilayer(), image_get_render_result(), image_load_image_file(), image_load_movie_file(), image_load_sequence_file(), and image_load_sequence_multilayer().
Definition at line 1891 of file image.c.
References RenderResult::framenr, IMB_exr_close(), NULL, RE_MultilayerConvert(), Image::rr, ImBuf::userdata, ImBuf::x, and ImBuf::y.
Referenced by image_load_image_file(), and image_load_sequence_file().
void image_de_interlace | ( | Image * | ima, |
int | odd | ||
) |
Definition at line 160 of file image.c.
References BKE_image_get_ibuf(), de_interlace_ng(), de_interlace_st(), and NULL.
static void image_free_buffers | ( | Image * | ima | ) | [static] |
Definition at line 173 of file image.c.
References Image::anim, BLI_remlink(), ListBase::first, GPU_free_image(), Image::ibufs, IMA_OK, IMB_free_anim(), IMB_freeImBuf(), MEM_freeN(), NULL, Image::ok, RE_FreeRenderResult(), Image::rr, and ImBuf::userdata.
Referenced by BKE_image_free_all_textures(), BKE_image_signal(), free_image(), free_old_images(), and image_load_image_file().
Definition at line 244 of file image.c.
References ListBase::first, Image::ibufs, IMA_MAKE_INDEX, IMA_NO_INDEX, ImBuf::index, ImBuf::next, and NULL.
Referenced by BKE_image_acquire_ibuf(), BKE_image_memorypack(), BKE_image_signal(), image_get_ibuf_threadsafe(), and image_get_render_result().
Definition at line 2153 of file image.c.
References BKE_image_multilayer_index(), ImBuf::channels, RenderPass::channels, ImBuf::flags, IB_PROFILE_LINEAR_RGB, IB_rectfloat, IMA_NO_INDEX, IMA_TYPE_IMAGE, image_assign_ibuf(), image_initialize_after_load(), image_load_image_file(), IMB_allocImBuf(), ImageUser::multi_index, NULL, Image::ok, ImageUser::ok, ImBuf::profile, RenderPass::rect, ImBuf::rect_float, RenderResult::rectx, RenderResult::recty, Image::rr, and Image::type.
Referenced by BKE_image_acquire_ibuf().
static ImBuf* image_get_ibuf_threadsafe | ( | Image * | ima, |
ImageUser * | iuser, | ||
int * | frame_r, | ||
int * | index_r | ||
) | [static] |
Definition at line 2328 of file image.c.
References ImageUser::framenr, IMA_NO_INDEX, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, IMA_SRC_VIEWER, IMA_TPAGE_REFRESH, IMA_TYPE_IMAGE, IMA_TYPE_MULTILAYER, image_get_ibuf(), ImBuf::index, Image::lastframe, ImageUser::multi_index, NULL, Image::source, Image::tpageflag, and Image::type.
Referenced by BKE_image_acquire_ibuf().
Definition at line 2193 of file image.c.
References BLI_findlink(), BLI_lock_thread(), ImBuf::channels, RenderPass::channels, RenderData::color_mgt_flag, ImBuf::dither, RenderData::dither_intensity, ListBase::first, Image::flag, ImBuf::flags, RenderResult::have_combined, IB_cm_predivide, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_rectfloat, IB_zbuffloat, Scene::id, IMA_CM_PREDIVIDE, IMA_NO_INDEX, IMA_OK_LOADED, image_assign_ibuf(), image_get_ibuf(), IMB_allocImBuf(), imb_freerectImBuf(), Image::last_render_slot, ImageUser::layer, RenderResult::layers, LOCK_VIEWER, ID::name, RenderPass::next, NULL, Image::ok, ImageUser::pass, RenderLayer::passes, RenderPass::passtype, ImBuf::profile, Scene::r, R_COLOR_MANAGEMENT, R_COLOR_MANAGEMENT_PREDIVIDE, RE_AcquireResultImage(), RE_GetRender(), RE_ReleaseResultImage(), ImBuf::rect, RenderPass::rect, RenderResult::rect32, ImBuf::rect_float, RenderLayer::rectf, RenderResult::rectf, RenderResult::rectx, RenderResult::recty, RenderResult::rectz, Image::render_slot, Image::renders, SCE_PASS_Z, ImageUser::scene, ImBuf::x, ImBuf::y, and ImBuf::zbuf_float.
Referenced by BKE_image_acquire_ibuf().
Definition at line 1906 of file image.c.
References BKE_icon_changed(), BKE_icon_getid(), de_interlace_ng(), de_interlace_st(), Image::flag, G, Image::id, IMA_FIELDS, IMA_OK_LOADED, IMA_STD_FIELD, Image::lastused, NULL, Image::ok, and Image::preview.
Referenced by image_get_ibuf_multilayer(), image_load_image_file(), image_load_movie_file(), image_load_sequence_file(), and image_load_sequence_multilayer().
Definition at line 2092 of file image.c.
References BLI_path_abs(), BLI_strncpy(), PackedFile::data, detectBitmapFont(), FILE_MAX, Image::flag, ImBuf::ftype, G, G_AUTOPACK, IB_metadata, IB_multilayer, IB_premul, IB_rect, Image::id, ID_BLEND_PATH, IMA_DO_PREMUL, IMA_NO_INDEX, IMA_TYPE_MULTILAYER, image_assign_ibuf(), image_create_multilayer(), image_free_buffers(), image_initialize_after_load(), IMB_freeImBuf(), IMB_ibImageFromMemory(), IMB_loadiffname(), Image::name, newPackedFile(), NULL, Image::ok, ImageUser::ok, OPENEXR, Image::packedfile, PackedFile::size, str, Image::type, and ImBuf::userdata.
Referenced by BKE_image_acquire_ibuf(), and image_get_ibuf_multilayer().
Definition at line 2042 of file image.c.
References Image::anim, BLI_path_abs(), BLI_strncpy(), FILE_MAX, ImageUser::frames, G, IB_rect, Image::id, ID_BLEND_PATH, image_assign_ibuf(), image_initialize_after_load(), IMB_anim_absolute(), IMB_anim_get_duration(), IMB_makeSingleUser(), IMB_PROXY_NONE, IMB_TC_RECORD_RUN, Image::lastframe, Image::name, NULL, Image::ok, ImageUser::ok, openanim(), and str.
Referenced by BKE_image_acquire_ibuf().
Definition at line 1924 of file image.c.
References AT, BLI_path_abs(), BLI_stringdec(), BLI_stringenc(), BLI_strncpy(), FILE_MAX, Image::flag, ImBuf::ftype, G, IB_multilayer, IB_premul, IB_rect, Image::id, ID_BLEND_PATH, IMA_DO_PREMUL, IMA_TPAGE_REFRESH, IMA_TYPE_MULTILAYER, image_assign_ibuf(), image_create_multilayer(), image_initialize_after_load(), IMB_freeImBuf(), IMB_loadiffname(), Image::lastframe, ImBuf::name, Image::name, NULL, Image::ok, ImageUser::ok, OPENEXR, Image::tpageflag, Image::type, and ImBuf::userdata.
Referenced by BKE_image_acquire_ibuf(), and image_load_sequence_multilayer().
Definition at line 1984 of file image.c.
References BKE_image_multilayer_index(), ImBuf::channels, RenderPass::channels, ImBuf::flags, RenderResult::framenr, IB_PROFILE_LINEAR_RGB, IB_rectfloat, IMA_TYPE_IMAGE, image_assign_ibuf(), image_initialize_after_load(), image_load_sequence_file(), IMB_allocImBuf(), ImBuf::mall, MEM_dupallocN(), ImageUser::multi_index, NULL, Image::ok, ImageUser::ok, ImBuf::profile, RE_FreeRenderResult(), RenderPass::rect, ImBuf::rect_float, RenderResult::rectx, RenderResult::recty, Image::rr, and Image::type.
Referenced by BKE_image_acquire_ibuf().
static uintptr_t image_mem_size | ( | Image * | ima | ) | [static] |
Definition at line 691 of file image.c.
References ListBase::first, IB_MIPMAP_LEVELS, Image::ibufs, IMA_SRC_VIEWER, MEM_allocN_len(), ImBuf::mipmap, ImBuf::next, ImBuf::rect, ImBuf::rect_float, size(), and Image::source.
Referenced by BKE_image_print_memlist().
Definition at line 264 of file image.c.
References BLI_remlink(), Image::ibufs, and IMB_freeImBuf().
Referenced by image_assign_ibuf().
void make_local_image | ( | struct Image * | ima | ) |
Definition at line 330 of file image.c.
References BKE_id_lib_local_paths(), Main::brush, CD_MTFACE, Brush::clone, copy_image(), CustomDataLayer::data, extern_local_image(), FALSE, Mesh::fdata, ListBase::first, G, i, Mesh::id, Brush::id, Tex::id, Image::id, id_clear_lib_data(), id_lib_extern(), Tex::ima, BrushClone::image, CustomData::layers, ID::lib, Main::mesh, Mesh::mtface, ID::next, NULL, Main::tex, CustomData::totlayer, MTFace::tpage, TRUE, CustomDataLayer::type, and ID::us.
Referenced by id_make_local().
struct anim* openanim | ( | const char * | name, |
int | flags, | ||
int | streamindex | ||
) | [read] |
Definition at line 1658 of file image.c.
References BLI_exists(), IMB_anim_absolute(), IMB_free_anim(), IMB_freeImBuf(), IMB_open_anim(), IMB_PROXY_NONE, IMB_TC_NONE, and NULL.
Referenced by image_load_movie_file(), movieclip_load_movie_file(), reload_sequence_new_file(), seq_open_anim_file(), seq_proxy_fetch(), and sequencer_add_movie_strip().
static void stampdata | ( | Scene * | scene, |
Object * | camera, | ||
StampData * | stamp_data, | ||
int | do_prefix | ||
) | [static] |
Definition at line 1140 of file image.c.
References BLI_snprintf(), BLI_strncpy(), BLI_timestr(), StampData::camera, StampData::cameralens, RenderData::cfra, CFRA, Object::data, StampData::date, RenderData::efra, StampData::file, StampData::frame, RenderData::frs_sec, G, Scene::id, Object::id, RenderStats::lastframetime, StampData::marker, Sequence::name, ID::name, StampData::note, NULL, OB_CAMERA, Scene::r, R_STAMP_CAMERA, R_STAMP_CAMERALENS, R_STAMP_DATE, R_STAMP_FILENAME, R_STAMP_FRAME, R_STAMP_MARKER, R_STAMP_NOTE, R_STAMP_RENDERTIME, R_STAMP_SCENE, R_STAMP_SEQSTRIP, R_STAMP_TIME, RE_GetRender(), RE_GetStats(), StampData::rendertime, StampData::scene, scene_find_last_marker_name(), seq_foreground_frame_get(), RenderData::stamp, RenderData::stamp_udata, StampData::strip, StampData::time, and Object::type.
Referenced by BKE_stamp_buf(), and BKE_stamp_info().
void tag_image_time | ( | Image * | ima | ) |
Definition at line 631 of file image.c.
References Image::lastused, and PIL_check_seconds_timer().
Referenced by BKE_image_acquire_ibuf(), and multitex().