MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / getHistogram

Method getHistogram

src/backend/common/graphics_common.cpp:438–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436}
437
438fg_histogram ForgeManager::getHistogram(fg_chart chart, int nBins,
439 fg_dtype type) {
440 unsigned long long key =
441 ((static_cast<unsigned long long>(nBins) & _48BIT) << 16U) |
442 (type & _16BIT);
443
444 ChartKey keypair = make_pair(key, chart);
445 auto iter = mHstMap.find(keypair);
446
447 if (iter == mHstMap.end()) {
448 fg_chart_type chart_type;
449 FG_CHECK(mPlugin->fg_get_chart_type(&chart_type, chart));
450 if (chart_type != FG_CHART_2D) {
451 AF_ERROR("Histogram can only be added to chart of type FG_CHART_2D",
452 AF_ERR_TYPE);
453 }
454 fg_histogram hst = nullptr;
455 FG_CHECK(mPlugin->fg_create_histogram(&hst, nBins, type));
456 FG_CHECK(mPlugin->fg_append_histogram_to_chart(chart, hst));
457 mHstMap[keypair] = HistogramPtr(new Histogram({hst}));
458 }
459 return mHstMap[keypair]->handle;
460}
461
462fg_surface ForgeManager::getSurface(fg_chart chart, int nX, int nY,
463 fg_dtype type) {

Callers 1

setup_histogramFunction · 0.80

Calls 1

findMethod · 0.80

Tested by

no test coverage detected