• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dimof函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中dimof函数的典型用法代码示例。如果您正苦于以下问题:C++ dimof函数的具体用法?C++ dimof怎么用?C++ dimof使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dimof函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: vsfos_modinit

vsf_err_t vsfos_modinit(struct vsf_module_t *module,
								struct app_hwcfg_t const *cfg)
{
	struct vsfos_modifs_t *ifs;
	ifs = vsf_bufmgr_malloc(sizeof(struct vsfos_modifs_t));
	if (!ifs) return VSFERR_FAIL;
	memset(ifs, 0, sizeof(*ifs));

	ifs->hwcfg = cfg;

	ifs->pendsvq.size = dimof(ifs->pendsvq_ele);
	ifs->pendsvq.queue = ifs->pendsvq_ele;
	ifs->pendsvq.activate = vsfos_pendsv_activate;

	// init vsftimer
	ifs->vsftimer_memop.alloc = vsftimer_memop_alloc;
	ifs->vsftimer_memop.free = vsftimer_memop_free;

	// init fakefat32_fs
	ifs->fakefat32_fs.Windows_dir[0].memfile.file.name = ".";
	ifs->fakefat32_fs.Windows_dir[0].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.Windows_dir[1].memfile.file.name = "..";
	ifs->fakefat32_fs.Windows_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.Windows_dir[2].memfile.file.name = "VSFCDC.inf";
	ifs->fakefat32_fs.Windows_dir[2].memfile.file.size = sizeof(vsfcdc_inf) - 1;
	ifs->fakefat32_fs.Windows_dir[2].memfile.file.attr = VSFILE_ATTR_ARCHIVE | VSFILE_ATTR_READONLY;
	ifs->fakefat32_fs.Windows_dir[2].memfile.f.buff = (uint8_t *)vsfcdc_inf;
	ifs->fakefat32_fs.Windows_dir[3].memfile.file.name = "VSFRNDIS.inf";
	ifs->fakefat32_fs.Windows_dir[3].memfile.file.size = sizeof(vsfrndis_inf) - 1;
	ifs->fakefat32_fs.Windows_dir[3].memfile.file.attr = VSFILE_ATTR_ARCHIVE | VSFILE_ATTR_READONLY;
	ifs->fakefat32_fs.Windows_dir[3].memfile.f.buff = (uint8_t *)vsfrndis_inf;

	ifs->fakefat32_fs.Driver_dir[0].memfile.file.name = ".";
	ifs->fakefat32_fs.Driver_dir[0].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.Driver_dir[1].memfile.file.name = "..";
	ifs->fakefat32_fs.Driver_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.Driver_dir[2].memfile.file.name = "Windows";
	ifs->fakefat32_fs.Driver_dir[2].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.Driver_dir[2].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.Windows_dir;

	ifs->fakefat32_fs.LOSTDIR_dir[0].memfile.file.name = ".";
	ifs->fakefat32_fs.LOSTDIR_dir[0].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.LOSTDIR_dir[1].memfile.file.name = "..";
	ifs->fakefat32_fs.LOSTDIR_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY;

	ifs->fakefat32_fs.RECYCLEBIN_dir[0].memfile.file.name = ".";
	ifs->fakefat32_fs.RECYCLEBIN_dir[0].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.RECYCLEBIN_dir[1].memfile.file.name = "..";
	ifs->fakefat32_fs.RECYCLEBIN_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.RECYCLEBIN_dir[2].memfile.file.name = "DESKTOP.INI";
	ifs->fakefat32_fs.RECYCLEBIN_dir[2].memfile.file.size = sizeof(Win_recycle_DESKTOP_INI) - 1;
	ifs->fakefat32_fs.RECYCLEBIN_dir[2].memfile.file.attr = VSFILE_ATTR_ARCHIVE | VSFILE_ATTR_READONLY;
	ifs->fakefat32_fs.RECYCLEBIN_dir[2].memfile.f.buff = (uint8_t *)Win_recycle_DESKTOP_INI;

	ifs->fakefat32_fs.SVI_dir[0].memfile.file.name = ".";
	ifs->fakefat32_fs.SVI_dir[0].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.SVI_dir[1].memfile.file.name = "..";
	ifs->fakefat32_fs.SVI_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.SVI_dir[2].memfile.file.name = "IndexerVolumeGuid";
	ifs->fakefat32_fs.SVI_dir[2].memfile.file.size = sizeof(Win10_IndexerVolumeGuid);
	ifs->fakefat32_fs.SVI_dir[2].memfile.file.attr = VSFILE_ATTR_ARCHIVE | VSFILE_ATTR_READONLY | VSFILE_ATTR_SYSTEM | VSFILE_ATTR_HIDDEN,
	ifs->fakefat32_fs.SVI_dir[2].memfile.f.buff = (uint8_t *)Win10_IndexerVolumeGuid;
	ifs->fakefat32_fs.SVI_dir[3].memfile.file.name = "WPSettings.dat";
	ifs->fakefat32_fs.SVI_dir[3].memfile.file.size = sizeof(Win10_WPSettings_dat);
	ifs->fakefat32_fs.SVI_dir[3].memfile.file.attr = VSFILE_ATTR_ARCHIVE | VSFILE_ATTR_READONLY | VSFILE_ATTR_SYSTEM | VSFILE_ATTR_HIDDEN,
	ifs->fakefat32_fs.SVI_dir[3].memfile.f.buff = (uint8_t *)Win10_WPSettings_dat;

	ifs->fakefat32_fs.root_dir[0].memfile.file.name = "VSFDriver";
	ifs->fakefat32_fs.root_dir[0].memfile.file.attr = VSFILE_ATTR_VOLUMID;
	ifs->fakefat32_fs.root_dir[1].memfile.file.name = "LOST.DIR";
	ifs->fakefat32_fs.root_dir[1].memfile.file.attr = VSFILE_ATTR_DIRECTORY | VSFILE_ATTR_SYSTEM | VSFILE_ATTR_HIDDEN;
	ifs->fakefat32_fs.root_dir[1].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.LOSTDIR_dir;
	ifs->fakefat32_fs.root_dir[2].memfile.file.name = "$RECYCLE.BIN";
	ifs->fakefat32_fs.root_dir[2].memfile.file.attr = VSFILE_ATTR_DIRECTORY | VSFILE_ATTR_SYSTEM | VSFILE_ATTR_HIDDEN;
	ifs->fakefat32_fs.root_dir[2].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.RECYCLEBIN_dir;
	ifs->fakefat32_fs.root_dir[3].memfile.file.name = "System Volume Information";
	ifs->fakefat32_fs.root_dir[3].memfile.file.attr = VSFILE_ATTR_DIRECTORY | VSFILE_ATTR_SYSTEM | VSFILE_ATTR_HIDDEN;
	ifs->fakefat32_fs.root_dir[3].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.SVI_dir;
	ifs->fakefat32_fs.root_dir[4].memfile.file.name = "Driver";
	ifs->fakefat32_fs.root_dir[4].memfile.file.attr = VSFILE_ATTR_DIRECTORY;
	ifs->fakefat32_fs.root_dir[4].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.Driver_dir;

	// init fakefat32
	ifs->mal.fakefat32.sector_size = 512;
	ifs->mal.fakefat32.sector_number = 0x1000;
	ifs->mal.fakefat32.sectors_per_cluster = 8;
	ifs->mal.fakefat32.volume_id = 0xDEADBEEF;
	ifs->mal.fakefat32.disk_id = 0xBABECAFE;
	ifs->mal.fakefat32.root[0].memfile.file.name = "ROOT";
	ifs->mal.fakefat32.root[0].memfile.d.child = (struct vsfile_memfile_t *)ifs->fakefat32_fs.root_dir,

	// init mal
	ifs->mal.mal.drv = &fakefat32_mal_drv;
	ifs->mal.mal.param = &ifs->mal.fakefat32;
	ifs->mal.pbuffer[0] = ifs->mal.buffer[0];
	ifs->mal.pbuffer[1] = ifs->mal.buffer[1];

	// init file
	ifs->fs.memop.alloc_vfs = vsfos_vsfile_alloc_vfs;
	ifs->fs.memop.free_vfs = vsfos_vsfile_free_vfs;
//.........这里部分代码省略.........
开发者ID:hank-fan,项目名称:vsf,代码行数:101,代码来源:vsfos.c


示例2: dimof

    {VX_BIDIRECTIONAL, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};


static vx_param_description_t accumulate_scaled_kernel_params[] = {
    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED},
    {VX_BIDIRECTIONAL, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};


vx_kernel_description_t accumulate_kernel = {
    VX_KERNEL_ACCUMULATE,
    "org.khronos.openvx.accumulate",
    vxAccumulateKernel,
    accumulate_kernel_params, dimof(accumulate_kernel_params),
    vxAccumulateInputValidator,
    vxAccumulateOutputValidator,
    NULL,
    NULL,
};

vx_kernel_description_t accumulate_weighted_kernel = {
    VX_KERNEL_ACCUMULATE_WEIGHTED,
    "org.khronos.openvx.accumulate_weighted",
    vxAccumulateWeightedKernel,
    accumulate_scaled_kernel_params, dimof(accumulate_scaled_kernel_params),
    vxAccumulateWeightedInputValidator,
    vxAccumulateOutputValidator,
    NULL,
    NULL,
开发者ID:flowyard,项目名称:FlowVX,代码行数:31,代码来源:vx_accumulate.c


示例3: vxHarrisDeinitializer

            }
        }
    }
    return status;
}

static vx_status VX_CALLBACK vxHarrisDeinitializer(vx_node node, vx_reference *parameters, vx_uint32 num)
{
    vx_status status = VX_ERROR_INVALID_PARAMETERS;
    if (num == dimof(harris_kernel_params))
    {
        vx_graph graph = vxGetChildGraphOfNode(node);
        vxReleaseGraph(&graph);
        /* set graph to "null" */
        vxSetChildGraphOfNode(node, 0);
        status = VX_SUCCESS;
    }
    return status;
}

vx_kernel_description_t harris_kernel = {
    VX_KERNEL_HARRIS_CORNERS,
    "org.khronos.openvx.harris_corners",
    vxHarrisCornersKernel,
    harris_kernel_params, dimof(harris_kernel_params),
    vxHarrisInputValidator,
    vxHarrisOutputValidator,
    vxHarrisInitializer,
    vxHarrisDeinitializer,
};
开发者ID:flowyard,项目名称:FlowVX,代码行数:30,代码来源:vx_harris.c


示例4: dimof

//-----------------------------------------------------------------------------
//
// header files
//
//-----------------------------------------------------------------------------

#include "bsp.h"
#include "ceddkex.h"
#include "sdk_gpio.h"
#include "bsp_padcfg.h"
#include "sdk_padcfg.h"
#include "oalex.h"

DWORD g_GPIOId[] = {NOTIFICATION_LED_GPIO};
DWORD g_GPIOActiveState[dimof(g_GPIOId)] = {0};
DWORD g_dwNbLeds = dimof(g_GPIOId);
BOOL g_LastLEDIsVibrator = FALSE;

static const PAD_INFO LedPinMux[] = {
    WKUP_PAD_ENTRY(SYS_BOOT6,   INPUT_DISABLED | PULL_RESISTOR_DISABLED | MUXMODE(4)) \
    END_OF_PAD_ARRAY
    };


int NLedCpuFamily = -1;

BOOL NLedBoardInit()
{  
    if (NLedCpuFamily == -1)
    {
开发者ID:zizilala,项目名称:projects_wince_AA,代码行数:30,代码来源:nled.c


示例5: keyName

static WCHAR *GetGhostscriptPath()
{
    WCHAR *gsProducts[] = {
        L"AFPL Ghostscript",
        L"Aladdin Ghostscript",
        L"GPL Ghostscript",
        L"GNU Ghostscript",
    };

    // find all installed Ghostscript versions
    WStrVec versions;
    REGSAM access = KEY_READ | KEY_WOW64_32KEY;
TryAgain64Bit:
    for (int i = 0; i < dimof(gsProducts); i++) {
        HKEY hkey;
        ScopedMem<WCHAR> keyName(str::Join(L"Software\\", gsProducts[i]));
        if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, access, &hkey) != ERROR_SUCCESS)
            continue;
        WCHAR subkey[32];
        for (DWORD ix = 0; RegEnumKey(hkey, ix, subkey, dimof(subkey)) == ERROR_SUCCESS; ix++)
            versions.Append(str::Dup(subkey));
        RegCloseKey(hkey);
    }
    if ((access & KEY_WOW64_32KEY)) {
        // also look for 64-bit Ghostscript versions under 64-bit Windows
        access = KEY_READ | KEY_WOW64_64KEY;
#ifndef _WIN64
        // (unless this is 32-bit Windows)
        if (IsRunningInWow64())
#endif
        goto TryAgain64Bit;
    }
    versions.SortNatural();

    // return the path to the newest installation
    for (size_t ix = versions.Count(); ix > 0; ix--) {
        for (int i = 0; i < dimof(gsProducts); i++) {
            ScopedMem<WCHAR> keyName(str::Format(L"Software\\%s\\%s",
                                                 gsProducts[i], versions.At(ix - 1)));
            ScopedMem<WCHAR> GS_DLL(ReadRegStr(HKEY_LOCAL_MACHINE, keyName, L"GS_DLL"));
            if (!GS_DLL)
                continue;
            ScopedMem<WCHAR> dir(path::GetDir(GS_DLL));
            ScopedMem<WCHAR> exe(path::Join(dir, L"gswin32c.exe"));
            if (file::Exists(exe))
                return exe.StealData();
            exe.Set(path::Join(dir, L"gswin64c.exe"));
            if (file::Exists(exe))
                return exe.StealData();
        }
    }

    // if Ghostscript isn't found in the Registry, try finding it in the %PATH%
    DWORD size = GetEnvironmentVariable(L"PATH", NULL, 0);
    ScopedMem<WCHAR> envpath(AllocArray<WCHAR>(size));
    if (size > 0 && envpath) {
        GetEnvironmentVariable(L"PATH", envpath, size);
        WStrVec paths;
        paths.Split(envpath, L";", true);
        for (size_t ix = 0; ix < paths.Count(); ix++) {
            ScopedMem<WCHAR> exe(path::Join(paths.At(ix), L"gswin32c.exe"));
            if (file::Exists(exe))
                return exe.StealData();
            exe.Set(path::Join(paths.At(ix), L"gswin64c.exe"));
            if (file::Exists(exe))
                return exe.StealData();
        }
    }

    return NULL;
}
开发者ID:xuxiandi,项目名称:sumatrapdf,代码行数:71,代码来源:PsEngine.cpp


示例6: WriteAllUtf

bool WriteAllUtf(const char *filePath, const void *data, size_t dataLen)
{
    WCHAR buf[512];
    str::Utf8ToWcharBuf(filePath, str::Len(filePath), buf, dimof(buf));
    return WriteAll(buf, data, dataLen);
}
开发者ID:DavidWiberg,项目名称:sumatrapdf,代码行数:6,代码来源:FileUtil.cpp


示例7: dimof

    {"FOURCC_Y800",     T_FIXNUM, .value.l=FOURCC_Y800},
    {"FOURCC_UYVY",     T_FIXNUM, .value.l=FOURCC_UYVY},
    {"FOURCC_RGB",      T_FIXNUM, .value.l=FOURCC_RGB},
    {"FOURCC_Y16",      T_FIXNUM, .value.l=FOURCC_Y16},
    {"FOURCC_Y32",      T_FIXNUM, .value.l=FOURCC_Y32},
    {"FOURCC_NV12",     T_FIXNUM, .value.l=FOURCC_NV12},
};

static rext_const_t parameter_constants[] = {
    {"VX_INPUT",        T_FIXNUM, .value.l=VX_INPUT},
    {"VX_OUTPUT",       T_FIXNUM, .value.l=VX_OUTPUT},
    {"VX_BIDIRECTIONAL",T_FIXNUM, .value.l=VX_BIDIRECTIONAL},
};

static rext_object_t objects[] = {
    {0, &rb_cObject, "Reference", Reference_allocate, NULL, 0, NULL, 0, reference_methods, dimof(reference_methods)},
    {0, &rb_cObject, "Kernel", Kernel_allocate, NULL, 0, NULL, 0, kernel_methods, dimof(kernel_methods)},
    {0, &rb_cObject, "Graph", Graph_allocate, NULL, 0, NULL, 0, graph_methods, dimof(graph_methods)},
    {0, &rb_cObject, "Image", Image_allocate, NULL, 0, image_constants, dimof(image_constants), image_methods, dimof(image_methods)},
    {0, &rb_cObject, "Node", Node_allocate, NULL, 0, NULL, 0, node_methods, dimof(node_methods)},
    {0, &rb_cObject, "Parameter", Parameter_allocate, NULL, 0, parameter_constants, dimof(parameter_constants), parameter_methods, dimof(parameter_methods)},
    {0, &rb_cObject, "Buffer", Buffer_allocate, NULL, 0, NULL, 0, buffer_methods, dimof(buffer_methods)},
    {0, &rb_cObject, "Scalar", Scalar_allocate, NULL, 0, NULL, 0, scalar_methods, dimof(scalar_methods)},
    {0, &rb_cObject, "Target", Target_allocate, NULL, 0, NULL, 0, target_methods, dimof(target_methods)},
};

static rext_module_t modules[] = {
    {0, "OpenVX", NULL, 0, objects, dimof(objects), NULL, 0, openvx_global_methods, dimof(openvx_global_methods)},
};

//******************************************************************************
开发者ID:ofleischmann,项目名称:vision,代码行数:31,代码来源:vx_ruby.c


示例8: CrashIf

RectF TextRenderGdiplus::Measure(const char *s, size_t sLen) {
    CrashIf(!currFont);
    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));
    return MeasureText(gfx, currFont->font, txtConvBuf, strLen, measureAlgo);
}
开发者ID:Nargesf,项目名称:Sumatrapdf,代码行数:5,代码来源:TextRender.cpp


示例9: vxAddition

    if (num == 4)
    {
        vx_image in0 = (vx_image)parameters[0];
        vx_image in1 = (vx_image)parameters[1];
        vx_scalar policy_param = (vx_scalar)parameters[2];
        vx_image output = (vx_image)parameters[3];
        return vxAddition(in0, in1, policy_param, output);
    }
    return VX_ERROR_INVALID_PARAMETERS;
}

vx_kernel_description_t add_kernel = {
    VX_KERNEL_ADD,
    "org.khronos.openvx.add",
    vxAdditionKernel,
    add_subtract_kernel_params, dimof(add_subtract_kernel_params),
    vxAddSubtractInputValidator,
    vxAddSubtractOutputValidator,
    NULL,
    NULL,
};

static vx_status VX_CALLBACK vxSubtractionKernel(vx_node node, const vx_reference *parameters, vx_uint32 num)
{
    if (num == 4)
    {
        vx_image in0 = (vx_image)parameters[0];
        vx_image in1 = (vx_image)parameters[1];
        vx_scalar policy_param = (vx_scalar)parameters[2];
        vx_image output = (vx_image)parameters[3];
        return vxSubtraction(in0, in1, policy_param, output);
开发者ID:ChiahungTai,项目名称:clairvoyance,代码行数:31,代码来源:vx_addsub.c


示例10: VX_PRINT

    else
    {
        status = VX_ERROR_INVALID_PARAMETERS;
    }
    VX_PRINT(VX_ZONE_API, "%s:%u returned %d\n", __FUNCTION__, index, status);
    return status;
}


/*! \brief Declares the parameter types for \ref vxuColorConvert.
 * \ingroup group_implementation
 */
static vx_param_description_t channel_extract_kernel_params[] = {
    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED},
    {VX_OUTPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};

/*! \brief The exported kernel table entry */
vx_kernel_description_t channelextract_kernel = {
    VX_KERNEL_CHANNEL_EXTRACT,
    "org.khronos.openvx.channel_extract",
    vxChannelExtractKernel,
    channel_extract_kernel_params, dimof(channel_extract_kernel_params),
    vxChannelExtractInputValidator,
    vxChannelExtractOutputValidator,
    NULL,
    NULL,
};

开发者ID:ChiahungTai,项目名称:clairvoyance,代码行数:29,代码来源:vx_channelextract.c


示例11: thread_unittest

bool_e thread_unittest(int argc, char *argv[])
{
    uint32_t i, counter = 10;
    pingpongevent_t events;
    int numErrors = 0;
    bool_e verbose = false_e;
    option_t hash_opts[] = {
        {OPTION_TYPE_BOOL, &verbose, sizeof(bool_e), "-v", "--verbose", "Used to print out debugging information"},
    };
    msg_t msgs[] = {{3}, {9283}, {27}, {42}}; // last value == TEST_RET_VALUE
    msg_thread_t msgt;
    thread_t t;
    thread_ret_t r;

    option_process(argc, argv, hash_opts, dimof(hash_opts));

    if (verbose) {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "===THREAD TEST===\n");
    }

    // simple start, stop test
    t = thread_create(thread_test, &counter);
    r = thread_join(t);
    if (r != TEST_RET_VALUE)
        numErrors++;

    if (verbose) {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "===PING PONG TEST===\n");
    }

    // event test across threads
    event_init(&events.ping, false_e);
    event_init(&events.pong, false_e);

    t = thread_create(thread_test_events, &events);
    if (verbose) {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "Test is waiting for thread to wakeup!\n");
    }
    if (event_wait(&events.ping, 500))
    {
        if (verbose)
            SOSAL_PRINT(SOSAL_ZONE_THREAD, "Received Event from Thread!\n");
    }
    else
    {
        if (verbose)
            SOSAL_PRINT(SOSAL_ZONE_THREAD, "ERROR! Thread Message Timedout!\n");
    }
    if (verbose) SOSAL_PRINT(SOSAL_ZONE_THREAD, "Sending Event to Thread!\n");

    event_set(&events.pong);

    r = thread_join(t);
    SOSAL_PRINT(SOSAL_ZONE_THREAD, "=== THREAD JOIN exit = "THREAD_RET_FMT" ===\n", r);
    if (r != TEST_RET_VALUE)
        numErrors++;
    event_deinit(&events.ping);
    event_deinit(&events.pong);

    if (verbose) {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "===QUEUE TEST===\n");
    }

    msgt.msgs = queue_create(2, sizeof(msg_t));
    msgt.running = true_e;
    event_init(&msgt.signal, false_e);
    t = thread_create(thread_test_msgs, &msgt);
    if (verbose)
    {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "Waiting for thread to start!\n");
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "Thread Started?(%s!)\n", (event_wait(&msgt.signal, 1000)?"true":"false"));
    }
    for (i = 0; i < dimof(msgs); i++) {
        if (queue_write(msgt.msgs, true_e, &msgs[i]) == false_e) {
            SOSAL_PRINT(SOSAL_ZONE_ERROR, "ERROR! Failed to write to queue!\n");
        } else {
            if (verbose) SOSAL_PRINT(SOSAL_ZONE_THREAD, "Wrote message "FMT_SIZE_T" to the Queue!\n", msgs[i].code);
        }
    }
    r = thread_join(t);
    SOSAL_PRINT(SOSAL_ZONE_THREAD, "=== THREAD JOIN exit = "THREAD_RET_FMT" ===\n", r);
    queue_destroy(msgt.msgs);
    event_deinit(&msgt.signal);

    if (verbose) {
        SOSAL_PRINT(SOSAL_ZONE_THREAD, "===THREAD TEST EXIT Errors=%d ===\n", numErrors);
    }

    if (numErrors > 0)
        return false_e;
    else
        return true_e;
}
开发者ID:aosp,项目名称:dvp,代码行数:93,代码来源:thread.c


示例12: DMA_Init

//------------------------------------------------------------------------------
//
//  Function:  DMA_Init
//
//  Called by device manager to initialize device.
//
DWORD
DMA_Init(
    LPCWSTR szContext, 
    LPCVOID pBusContext
    )
{
    DWORD rc = (DWORD)NULL;

    UNREFERENCED_PARAMETER(pBusContext);
    UNREFERENCED_PARAMETER(szContext);

    DEBUGMSG(ZONE_FUNCTION, (
        L"+DMA_Init(%s, 0x%08x)\r\n", szContext, pBusContext
        ));

    // Create device structure
    Device_t *pDevice = (Device_t *)LocalAlloc(LPTR, sizeof(Device_t));
    if (pDevice == NULL)
        {
        DEBUGMSG(ZONE_ERROR, (L"ERROR: DMA_Init: "
            L"Failed allocate DMA controller structure\r\n"
            ));
        goto cleanUp;
        }

    // initialize memory
    memset(pDevice, 0, sizeof(Device_t));

    // Set cookie
    pDevice->cookie = DMA_DEVICE_COOKIE;

    // Initalize critical section
    InitializeCriticalSection(&pDevice->cs);

    // Read device parameters
    if (GetDeviceRegistryParams(
            szContext, pDevice, dimof(s_deviceRegParams), s_deviceRegParams
            ) != ERROR_SUCCESS)
        {
        DEBUGMSG(ZONE_ERROR, (L"ERROR: DMA_Init: "
            L"Failed read DMA driver registry parameters\r\n"
            ));
        goto cleanUp;
        }
        
	// Retrieve device ID
    pDevice->SdmaDevice = SOCGetDMADevice(pDevice->SdmaIndex);
    
    // Set hardware to full power
	EnableDeviceClocks(pDevice->SdmaDevice, TRUE);
    
    // DMA will be in smart idle mode so we don't need to
    // ever set the power state of the DMA to D4

    // initialize general dma controller
    if (InitializeDevice(pDevice) == FALSE)
        {
        DEBUGMSG (ZONE_ERROR, (L"ERROR: DMA_Init: "
            L"Failed to initialize device\r\n"
            ));
        goto cleanUp;        
        }

    rc = (DWORD)pDevice;
    
cleanUp:
    if (rc == 0) DMA_Deinit((DWORD)pDevice);
    DEBUGMSG(ZONE_FUNCTION, (L"-DMA_Init(rc = %d)\r\n", rc));
    return rc;
}
开发者ID:zizilala,项目名称:projects_etest,代码行数:76,代码来源:dma.cpp


示例13: dimof

    {
        ptr->dim.scalar.type = VX_TYPE_UINT32;
        status = VX_SUCCESS;
    }
    return status;
}

static vx_param_description_t minmaxloc_kernel_params[] = {
    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_OUTPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_OPTIONAL},
    {VX_OUTPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_OPTIONAL},
    {VX_OUTPUT, VX_TYPE_ARRAY, VX_PARAMETER_STATE_OPTIONAL},
    {VX_OUTPUT, VX_TYPE_ARRAY, VX_PARAMETER_STATE_OPTIONAL},
    {VX_OUTPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_OPTIONAL},
    {VX_OUTPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_OPTIONAL},
};

vx_kernel_description_t minmaxloc_kernel = {
    VX_KERNEL_MINMAXLOC,
    "org.khronos.openvx.minmaxloc",
    vxMinMaxLocKernel,
    minmaxloc_kernel_params, dimof(minmaxloc_kernel_params),
    NULL,
    vxMinMaxLocInputValidator,
    vxMinMaxLocOutputValidator,
    NULL,
    NULL,
};


开发者ID:eric100lin,项目名称:My-OpenVX-1.1,代码行数:28,代码来源:vx_minmaxloc.c


示例14: dimof

    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_OUTPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};

static vx_param_description_t euclidean_non_max_suppression_harris_params[] = {
    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED}, /* strength_thresh */
    {VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED}, /* min_distance */
    {VX_OUTPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};

vx_kernel_description_t nonmax_kernel = {
    VX_KERNEL_EXTRAS_NONMAXSUPPRESSION,
    "org.khronos.extra.nonmaximasuppression",
    vxNonMaxSuppressionKernel,
    nonmaxsuppression_params, dimof(nonmaxsuppression_params),
    vxNonMaxSuppressionInputValidator,
    vxNonMaxSuppressionOutputValidator,
    NULL,
    NULL,
};

vx_kernel_description_t euclidian_nonmax_harris_kernel = {
    VX_KERNEL_EXTRAS_EUCLIDEAN_NONMAXSUPPRESSION_HARRIS,
    "org.khronos.extra.euclidean_nonmaxsuppression_harris",
    vxEuclideanNonMaxSuppressionHarrisKernel,
    euclidean_non_max_suppression_harris_params, dimof(euclidean_non_max_suppression_harris_params),
    vxEuclideanNonMaxHarrisInputValidator,
    vxEuclideanNonMaxHarrisOutputValidator,
    NULL,
    NULL,
开发者ID:ChiahungTai,项目名称:clairvoyance,代码行数:31,代码来源:vx_nonmax.c


示例15: dimof

void TextRenderHdc::Draw(const char *s, size_t sLen, RectF& bb, bool isRtl) {
    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));
    return Draw(txtConvBuf, strLen, bb, isRtl);
}
开发者ID:Nargesf,项目名称:Sumatrapdf,代码行数:4,代码来源:TextRender.cpp


示例16: dimof

char *ReadAllUtf(const char *filePath, size_t *fileSizeOut, Allocator *allocator)
{
    WCHAR buf[512];
    str::Utf8ToWcharBuf(filePath, str::Len(filePath), buf, dimof(buf));
    return ReadAll(buf, fileSizeOut, allocator);
}
开发者ID:DavidWiberg,项目名称:sumatrapdf,代码行数:6,代码来源:FileUtil.cpp


示例17: JNI_OnLoad

jint JNI_OnLoad(JavaVM* vm, void* reserved)
{
    JNIEnv *env;

	NVThreadInit(vm);
 
    DEBUG("JNI_OnLoad called");
    if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK)
    {
    	DEBUG("Failed to get the environment using GetEnv()");
        return -1;
    }
    JNINativeMethod methods[] =
    {
		{
            "init",
            "()Z",
            (void *) NVEventJNIInit
        },
        {
			"touchEvent",
			"(IIILandroid/view/MotionEvent;)Z",
			(void *) NVEventTouchEvent

        },
        {
			"multiTouchEvent",
			"(IIIIIILandroid/view/MotionEvent;)Z",
			(void *) NVEventMultiTouchEvent

        },
        {
            "keyEvent",
            "(IIILandroid/view/KeyEvent;)Z",
            (void *) NVEventKeyEvent
        },
        {
            "accelerometerEvent",
            "(FFF)Z",
            (void *) NVEventAccelerometerEvent
        },
        {
            "cleanup",
            "()V",
            (void *) NVEventCleanup
        },
		// TODO TBD - this should be done in NVTimeInit(), but we use a different
		// class than most apps.  Need to clean this up, as it is fragile w.r.t.
		// changes in nv_time
        {
            "nvAcquireTimeExtension",
            "()V",
            (void *) nvAcquireTimeExtensionJNI
        },
        {
            "nvGetSystemTime",
            "()J",
            (void *) nvGetSystemTimeJNI
        },
		{
			"setWindowSize",
			"(II)V",
			(void *) NVEventSetWindowSize
		},
        {
            "quitAndWait",
            "()V",
            (void *) NVEventQuitAndWait
        },
        {
            "postCleanup",
            "()V",
            (void *) NVEventPostCleanup
        },
		{
			"resumeEvent",
			"()V",
			(void *) NVEventResumeEvent
		},
		{
			"pauseEvent",
			"()V",
			(void *) NVEventPauseEvent
		},
    };
    jclass k;
    k = (env)->FindClass ("com/nvidia/devtech/NvEventQueueActivity");
    (env)->RegisterNatives(k, methods, dimof(methods));
	
    s_initEGL = env->GetMethodID(k, "InitEGLAndGLES2", "()Z");
    s_finish = env->GetMethodID(k, "finish", "()V");
    s_swap = env->GetMethodID(k, "swapBuffers", "()Z");
    s_makeCurrent = env->GetMethodID(k, "makeCurrent", "()Z");
    s_unMakeCurrent = env->GetMethodID(k, "unMakeCurrent", "()Z");

#ifdef _TIMFUDGE
    s_width = env->GetMethodID(k, "getSurfaceWidth", "()I");
    s_height = env->GetMethodID(k, "getSurfaceHeight", "()I");
#endif

//.........这里部分代码省略.........
开发者ID:lwllovewf2010,项目名称:Crender,代码行数:101,代码来源:nv_event.cpp


示例18: vxReleaseParameter

        vxReleaseParameter(&param);
    }
    return status;
}

static vx_param_description_t filter_kernel_params[] = {
    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_OUTPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};

vx_cl_kernel_description_t box3x3_clkernel = {
    {
        VX_KERNEL_BOX_3x3,
        "org.khronos.openvx.box3x3",
        NULL,
        filter_kernel_params, dimof(filter_kernel_params),
        vxFilterInputValidator,
        vxFilterOutputValidator,
    },
    VX_CL_SOURCEPATH""FILE_JOINER"vx_box3x3.cl",
    "vx_box3x3",
    INIT_PROGRAMS,
    INIT_KERNELS,
    INIT_NUMKERNELS,
    INIT_RETURNS,
    NULL,
};

vx_cl_kernel_description_t gaussian3x3_clkernel = {
    {
        VX_KERNEL_GAUSSIAN_3x3,
开发者ID:ofleischmann,项目名称:vision,代码行数:31,代码来源:vx_filter.c


示例19: vxSetMetaFormatAttribute

                //vxQueryImage(src, VX_IMAGE_ATTRIBUTE_FORMAT, &format, sizeof(format));

                vxSetMetaFormatAttribute(meta, VX_IMAGE_ATTRIBUTE_FORMAT, &format, sizeof(format));
                vxSetMetaFormatAttribute(meta, VX_IMAGE_ATTRIBUTE_WIDTH, &width, sizeof(width));
                vxSetMetaFormatAttribute(meta, VX_IMAGE_ATTRIBUTE_HEIGHT, &height, sizeof(height));
                status = VX_SUCCESS;
                vxReleaseImage(&src);
            }
            vxReleaseParameter(&src_param);
        }
    }
    return status;
}

static vx_param_description_t edge_trace_kernel_params[] = {
    {VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
    {VX_INPUT, VX_TYPE_THRESHOLD,   VX_PARAMETER_STATE_REQUIRED},
    {VX_OUTPUT,VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED},
};

vx_kernel_description_t edge_trace_kernel = {
    VX_KERNEL_EXTRAS_EDGE_TRACE,
    "org.khronos.extra.edge_trace",
    vxEdgeTraceKernel,
    edge_trace_kernel_params, dimof(edge_trace_kernel_params),
    vxEdgeTraceInputValidator,
    vxEdgeTraceOutputValidator,
    NULL,
    NULL,
};
开发者ID:flowyard,项目名称:FlowVX,代码行数:30,代码来源:vx_edge_trace.c


示例20: GeomTest

static void GeomTest()
{
    PointD ptD(12.4, -13.6);
    utassert(ptD.x == 12.4 && ptD.y == -13.6);
    PointI ptI = ptD.ToInt();
    utassert(ptI.x == 12 && ptI.y == -14);
    ptD = ptI.Convert<double>();
    utassert(PointD(12, -14) == ptD);
    utassert(PointD(12.4, -13.6) != ptD);

    SizeD szD(7.7, -3.3);
    utassert(szD.dx == 7.7 && szD.dy == -3.3);
    SizeI szI = szD.ToInt();
    utassert(szI.dx == 8 && szI.dy == -3);
    szD = szI.Convert<double>();
    utassert(SizeD(8, -3) == szD);

    utassert(!szD.IsEmpty() && !szI.IsEmpty());
    utassert(SizeI().IsEmpty() && SizeD().IsEmpty());

    struct SRIData {
        int     x1s, x1e, y1s, y1e;
        int     x2s, x2e, y2s, y2e;
        bool    intersect;
        int     i_xs, i_xe, i_ys, i_ye;
        int     u_xs, u_xe, u_ys, u_ye;
    } testData[] = {
        { 0,10, 0,10,   0,10, 0,10,  true,  0,10, 0,10,  0,10, 0,10 }, /* complete intersect */
        { 0,10, 0,10,  20,30,20,30,  false, 0, 0, 0, 0,  0,30, 0,30 }, /* no intersect */
        { 0,10, 0,10,   5,15, 0,10,  true,  5,10, 0,10,  0,15, 0,10 }, /* { | } | */
        { 0,10, 0,10,   5, 7, 0,10,  true,  5, 7, 0,10,  0,10, 0,10 }, /* { | | } */
        { 0,10, 0,10,   5, 7, 5, 7,  true,  5, 7, 5, 7,  0,10, 0,10 },
        { 0,10, 0,10,   5, 15,5,15,  true,  5,10, 5,10,  0,15, 0,15 },
    };

    for (size_t i = 0; i < dimof(testData); i++) {
        struct SRIData *curr = &testData[i];

        RectI rx1(curr->x1s, curr->y1s, curr->x1e - curr->x1s, curr->y1e - curr->y1s);
        RectI rx2 = RectI::FromXY(curr->x2s, curr->y2s, curr->x2e, curr->y2e);
        RectI isect = rx1.Intersect(rx2);
        if (curr->intersect) {
            utassert(!isect.IsEmpty());
            utassert(isect.x == curr->i_xs && isect.y == curr->i_ys);
            utassert(isect.x + isect.dx == curr->i_xe && isect.y + isect.dy == curr->i_ye);
        }
        else {
            utassert(isect.IsEmpty());
        }
        RectI urect = rx1.Union(rx2);
        utassert(urect.x == curr->u_xs && urect.y == curr->u_ys);
        utassert(urect.x + urect.dx == curr->u_xe && urect.y + urect.dy == curr->u_ye);

        /* if we swap rectangles, the results should be the same */
        std::swap(rx1, rx2);
        isect = rx1.Intersect(rx2);
        if (curr->intersect) {
            utassert(!isect.IsEmpty());
            utassert(isect.x == curr->i_xs && isect.y == curr->i_ys);
            utassert(isect.x + isect.dx == curr->i_xe && isect.y + isect.dy == curr->i_ye);
        }
        else {
            utassert(isect.IsEmpty());
        }
        urect = rx1.Union(rx2);
        utassert(RectI::FromXY(curr->u_xs, curr->u_ys, curr->u_xe, curr->u_ye) == urect);

        utassert(!rx1.Contains(PointI(-2, -2)));
        utassert(rx1.Contains(rx1.TL()));
        utassert(!rx1.Contains(PointI(rx1.x, INT_MAX)));
        utassert(!rx1.Contains(PointI(INT_MIN, rx1.y)));
    }
}
开发者ID:kepazon,项目名称:my_sumatrapdf,代码行数:73,代码来源:BaseUtil_ut.cpp



注:本文中的dimof函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dir函数代码示例发布时间:2022-05-30
下一篇:
C++ dimensions函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap