WIP: Brush assets project #106303
|
@ -180,6 +180,7 @@ class AssetLibrary {
|
|||
Vector<AssetLibraryReference> all_valid_asset_library_refs();
|
||||
|
||||
AssetLibraryReference all_library_reference();
|
||||
void all_library_reload_catalogs_if_dirty();
|
||||
|
||||
} // namespace blender::asset_system
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ void AssetCatalogService::prune_catalogs_by_path(const AssetCatalogPath &path)
|
|||
}
|
||||
|
||||
this->rebuild_tree();
|
||||
AssetLibraryService::get()->rebuild_all_library();
|
||||
AssetLibraryService::get()->tag_all_library_catalogs_dirty();
|
||||
}
|
||||
|
||||
void AssetCatalogService::prune_catalogs_by_id(const CatalogID catalog_id)
|
||||
|
@ -273,7 +273,7 @@ void AssetCatalogService::update_catalog_path(const CatalogID catalog_id,
|
|||
}
|
||||
|
||||
this->rebuild_tree();
|
||||
AssetLibraryService::get()->rebuild_all_library();
|
||||
AssetLibraryService::get()->tag_all_library_catalogs_dirty();
|
||||
}
|
||||
|
||||
AssetCatalog *AssetCatalogService::create_catalog(const AssetCatalogPath &catalog_path)
|
||||
|
@ -299,8 +299,7 @@ AssetCatalog *AssetCatalogService::create_catalog(const AssetCatalogPath &catalo
|
|||
|
||||
BLI_assert_msg(catalog_tree_, "An Asset Catalog tree should always exist.");
|
||||
catalog_tree_->insert_item(*catalog_ptr);
|
||||
|
||||
AssetLibraryService::get()->rebuild_all_library();
|
||||
AssetLibraryService::get()->tag_all_library_catalogs_dirty();
|
||||
|
||||
return catalog_ptr;
|
||||
}
|
||||
|
@ -655,7 +654,7 @@ void AssetCatalogService::undo()
|
|||
redo_snapshots_.append(std::move(catalog_collection_));
|
||||
catalog_collection_ = undo_snapshots_.pop_last();
|
||||
this->rebuild_tree();
|
||||
AssetLibraryService::get()->rebuild_all_library();
|
||||
AssetLibraryService::get()->tag_all_library_catalogs_dirty();
|
||||
}
|
||||
|
||||
void AssetCatalogService::redo()
|
||||
|
@ -666,7 +665,7 @@ void AssetCatalogService::redo()
|
|||
undo_snapshots_.append(std::move(catalog_collection_));
|
||||
catalog_collection_ = redo_snapshots_.pop_last();
|
||||
this->rebuild_tree();
|
||||
AssetLibraryService::get()->rebuild_all_library();
|
||||
AssetLibraryService::get()->tag_all_library_catalogs_dirty();
|
||||
}
|
||||
|
||||
void AssetCatalogService::undo_push()
|
||||
|
|
|
@ -340,4 +340,10 @@ AssetLibraryReference all_library_reference()
|
|||
return all_library_ref;
|
||||
}
|
||||
|
||||
void all_library_reload_catalogs_if_dirty()
|
||||
{
|
||||
AssetLibraryService *service = AssetLibraryService::get();
|
||||
service->reload_all_library_catalogs_if_dirty();
|
||||
}
|
||||
|
||||
} // namespace blender::asset_system
|
||||
|
|
|
@ -57,7 +57,19 @@ void AllAssetLibrary::rebuild_catalogs_from_nested(const bool reload_nested_cata
|
|||
false);
|
||||
|
||||
new_catalog_service->rebuild_tree();
|
||||
|
||||
this->catalog_service = std::move(new_catalog_service);
|
||||
catalogs_dirty_ = false;
|
||||
}
|
||||
|
||||
void AllAssetLibrary::tag_catalogs_dirty()
|
||||
{
|
||||
catalogs_dirty_ = true;
|
||||
}
|
||||
|
||||
bool AllAssetLibrary::is_catalogs_dirty()
|
||||
{
|
||||
return catalogs_dirty_;
|
||||
}
|
||||
|
||||
void AllAssetLibrary::refresh_catalogs()
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
namespace blender::asset_system {
|
||||
|
||||
class AllAssetLibrary : public AssetLibrary {
|
||||
bool catalogs_dirty_ = true;
|
||||
|
||||
public:
|
||||
AllAssetLibrary();
|
||||
|
||||
|
@ -26,6 +28,9 @@ class AllAssetLibrary : public AssetLibrary {
|
|||
* merge them into the in-memory representations.
|
||||
*/
|
||||
void rebuild_catalogs_from_nested(bool reload_nested_catalogs);
|
||||
|
||||
void tag_catalogs_dirty();
|
||||
bool is_catalogs_dirty();
|
||||
};
|
||||
|
||||
} // namespace blender::asset_system
|
||||
|
|
|
@ -187,10 +187,17 @@ AssetLibrary *AssetLibraryService::get_asset_library_current_file()
|
|||
return lib;
|
||||
}
|
||||
|
||||
void AssetLibraryService::rebuild_all_library()
|
||||
void AssetLibraryService::tag_all_library_catalogs_dirty()
|
||||
{
|
||||
if (all_library_) {
|
||||
all_library_->rebuild_catalogs_from_nested(false);
|
||||
all_library_->tag_catalogs_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
void AssetLibraryService::reload_all_library_catalogs_if_dirty()
|
||||
{
|
||||
if (all_library_ && all_library_->is_catalogs_dirty()) {
|
||||
all_library_->refresh_catalogs();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,13 @@ class AssetLibraryService {
|
|||
AssetLibrary *get_asset_library_current_file();
|
||||
/** Get the "All" asset library, which loads all others and merges them into one. */
|
||||
AssetLibrary *get_asset_library_all(const Main *bmain);
|
||||
void rebuild_all_library();
|
||||
/**
|
||||
* Tag the "All" asset library as needing to reload catalogs. This should be called when catalog
|
||||
* data of other asset libraries changes. Note that changes to the catalog definition file on
|
||||
* disk don't ever affect this "dirty" flag. It only reflects changes from this Blender session.
|
||||
*/
|
||||
void tag_all_library_catalogs_dirty();
|
||||
void reload_all_library_catalogs_if_dirty();
|
||||
|
||||
/**
|
||||
* Return the start position of the last blend-file extension in given path,
|
||||
|
|
|
@ -41,24 +41,24 @@ struct ReportList;
|
|||
struct Scene;
|
||||
struct SwsContext;
|
||||
|
||||
int BKE_ffmpeg_start(void *context_v,
|
||||
const Scene *scene,
|
||||
RenderData *rd,
|
||||
int rectx,
|
||||
int recty,
|
||||
ReportList *reports,
|
||||
bool preview,
|
||||
const char *suffix);
|
||||
void BKE_ffmpeg_end(void *context_v);
|
||||
int BKE_ffmpeg_append(void *context_v,
|
||||
struct ImBuf;
|
||||
|
||||
bool BKE_ffmpeg_start(void *context_v,
|
||||
const Scene *scene,
|
||||
RenderData *rd,
|
||||
int start_frame,
|
||||
int frame,
|
||||
int *pixels,
|
||||
int rectx,
|
||||
int recty,
|
||||
const char *suffix,
|
||||
ReportList *reports);
|
||||
ReportList *reports,
|
||||
bool preview,
|
||||
const char *suffix);
|
||||
void BKE_ffmpeg_end(void *context_v);
|
||||
bool BKE_ffmpeg_append(void *context_v,
|
||||
RenderData *rd,
|
||||
int start_frame,
|
||||
int frame,
|
||||
const ImBuf *image,
|
||||
const char *suffix,
|
||||
ReportList *reports);
|
||||
void BKE_ffmpeg_filepath_get(char filepath[/*FILE_MAX*/ 1024],
|
||||
const RenderData *rd,
|
||||
bool preview,
|
||||
|
|
|
@ -10,28 +10,27 @@
|
|||
|
||||
/* generic blender movie support, could move to own module */
|
||||
|
||||
struct ImBuf;
|
||||
struct RenderData;
|
||||
struct ReportList;
|
||||
struct Scene;
|
||||
|
||||
struct bMovieHandle {
|
||||
int (*start_movie)(void *context_v,
|
||||
const Scene *scene,
|
||||
RenderData *rd,
|
||||
int rectx,
|
||||
int recty,
|
||||
ReportList *reports,
|
||||
bool preview,
|
||||
const char *suffix);
|
||||
int (*append_movie)(void *context_v,
|
||||
bool (*start_movie)(void *context_v,
|
||||
const Scene *scene,
|
||||
RenderData *rd,
|
||||
int start_frame,
|
||||
int frame,
|
||||
int *pixels,
|
||||
int rectx,
|
||||
int recty,
|
||||
const char *suffix,
|
||||
ReportList *reports);
|
||||
ReportList *reports,
|
||||
bool preview,
|
||||
const char *suffix);
|
||||
bool (*append_movie)(void *context_v,
|
||||
RenderData *rd,
|
||||
int start_frame,
|
||||
int frame,
|
||||
const ImBuf *image,
|
||||
const char *suffix,
|
||||
ReportList *reports);
|
||||
void (*end_movie)(void *context_v);
|
||||
|
||||
/* Optional function. */
|
||||
|
|
|
@ -338,7 +338,7 @@ static const char **get_file_extensions(int format)
|
|||
}
|
||||
|
||||
/* Write a frame to the output file */
|
||||
static int write_video_frame(FFMpegContext *context, AVFrame *frame, ReportList *reports)
|
||||
static bool write_video_frame(FFMpegContext *context, AVFrame *frame, ReportList *reports)
|
||||
{
|
||||
int ret, success = 1;
|
||||
AVPacket *packet = av_packet_alloc();
|
||||
|
@ -394,8 +394,14 @@ static int write_video_frame(FFMpegContext *context, AVFrame *frame, ReportList
|
|||
}
|
||||
|
||||
/* read and encode a frame of video from the buffer */
|
||||
static AVFrame *generate_video_frame(FFMpegContext *context, const uint8_t *pixels)
|
||||
static AVFrame *generate_video_frame(FFMpegContext *context, const ImBuf *image)
|
||||
{
|
||||
/* For now only 8-bit/channel images are supported. */
|
||||
const uint8_t *pixels = image->byte_buffer.data;
|
||||
if (pixels == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AVCodecParameters *codec = context->video_stream->codecpar;
|
||||
int height = codec->height;
|
||||
AVFrame *rgb_frame;
|
||||
|
@ -1273,12 +1279,12 @@ static void ffmpeg_add_metadata_callback(void *data,
|
|||
av_dict_set(metadata, propname, propvalue, 0);
|
||||
}
|
||||
|
||||
static int start_ffmpeg_impl(FFMpegContext *context,
|
||||
RenderData *rd,
|
||||
int rectx,
|
||||
int recty,
|
||||
const char *suffix,
|
||||
ReportList *reports)
|
||||
static bool start_ffmpeg_impl(FFMpegContext *context,
|
||||
RenderData *rd,
|
||||
int rectx,
|
||||
int recty,
|
||||
const char *suffix,
|
||||
ReportList *reports)
|
||||
{
|
||||
/* Handle to the output file */
|
||||
AVFormatContext *of;
|
||||
|
@ -1324,19 +1330,19 @@ static int start_ffmpeg_impl(FFMpegContext *context,
|
|||
exts = get_file_extensions(context->ffmpeg_type);
|
||||
if (!exts) {
|
||||
BKE_report(reports, RPT_ERROR, "No valid formats found");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
fmt = av_guess_format(nullptr, exts[0], nullptr);
|
||||
if (!fmt) {
|
||||
BKE_report(reports, RPT_ERROR, "No valid formats found");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
of = avformat_alloc_context();
|
||||
if (!of) {
|
||||
BKE_report(reports, RPT_ERROR, "Can't allocate FFmpeg format context");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
enum AVCodecID audio_codec = context->ffmpeg_audio_codec;
|
||||
|
@ -1469,7 +1475,7 @@ static int start_ffmpeg_impl(FFMpegContext *context,
|
|||
context->outfile = of;
|
||||
av_dump_format(of, 0, filepath, 1);
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
fail:
|
||||
if (of->pb) {
|
||||
|
@ -1485,7 +1491,7 @@ fail:
|
|||
}
|
||||
|
||||
avformat_free_context(of);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1626,23 +1632,22 @@ void BKE_ffmpeg_filepath_get(char filepath[/*FILE_MAX*/ 1024],
|
|||
ffmpeg_filepath_get(nullptr, filepath, rd, preview, suffix);
|
||||
}
|
||||
|
||||
int BKE_ffmpeg_start(void *context_v,
|
||||
const Scene *scene,
|
||||
RenderData *rd,
|
||||
int rectx,
|
||||
int recty,
|
||||
ReportList *reports,
|
||||
bool preview,
|
||||
const char *suffix)
|
||||
bool BKE_ffmpeg_start(void *context_v,
|
||||
const Scene *scene,
|
||||
RenderData *rd,
|
||||
int rectx,
|
||||
int recty,
|
||||
ReportList *reports,
|
||||
bool preview,
|
||||
const char *suffix)
|
||||
{
|
||||
int success;
|
||||
FFMpegContext *context = static_cast<FFMpegContext *>(context_v);
|
||||
|
||||
context->ffmpeg_autosplit_count = 0;
|
||||
context->ffmpeg_preview = preview;
|
||||
context->stamp_data = BKE_stamp_info_from_scene_static(scene);
|
||||
|
||||
success = start_ffmpeg_impl(context, rd, rectx, recty, suffix, reports);
|
||||
bool success = start_ffmpeg_impl(context, rd, rectx, recty, suffix, reports);
|
||||
# ifdef WITH_AUDASPACE
|
||||
if (context->audio_stream) {
|
||||
AVCodecContext *c = context->audio_codec;
|
||||
|
@ -1699,24 +1704,22 @@ static void write_audio_frames(FFMpegContext *context, double to_pts)
|
|||
}
|
||||
# endif
|
||||
|
||||
int BKE_ffmpeg_append(void *context_v,
|
||||
RenderData *rd,
|
||||
int start_frame,
|
||||
int frame,
|
||||
int *pixels,
|
||||
int rectx,
|
||||
int recty,
|
||||
const char *suffix,
|
||||
ReportList *reports)
|
||||
bool BKE_ffmpeg_append(void *context_v,
|
||||
RenderData *rd,
|
||||
int start_frame,
|
||||
int frame,
|
||||
const ImBuf *image,
|
||||
const char *suffix,
|
||||
ReportList *reports)
|
||||
{
|
||||
FFMpegContext *context = static_cast<FFMpegContext *>(context_v);
|
||||
AVFrame *avframe;
|
||||
int success = 1;
|
||||
bool success = true;
|
||||
|
||||
PRINT("Writing frame %i, render width=%d, render height=%d\n", frame, rectx, recty);
|
||||
PRINT("Writing frame %i, render width=%d, render height=%d\n", frame, image->x, image->y);
|
||||
|
||||
if (context->video_stream) {
|
||||
avframe = generate_video_frame(context, (uchar *)pixels);
|
||||
avframe = generate_video_frame(context, image);
|
||||
success = (avframe && write_video_frame(context, avframe, reports));
|
||||
# ifdef WITH_AUDASPACE
|
||||
/* Add +1 frame because we want to encode audio up until the next video frame. */
|
||||
|
@ -1731,7 +1734,7 @@ int BKE_ffmpeg_append(void *context_v,
|
|||
end_ffmpeg_impl(context, true);
|
||||
context->ffmpeg_autosplit_count++;
|
||||
|
||||
success &= start_ffmpeg_impl(context, rd, rectx, recty, suffix, reports);
|
||||
success &= start_ffmpeg_impl(context, rd, image->x, image->y, suffix, reports);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,31 +23,29 @@
|
|||
|
||||
#include "BKE_writemovie.hh"
|
||||
|
||||
static int start_stub(void * /*context_v*/,
|
||||
const Scene * /*scene*/,
|
||||
RenderData * /*rd*/,
|
||||
int /*rectx*/,
|
||||
int /*recty*/,
|
||||
ReportList * /*reports*/,
|
||||
bool /*preview*/,
|
||||
const char * /*suffix*/)
|
||||
static bool start_stub(void * /*context_v*/,
|
||||
const Scene * /*scene*/,
|
||||
RenderData * /*rd*/,
|
||||
int /*rectx*/,
|
||||
int /*recty*/,
|
||||
ReportList * /*reports*/,
|
||||
bool /*preview*/,
|
||||
const char * /*suffix*/)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void end_stub(void * /*context_v*/) {}
|
||||
|
||||
static int append_stub(void * /*context_v*/,
|
||||
RenderData * /*rd*/,
|
||||
int /*start_frame*/,
|
||||
int /*frame*/,
|
||||
int * /*pixels*/,
|
||||
int /*rectx*/,
|
||||
int /*recty*/,
|
||||
const char * /*suffix*/,
|
||||
ReportList * /*reports*/)
|
||||
static bool append_stub(void * /*context_v*/,
|
||||
RenderData * /*rd*/,
|
||||
int /*start_frame*/,
|
||||
int /*frame*/,
|
||||
const ImBuf * /*image*/,
|
||||
const char * /*suffix*/,
|
||||
ReportList * /*reports*/)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void *context_create_stub()
|
||||
|
|
|
@ -785,6 +785,7 @@ static asset::AssetItemTree build_catalog_tree(const bContext &C, const Object &
|
|||
return true;
|
||||
};
|
||||
const AssetLibraryReference library = asset_system::all_library_reference();
|
||||
asset_system::all_library_reload_catalogs_if_dirty();
|
||||
return asset::build_filtered_all_catalog_tree(library, C, type_filter, meta_data_filter);
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,9 @@ struct RingSelOpData {
|
|||
static void ringsel_draw(const bContext * /*C*/, ARegion * /*region*/, void *arg)
|
||||
{
|
||||
RingSelOpData *lcd = static_cast<RingSelOpData *>(arg);
|
||||
EDBM_preselect_edgering_draw(lcd->presel_edgering, lcd->ob->object_to_world().ptr());
|
||||
if (lcd->ob != nullptr) {
|
||||
EDBM_preselect_edgering_draw(lcd->presel_edgering, lcd->ob->object_to_world().ptr());
|
||||
}
|
||||
}
|
||||
|
||||
static void edgering_select(RingSelOpData *lcd)
|
||||
|
|
|
@ -65,6 +65,7 @@ static asset::AssetItemTree build_catalog_tree(const bContext &C)
|
|||
return true;
|
||||
};
|
||||
const AssetLibraryReference library = asset_system::all_library_reference();
|
||||
asset_system::all_library_reload_catalogs_if_dirty();
|
||||
return asset::build_filtered_all_catalog_tree(library, C, type_filter, meta_data_filter);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ static asset::AssetItemTree build_catalog_tree(const bContext &C, const bNodeTre
|
|||
return true;
|
||||
};
|
||||
const AssetLibraryReference library = asset_system::all_library_reference();
|
||||
asset_system::all_library_reload_catalogs_if_dirty();
|
||||
return asset::build_filtered_all_catalog_tree(library, C, type_filter, meta_data_filter);
|
||||
}
|
||||
|
||||
|
|
|
@ -662,6 +662,7 @@ void MTLCommandBufferManager::encode_signal_event(id<MTLEvent> event, uint64_t s
|
|||
BLI_assert(cmd_buf);
|
||||
this->end_active_command_encoder();
|
||||
[cmd_buf encodeSignalEvent:event value:signal_value];
|
||||
register_encoder_counters();
|
||||
}
|
||||
|
||||
void MTLCommandBufferManager::encode_wait_for_event(id<MTLEvent> event, uint64_t signal_value)
|
||||
|
@ -671,6 +672,7 @@ void MTLCommandBufferManager::encode_wait_for_event(id<MTLEvent> event, uint64_t
|
|||
BLI_assert(cmd_buf);
|
||||
this->end_active_command_encoder();
|
||||
[cmd_buf encodeWaitForEvent:event value:signal_value];
|
||||
register_encoder_counters();
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -522,11 +522,7 @@ void IMB_alpha_under_color_byte(unsigned char *rect, int x, int y, const float b
|
|||
ImBuf *IMB_loadifffile(int file, int flags, char colorspace[IM_MAX_SPACE], const char *descr);
|
||||
|
||||
ImBuf *IMB_half_x(ImBuf *ibuf1);
|
||||
ImBuf *IMB_double_fast_x(ImBuf *ibuf1);
|
||||
ImBuf *IMB_double_x(ImBuf *ibuf1);
|
||||
ImBuf *IMB_half_y(ImBuf *ibuf1);
|
||||
ImBuf *IMB_double_fast_y(ImBuf *ibuf1);
|
||||
ImBuf *IMB_double_y(ImBuf *ibuf1);
|
||||
|
||||
void IMB_flipx(ImBuf *ibuf);
|
||||
void IMB_flipy(ImBuf *ibuf);
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
|
||||
struct ImBuf;
|
||||
|
||||
void imb_filterx(ImBuf *ibuf);
|
||||
|
||||
void IMB_premultiply_rect(uint8_t *rect, char planes, int w, int h);
|
||||
void IMB_premultiply_rect_float(float *rect_float, int channels, int w, int h);
|
||||
|
||||
|
|
|
@ -19,44 +19,6 @@
|
|||
|
||||
#include "imbuf.hh"
|
||||
|
||||
static void filtrow(uchar *point, int x)
|
||||
{
|
||||
uint c1, c2, c3, error;
|
||||
|
||||
if (x > 1) {
|
||||
c1 = c2 = *point;
|
||||
error = 2;
|
||||
for (x--; x > 0; x--) {
|
||||
c3 = point[4];
|
||||
c1 += (c2 << 1) + c3 + error;
|
||||
error = c1 & 3;
|
||||
*point = c1 >> 2;
|
||||
point += 4;
|
||||
c1 = c2;
|
||||
c2 = c3;
|
||||
}
|
||||
*point = (c1 + (c2 << 1) + c2 + error) >> 2;
|
||||
}
|
||||
}
|
||||
|
||||
static void filtrowf(float *point, int x)
|
||||
{
|
||||
float c1, c2, c3;
|
||||
|
||||
if (x > 1) {
|
||||
c1 = c2 = *point;
|
||||
for (x--; x > 0; x--) {
|
||||
c3 = point[4];
|
||||
c1 += (c2 * 2) + c3;
|
||||
*point = 0.25f * c1;
|
||||
point += 4;
|
||||
c1 = c2;
|
||||
c2 = c3;
|
||||
}
|
||||
*point = 0.25f * (c1 + (c2 * 2) + c2);
|
||||
}
|
||||
}
|
||||
|
||||
static void filtcolum(uchar *point, int y, int skip)
|
||||
{
|
||||
uint c1, c2, c3, error;
|
||||
|
@ -137,43 +99,6 @@ void IMB_filtery(ImBuf *ibuf)
|
|||
}
|
||||
}
|
||||
|
||||
void imb_filterx(ImBuf *ibuf)
|
||||
{
|
||||
uchar *point = ibuf->byte_buffer.data;
|
||||
float *pointf = ibuf->float_buffer.data;
|
||||
|
||||
int x = ibuf->x;
|
||||
int y = ibuf->y;
|
||||
int skip = (x << 2) - 3;
|
||||
|
||||
for (; y > 0; y--) {
|
||||
if (point) {
|
||||
if (ibuf->planes > 24) {
|
||||
filtrow(point, x);
|
||||
}
|
||||
point++;
|
||||
filtrow(point, x);
|
||||
point++;
|
||||
filtrow(point, x);
|
||||
point++;
|
||||
filtrow(point, x);
|
||||
point += skip;
|
||||
}
|
||||
if (pointf) {
|
||||
if (ibuf->planes > 24) {
|
||||
filtrowf(pointf, x);
|
||||
}
|
||||
pointf++;
|
||||
filtrowf(pointf, x);
|
||||
pointf++;
|
||||
filtrowf(pointf, x);
|
||||
pointf++;
|
||||
filtrowf(pointf, x);
|
||||
pointf += skip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void imb_filterN(ImBuf *out, ImBuf *in)
|
||||
{
|
||||
BLI_assert(out->channels == in->channels);
|
||||
|
@ -291,12 +216,6 @@ static void imb_filterN(ImBuf *out, ImBuf *in)
|
|||
}
|
||||
}
|
||||
|
||||
void IMB_filter(ImBuf *ibuf)
|
||||
{
|
||||
IMB_filtery(ibuf);
|
||||
imb_filterx(ibuf);
|
||||
}
|
||||
|
||||
void IMB_mask_filter_extend(char *mask, int width, int height)
|
||||
{
|
||||
const char *row1, *row2, *row3;
|
||||
|
|
|
@ -102,68 +102,6 @@ ImBuf *IMB_half_x(ImBuf *ibuf1)
|
|||
return ibuf2;
|
||||
}
|
||||
|
||||
ImBuf *IMB_double_fast_x(ImBuf *ibuf1)
|
||||
{
|
||||
ImBuf *ibuf2;
|
||||
int *p1, *dest, i, col, do_rect, do_float;
|
||||
float *p1f, *destf;
|
||||
|
||||
if (ibuf1 == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
if (ibuf1->byte_buffer.data == nullptr && ibuf1->float_buffer.data == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
do_rect = (ibuf1->byte_buffer.data != nullptr);
|
||||
do_float = (ibuf1->float_buffer.data != nullptr);
|
||||
|
||||
ibuf2 = IMB_allocImBuf(2 * ibuf1->x, ibuf1->y, ibuf1->planes, ibuf1->flags);
|
||||
if (ibuf2 == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
p1 = (int *)ibuf1->byte_buffer.data;
|
||||
dest = (int *)ibuf2->byte_buffer.data;
|
||||
p1f = (float *)ibuf1->float_buffer.data;
|
||||
destf = (float *)ibuf2->float_buffer.data;
|
||||
|
||||
for (i = ibuf1->y * ibuf1->x; i > 0; i--) {
|
||||
if (do_rect) {
|
||||
col = *p1++;
|
||||
*dest++ = col;
|
||||
*dest++ = col;
|
||||
}
|
||||
if (do_float) {
|
||||
destf[0] = destf[4] = p1f[0];
|
||||
destf[1] = destf[5] = p1f[1];
|
||||
destf[2] = destf[6] = p1f[2];
|
||||
destf[3] = destf[7] = p1f[3];
|
||||
destf += 8;
|
||||
p1f += 4;
|
||||
}
|
||||
}
|
||||
|
||||
return ibuf2;
|
||||
}
|
||||
|
||||
ImBuf *IMB_double_x(ImBuf *ibuf1)
|
||||
{
|
||||
ImBuf *ibuf2;
|
||||
|
||||
if (ibuf1 == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
if (ibuf1->byte_buffer.data == nullptr && ibuf1->float_buffer.data == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ibuf2 = IMB_double_fast_x(ibuf1);
|
||||
|
||||
imb_filterx(ibuf2);
|
||||
return ibuf2;
|
||||
}
|
||||
|
||||
static void imb_half_y_no_alloc(ImBuf *ibuf2, ImBuf *ibuf1)
|
||||
{
|
||||
uchar *p1, *p2, *_p1, *dest;
|
||||
|
@ -256,70 +194,6 @@ ImBuf *IMB_half_y(ImBuf *ibuf1)
|
|||
return ibuf2;
|
||||
}
|
||||
|
||||
ImBuf *IMB_double_fast_y(ImBuf *ibuf1)
|
||||
{
|
||||
ImBuf *ibuf2;
|
||||
int *p1, *dest1, *dest2;
|
||||
float *p1f, *dest1f, *dest2f;
|
||||
int x, y;
|
||||
|
||||
if (ibuf1 == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
if (ibuf1->byte_buffer.data == nullptr && ibuf1->float_buffer.data == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const bool do_rect = (ibuf1->byte_buffer.data != nullptr);
|
||||
const bool do_float = (ibuf1->float_buffer.data != nullptr);
|
||||
|
||||
ibuf2 = IMB_allocImBuf(ibuf1->x, 2 * ibuf1->y, ibuf1->planes, ibuf1->flags);
|
||||
if (ibuf2 == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
p1 = (int *)ibuf1->byte_buffer.data;
|
||||
dest1 = (int *)ibuf2->byte_buffer.data;
|
||||
p1f = (float *)ibuf1->float_buffer.data;
|
||||
dest1f = (float *)ibuf2->float_buffer.data;
|
||||
|
||||
for (y = ibuf1->y; y > 0; y--) {
|
||||
if (do_rect) {
|
||||
dest2 = dest1 + ibuf2->x;
|
||||
for (x = ibuf2->x; x > 0; x--) {
|
||||
*dest1++ = *dest2++ = *p1++;
|
||||
}
|
||||
dest1 = dest2;
|
||||
}
|
||||
if (do_float) {
|
||||
dest2f = dest1f + (4 * ibuf2->x);
|
||||
for (x = ibuf2->x * 4; x > 0; x--) {
|
||||
*dest1f++ = *dest2f++ = *p1f++;
|
||||
}
|
||||
dest1f = dest2f;
|
||||
}
|
||||
}
|
||||
|
||||
return ibuf2;
|
||||
}
|
||||
|
||||
ImBuf *IMB_double_y(ImBuf *ibuf1)
|
||||
{
|
||||
ImBuf *ibuf2;
|
||||
|
||||
if (ibuf1 == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
if (ibuf1->byte_buffer.data == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ibuf2 = IMB_double_fast_y(ibuf1);
|
||||
|
||||
IMB_filtery(ibuf2);
|
||||
return ibuf2;
|
||||
}
|
||||
|
||||
/* pretty much specific functions which converts uchar <-> ushort but assumes
|
||||
* ushort range of 255*255 which is more convenient here
|
||||
*/
|
||||
|
|
|
@ -2092,9 +2092,7 @@ bool RE_WriteRenderViewsMovie(ReportList *reports,
|
|||
rd,
|
||||
preview ? scene->r.psfra : scene->r.sfra,
|
||||
scene->r.cfra,
|
||||
(int *)ibuf->byte_buffer.data,
|
||||
ibuf->x,
|
||||
ibuf->y,
|
||||
ibuf,
|
||||
suffix,
|
||||
reports))
|
||||
{
|
||||
|
@ -2126,9 +2124,7 @@ bool RE_WriteRenderViewsMovie(ReportList *reports,
|
|||
rd,
|
||||
preview ? scene->r.psfra : scene->r.sfra,
|
||||
scene->r.cfra,
|
||||
(int *)ibuf_arr[2]->byte_buffer.data,
|
||||
ibuf_arr[2]->x,
|
||||
ibuf_arr[2]->y,
|
||||
ibuf_arr[2],
|
||||
"",
|
||||
reports))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue