当前位置: 首页>>代码示例>>C++>>正文


C++ Adafruit_ILI9341::Color565方法代码示例

本文整理汇总了C++中Adafruit_ILI9341::Color565方法的典型用法代码示例。如果您正苦于以下问题:C++ Adafruit_ILI9341::Color565方法的具体用法?C++ Adafruit_ILI9341::Color565怎么用?C++ Adafruit_ILI9341::Color565使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Adafruit_ILI9341的用法示例。


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

示例1: testFilledTriangles

unsigned long testFilledTriangles() {
    unsigned long start, t = 0;
    int i, cx = tft.width() / 2 - 1,
            cy = tft.height() / 2 - 1;

    tft.fillScreen(ILI9341_BLACK);
    start = micros();
    for (i = min(cx, cy); i > 10; i -= 5) {
        start = micros();
        tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
                tft.Color565(0, i, i));
        t += micros() - start;
        tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
                tft.Color565(i, i, 0));
    }

    return t;
}
开发者ID:albal,项目名称:spark,代码行数:18,代码来源:application.cpp

示例2: testFilledRoundRects

unsigned long testFilledRoundRects() {
    unsigned long start;
    int i, i2,
            cx = tft.width() / 2 - 1,
            cy = tft.height() / 2 - 1;

    tft.fillScreen(ILI9341_BLACK);
    start = micros();
    for (i = min(tft.width(), tft.height()); i > 20; i -= 6) {
        i2 = i / 2;
        tft.fillRoundRect(cx - i2, cy - i2, i, i, i / 8, tft.Color565(0, i, 0));
    }

    return micros() - start;
}
开发者ID:albal,项目名称:spark,代码行数:15,代码来源:application.cpp

示例3: testRoundRects

unsigned long testRoundRects() {
    unsigned long start;
    int w, i, i2,
            cx = tft.width() / 2 - 1,
            cy = tft.height() / 2 - 1;

    tft.fillScreen(ILI9341_BLACK);
    w = min(tft.width(), tft.height());
    start = micros();
    for (i = 0; i < w; i += 6) {
        i2 = i / 2;
        tft.drawRoundRect(cx - i2, cy - i2, i, i, i / 8, tft.Color565(i, 0, 0));
    }

    return micros() - start;
}
开发者ID:albal,项目名称:spark,代码行数:16,代码来源:application.cpp

示例4: testTriangles

unsigned long testTriangles() {
    unsigned long start;
    int n, i, cx = tft.width() / 2 - 1,
            cy = tft.height() / 2 - 1;

    tft.fillScreen(ILI9341_BLACK);
    n = min(cx, cy);
    start = micros();
    for (i = 0; i < n; i += 5) {
        tft.drawTriangle(
                cx, cy - i, // peak
                cx - i, cy + i, // bottom left
                cx + i, cy + i, // bottom right
                tft.Color565(0, 0, i));
    }

    return micros() - start;
}
开发者ID:albal,项目名称:spark,代码行数:18,代码来源:application.cpp

示例5: testRandomRects

unsigned long testRandomRects() {
    unsigned long start;
    int r, g, b, t, x, y, size = 16;
    float i = 0.0f;
    float pi = 3.1459; // 180 degrees

    start = micros();
    for (i = 0.0f; i < 2 * pi; i += (pi / 360.0)) {
        r = (sin(i) * 127) + 128;
        g = (sin(i + ((2 * pi) / 3.0)) * 127) + 128;
        b = (sin(i + ((4 * pi) / 3.0)) * 127) + 128;

        y = random(320 / size);
        x = random(240 / size);
        tft.fillRect(x * size, y*size, size, size, tft.Color565(r, g, b));
    }

    return micros() - start;
}
开发者ID:albal,项目名称:spark,代码行数:19,代码来源:application.cpp


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