Formatting CIColorCube data

后端 未结 3 1204
半阙折子戏
半阙折子戏 2020-12-19 19:23

Recently, I\'ve been trying to set up a CIColorCube on a CIImage to create a custom effect. Here\'s what I have now:

uint8_t color_cube_data[8*4] = {
    0,          


        
3条回答
  •  春和景丽
    2020-12-19 19:29

    I found the issue... I have updated my question if anyone has the same problem!

    The input float array had to be pre-divided out of 255.

    The original used 255:

    uint8_t color_cube_data[8*4] = {
        0, 0, 0, 1,
        255, 0, 0, 1,
        0, 255, 0, 1,
        255, 255, 0, 1,
        0, 0, 255, 1,
        255, 0, 255, 1,
        0, 255, 255, 1,
        255, 255, 255, 1
    };
    

    It should look like this instead:

    uint8_t color_cube_data[8*4] = {
        0, 0, 0, 1,
        1, 0, 0, 1,
        0, 1, 0, 1,
        1, 1, 0, 1,
        0, 0, 1, 1,
        1, 0, 1, 1,
        0, 1, 1, 1,
        1, 1, 1, 1
    };
    

提交回复
热议问题