Blender V2.61 - r43446
|
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_camera_types.h"
#include "DNA_object_types.h"
#include "DNA_space_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_brush_types.h"
#include "PIL_time.h"
#include "BLI_math.h"
#include "BLI_threads.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_paint.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "BLF_api.h"
#include "ED_gpencil.h"
#include "ED_image.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "RE_pipeline.h"
#include "image_intern.h"
Go to the source code of this file.
Defines | |
#define | HEADER_HEIGHT 18 |
Functions | |
static void | image_verify_buffer_float (Image *ima, ImBuf *ibuf, int color_manage) |
static void | draw_render_info (Scene *scene, Image *ima, ARegion *ar) |
void | ED_image_draw_info (ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf) |
static void | draw_image_grid (ARegion *ar, float zoomx, float zoomy) |
static void | sima_draw_alpha_backdrop (float x1, float y1, float xsize, float ysize, float zoomx, float zoomy, unsigned char col1[3], unsigned char col2[3]) |
static void | sima_draw_alpha_pixels (float x1, float y1, int rectx, int recty, unsigned int *recti) |
static void | sima_draw_alpha_pixelsf (float x1, float y1, int rectx, int recty, float *rectf) |
static void | sima_draw_zbuf_pixels (float x1, float y1, int rectx, int recty, int *recti) |
static void | sima_draw_zbuffloat_pixels (Scene *scene, float x1, float y1, int rectx, int recty, float *rect_float) |
static void | draw_image_buffer (SpaceImage *sima, ARegion *ar, Scene *scene, Image *ima, ImBuf *ibuf, float fx, float fy, float zoomx, float zoomy) |
static unsigned int * | get_part_from_ibuf (ImBuf *ibuf, short startx, short starty, short endx, short endy) |
static void | draw_image_buffer_tiled (SpaceImage *sima, ARegion *ar, Scene *scene, Image *ima, ImBuf *ibuf, float fx, float fy, float zoomx, float zoomy) |
static void | draw_image_buffer_repeated (SpaceImage *sima, ARegion *ar, Scene *scene, Image *ima, ImBuf *ibuf, float zoomx, float zoomy) |
void | draw_image_grease_pencil (bContext *C, short onlyv2d) |
static unsigned char * | get_alpha_clone_image (Scene *scene, int *width, int *height) |
static void | draw_image_paint_helpers (ARegion *ar, Scene *scene, float zoomx, float zoomy) |
void | draw_image_main (SpaceImage *sima, ARegion *ar, Scene *scene) |
Definition in file image_draw.c.
#define HEADER_HEIGHT 18 |
Definition at line 77 of file image_draw.c.
static void draw_image_buffer | ( | SpaceImage * | sima, |
ARegion * | ar, | ||
Scene * | scene, | ||
Image * | ima, | ||
ImBuf * | ibuf, | ||
float | fx, | ||
float | fy, | ||
float | zoomx, | ||
float | zoomy | ||
) | [static] |
Definition at line 485 of file image_draw.c.
References ImBuf::channels, RenderData::color_mgt_flag, SpaceImage::flag, glaDrawPixelsSafe(), image_verify_buffer_float(), Scene::r, R_COLOR_MANAGEMENT, ImBuf::rect, ImBuf::rect_float, SI_SHOW_ALPHA, SI_SHOW_ZBUF, SI_USE_ALPHA, sima_draw_alpha_backdrop(), sima_draw_alpha_pixels(), sima_draw_alpha_pixelsf(), sima_draw_zbuf_pixels(), sima_draw_zbuffloat_pixels(), UI_view2d_to_region_no_clip(), ARegion::v2d, ImBuf::x, ImBuf::y, ImBuf::zbuf, and ImBuf::zbuf_float.
Referenced by draw_image_buffer_repeated(), and draw_image_main().
static void draw_image_buffer_repeated | ( | SpaceImage * | sima, |
ARegion * | ar, | ||
Scene * | scene, | ||
Image * | ima, | ||
ImBuf * | ibuf, | ||
float | zoomx, | ||
float | zoomy | ||
) | [static] |
Definition at line 598 of file image_draw.c.
References View2D::cur, draw_image_buffer(), draw_image_buffer_tiled(), IMA_TILES, PIL_check_seconds_timer(), Image::tpageflag, ARegion::v2d, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by draw_image_main().
static void draw_image_buffer_tiled | ( | SpaceImage * | sima, |
ARegion * | ar, | ||
Scene * | scene, | ||
Image * | ima, | ||
ImBuf * | ibuf, | ||
float | fx, | ||
float | fy, | ||
float | zoomx, | ||
float | zoomy | ||
) | [static] |
Definition at line 559 of file image_draw.c.
References RenderData::color_mgt_flag, SpaceImage::curtile, get_part_from_ibuf(), glaDrawPixelsSafe(), image_verify_buffer_float(), MEM_freeN(), Scene::r, R_COLOR_MANAGEMENT, UI_view2d_to_region_no_clip(), ARegion::v2d, ImBuf::x, Image::xrep, ImBuf::y, and Image::yrep.
Referenced by draw_image_buffer_repeated(), and draw_image_main().
void draw_image_grease_pencil | ( | bContext * | C, |
short | onlyv2d | ||
) |
Definition at line 627 of file image_draw.c.
References CTX_wm_space_data(), draw_gpencil_2dimage(), draw_gpencil_view2d(), ED_space_image_acquire_buffer(), and ED_space_image_release_buffer().
Referenced by image_main_area_draw().
static void draw_image_grid | ( | ARegion * | ar, |
float | zoomx, | ||
float | zoomy | ||
) | [static] |
Definition at line 319 of file image_draw.c.
References CLAMP(), floorf, TH_BACK, UI_ThemeColor(), UI_ThemeColorShade(), UI_view2d_to_region_no_clip(), and ARegion::v2d.
Referenced by draw_image_main().
void draw_image_main | ( | SpaceImage * | sima, |
ARegion * | ar, | ||
Scene * | scene | ||
) |
Definition at line 751 of file image_draw.c.
References RenderData::cfra, RenderData::disprect, draw_image_buffer(), draw_image_buffer_repeated(), draw_image_buffer_tiled(), draw_image_grid(), draw_image_paint_helpers(), draw_render_info(), ED_image_aspect(), ED_space_image(), ED_space_image_acquire_buffer(), ED_space_image_release_buffer(), ED_space_image_zoom(), SpaceImage::flag, G, IMA_SRC_VIEWER, IMA_TILES, IMA_TYPE_COMPOSITE, IMA_TYPE_R_RESULT, SpaceImage::image, SpaceImage::iuser, Scene::nodetree, ntree_get_active_iuser(), NULL, Scene::r, SI_DRAW_TILE, SI_DRAWTOOL, Image::source, Image::tpageflag, Image::type, rcti::xmin, and rcti::ymin.
Referenced by image_main_area_draw().
static void draw_image_paint_helpers | ( | ARegion * | ar, |
Scene * | scene, | ||
float | zoomx, | ||
float | zoomy | ||
) | [static] |
Definition at line 719 of file image_draw.c.
References Brush::clone, get_alpha_clone_image(), glaDrawPixelsSafe(), Brush::imagepaint_tool, ToolSettings::imapaint, MEM_freeN(), BrushClone::offset, ImagePaintSettings::paint, paint_brush(), PAINT_TOOL_CLONE, Scene::toolsettings, UI_view2d_to_region_no_clip(), ARegion::v2d, and simple_enum_gen::w.
Referenced by draw_image_main().
Definition at line 100 of file image_draw.c.
References BKE_image_acquire_renderresult(), BKE_image_release_renderresult(), ED_region_info_draw(), and RenderResult::text.
Referenced by draw_image_main().
void ED_image_draw_info | ( | ARegion * | ar, |
int | color_manage, | ||
int | channels, | ||
int | x, | ||
int | y, | ||
const char | cp[4], | ||
const float | fp[4], | ||
int * | zp, | ||
float * | zpf | ||
) |
Definition at line 114 of file image_draw.c.
References BLF_draw_ascii(), blf_mono_font, BLF_position(), BLF_size(), BLF_width(), BLI_snprintf(), copy_v3_v3(), copy_v4_v4(), linearrgb_to_srgb_v3_v3(), rgb_to_hsv(), rgb_to_yuv(), str, simple_enum_gen::val, ARegion::winrct, rcti::xmax, rcti::xmin, zero_v3(), and zero_v4().
Referenced by image_sample_draw(), and sample_draw().
static unsigned char* get_alpha_clone_image | ( | Scene * | scene, |
int * | width, | ||
int * | height | ||
) | [static] |
Definition at line 685 of file image_draw.c.
References BrushClone::alpha, BKE_image_get_ibuf(), Brush::clone, BrushClone::image, ToolSettings::imapaint, MEM_dupallocN(), NULL, ImagePaintSettings::paint, paint_brush(), ImBuf::rect, size(), Scene::toolsettings, ImBuf::x, and ImBuf::y.
Referenced by draw_image_paint_helpers().
static unsigned int* get_part_from_ibuf | ( | ImBuf * | ibuf, |
short | startx, | ||
short | starty, | ||
short | endx, | ||
short | endy | ||
) | [static] |
Definition at line 537 of file image_draw.c.
References len(), MEM_mallocN(), ImBuf::rect, and ImBuf::x.
Referenced by draw_image_buffer_tiled().
Definition at line 79 of file image_draw.c.
References IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_RECT_INVALID, IMA_SRC_VIEWER, IMB_rect_from_float(), NULL, ImBuf::profile, ImBuf::rect, ImBuf::rect_float, Image::source, and ImBuf::userflags.
Referenced by draw_image_buffer(), and draw_image_buffer_tiled().
static void sima_draw_alpha_backdrop | ( | float | x1, |
float | y1, | ||
float | xsize, | ||
float | ysize, | ||
float | zoomx, | ||
float | zoomy, | ||
unsigned char | col1[3], | ||
unsigned char | col2[3] | ||
) | [static] |
Definition at line 378 of file image_draw.c.
Referenced by draw_image_buffer().
static void sima_draw_alpha_pixels | ( | float | x1, |
float | y1, | ||
int | rectx, | ||
int | recty, | ||
unsigned int * | recti | ||
) | [static] |
Definition at line 402 of file image_draw.c.
References B_ENDIAN, ENDIAN_ORDER, and glaDrawPixelsSafe().
Referenced by draw_image_buffer().
static void sima_draw_alpha_pixelsf | ( | float | x1, |
float | y1, | ||
int | rectx, | ||
int | recty, | ||
float * | rectf | ||
) | [static] |
Definition at line 413 of file image_draw.c.
References glaDrawPixelsSafe(), MEM_freeN(), and MEM_mallocN().
Referenced by draw_image_buffer().
static void sima_draw_zbuf_pixels | ( | float | x1, |
float | y1, | ||
int | rectx, | ||
int | recty, | ||
int * | recti | ||
) | [static] |
Definition at line 433 of file image_draw.c.
References glaDrawPixelsSafe().
Referenced by draw_image_buffer().
static void sima_draw_zbuffloat_pixels | ( | Scene * | scene, |
float | x1, | ||
float | y1, | ||
int | rectx, | ||
int | recty, | ||
float * | rect_float | ||
) | [static] |
Definition at line 453 of file image_draw.c.
References Scene::camera, Object::data, glaDrawPixelsSafe(), MEM_freeN(), MEM_mallocN(), OB_CAMERA, and Object::type.
Referenced by draw_image_buffer().