blob: 3dde2f11f63143851f105df6cf81dbacf7ea767f [file] [log] [blame]
/*
* function: kernel_hdr_rgb
* sample code of default kernel arguments
* input: image2d_t as read only
* output: image2d_t as write only
*/
" __constant int HDRTable[1024]={104,106,108,109,111,113,114,116,118,119,121,123,125,126,128,130,131,133,135,136,138,139,141,143,144,146,148,149,151,152,154,156,157,159,160,162,164,165,167,168,170,171,173,174,176,177,179,181,182,184,185,187,188,190,191,193,194,195,197,198,200,201,203,204,206,207,209,210,211,213,214,216,217,219,220,221,223,224,226,227,228,230,231,232,234,235,236,238,239,241,242,243,245,246,247,248,250,251,252,254,255,256,258,259,260,261,263,264,265,267,268,269,270,272,273,274,275,277,278,279,280,281,283,284,285,286,287,289,290,291,292,293,295,296,297,298,299,300,302,303,304,305,306,307,308,310,311,312,313,314,315,316,317,318,320,321,322,323,324,325,326,327,328,329,330,331,332,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,367,368,369,370,371,372,373,374,375,376,377,378,379,380,380,381,382,383,384,385,386,387,388,389,389,390,391,392,393,394,395,395,396,397,398,399,400,401,401,402,403,404,405,406,406,407,408,409,410,410,411,412,413,414,415,415,416,417,418,418,419,420,421,422,422,423,424,425,425,426,427,428,429,429,430,431,432,432,433,434,435,435,436,437,437,438,439,440,440,441,442,442,443,444,445,445,446,447,447,448,449,450,450,451,452,452,453,454,454,455,456,456,457,458,458,459,460,460,461,462,462,463,464,464,465,466,466,467,468,468,469,469,470,471,471,472,473,473,474,475,475,476,476,477,478,478,479,479,480,481,481,482,483,483,484,484,485,486,486,487,487,488,488,489,490,490,491,491,492,493,493,494,494,495,495,496,497,497,498,498,499,499,500,501,501,502,502,503,503,504,504,505,506,506,507,507,508,508,509,509,510,510,511,512,512,513,513,514,514,515,515,516,516,517,517,518,518,519,519,520,521,521,522,522,523,523,524,524,525,525,526,526,527,527,528,528,529,529,530,530,531,531,532,532,533,533,534,534,535,535,536,536,537,537,538,538,539,539,540,540,541,541,542,542,543,543,544,544,545,545,546,546,547,547,548,548,549,549,550,550,551,551,552,552,553,553,554,554,554,555,555,556,556,557,557,558,558,559,559,560,560,561,561,562,562,563,563,564,564,565,565,566,566,567,567,568,568,568,569,569,570,570,571,571,572,572,573,573,574,574,575,575,576,576,577,577,578,578,579,579,580,580,581,581,582,582,582,583,583,584,584,585,585,586,586,587,587,588,588,589,589,590,590,591,591,592,592,593,593,594,594,595,595,596,596,597,597,598,598,599,599,600,600,601,601,602,602,603,603,604,604,605,605,606,606,607,607,608,608,609,609,610,611,611,612,612,613,613,614,614,615,615,616,616,617,617,618,618,619,619,620,621,621,622,622,623,623,624,624,625,625,626,627,627,628,628,629,629,630,630,631,632,632,633,633,634,634,635,636,636,637,637,638,638,639,640,640,641,641,642,642,643,644,644,645,645,646,647,647,648,648,649,650,650,651,651,652,653,653,654,654,655,656,656,657,658,658,659,659,660,661,661,662,663,663,664,665,665,666,666,667,668,668,669,670,670,671,672,672,673,674,674,675,676,676,677,678,678,679,680,680,681,682,683,683,684,685,685,686,687,687,688,689,690,690,691,692,692,693,694,695,695,696,697,698,698,699,700,701,701,702,703,704,704,705,706,707,707,708,709,710,710,711,712,713,714,714,715,716,717,718,718,719,720,721,722,722,723,724,725,726,726,727,728,729,730,731,731,732,733,734,735,736,737,737,738,739,740,741,742,743,744,744,745,746,747,748,749,750,751,752,752,753,754,755,756,757,758,759,760,761,762,763,764,765,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,800,801,802,803,804,805,806,807,808,809,810,811,812,814,815,816,817,818,819,820,821,822,824,825,826,827,828,829,830,832,833,834,835,836,837,839,840,841,842,843,845,846,847,848,849,851,852,853,854,855,857,858,859,860,862,863,864,865,867,868,869,870,872,873,874,876,877,878,880,881,882,883,885,886,887,889,890,891,893,894,895,897,898,900,901,902,904,905,906,908,909,911,912,913,915,916,918,919,920,922,923,925,926,928,929,931,932,933,935,936,938,939,941,942,944,945,947,948,950,951,953,954,956,957,959,961,962,964,965,967,968,970,972,973,975,976,978,979,981,983,984,986,988,989,991,992,994,996,997,999,1001,1002,1004,1006,1007,1009,1011,1012,1014,1016,1017,1019,1021,1023}; "
"__kernel void kernel_hdr_rgb (__read_only image2d_t input, __write_only image2d_t output) "
"{ "
" int x = get_global_id (0); "
" int y = get_global_id (1); "
" sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST; "
" "
" int2 pos = (int2)(x, y); "
" float4 pixel_in,pixel_out; "
" pixel_in = read_imagef(input, sampler, pos); "
" pixel_out.x = convert_float(HDRTable[convert_int(pixel_in.x*1024)]/1024.0); "
" pixel_out.y = 0.0; "
" pixel_out.z = 0.0; "
" pixel_out.w = 1.0; "
" write_imagef(output, pos, pixel_out); "
"} "