/* gamma.c: gamma correction test images */ #include "render.h" #include "camera.h" #include "tonemapping.h" #include "error.h" #include "pools.h" static float Dither(int i, int j, float shade) { static unsigned char dither[16][16] = { { 0,240, 80,160, 48,192, 96,144, 16,224, 64,176, 32,208,112,128}, {136,120,216, 40,184, 72,232, 24,152,104,200, 56,168, 88,248, 8}, { 68,180, 20,228,116,132, 36,212, 84,164, 4,244,100,148, 52,196}, {204, 60,156,108,252, 12,172, 92,220, 44,140,124,236, 28,188, 76}, { 34,210,114,130, 18,226, 66,178, 50,194, 98,146, 2,242, 82,162}, {170, 90,250, 10,154,106,202, 58,186, 74,234, 26,138,122,218, 42}, {102,150, 54,198, 86,166, 6,246,118,134, 38,214, 70,182, 22,230}, {238, 30,190, 78,222, 46,142,126,254, 14,174, 94,206, 62,158,110}, { 17,225, 65,177, 33,209,113,129, 1,241, 81,161, 49,193, 97,145}, {153,105,201, 57,169, 89,249, 9,137,121,217, 41,185, 73,233, 25}, { 85,165, 5,245,101,149, 53,197, 69,181, 21,229,117,133, 37,213}, {221, 45,141,125,237, 29,189, 77,205, 61,157,109,253, 13,173, 93}, { 51,195, 99,147, 3,243, 83,163, 35,211,115,131, 19,227, 67,179}, {187, 75,235, 27,139,123,219, 43,171, 91,251, 11,155,107,203, 59}, {119,135, 39,215, 71,183, 23,231,103,151, 55,199, 87,167, 7,247}, {255, 15,175, 95,207, 63,159,111,239, 31,191, 79,223, 47,143,127} }; return ((shade*256) > dither[i%16][j%16] ? 1. : 0.); } static void MakeTestImg1(RGB *img) { int i, j; RGB *pix; j = 0; pix = img; while (j < Camera.vres/6) { /* continuous blue band */ for (i=0; i