Beispiel #1
0
def normalToColor(N_32F, A_8U=None):
    C_32F = 0.5 * N_32F + 0.5
    C_8U = to8U(C_32F)

    if A_8U is not None:
        C_8U = setAlpha(C_8U, A_8U)

    return C_8U
Beispiel #2
0
def loadData(data_name, L,
             borders=[0.5, 0.8],
             colors=[np.array([0.2, 0.2, 0.5]), np.array([0.3, 0.3, 0.6]), np.array([0.5, 0.5, 0.8])]):

    N_32F, A_8U = normal.loadData(data_name)
    C_32F = toon.diffuse(N_32F, L, borders, colors)

    C_32F = setAlpha(C_32F, to32F(A_8U))
    return C_32F