comparison Plugins/Samples/Basic/Plugin.c @ 1043:be849646b2bf

sample
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 17 Jul 2014 15:59:06 +0200
parents 8d1845feb277
children 6d90e2bcab60
comparison
equal deleted inserted replaced
1042:8d1845feb277 1043:be849646b2bf
86 uint32_t x, y, value; 86 uint32_t x, y, value;
87 87
88 if (request->method != OrthancPluginHttpMethod_Get) 88 if (request->method != OrthancPluginHttpMethod_Get)
89 { 89 {
90 OrthancPluginSendMethodNotAllowed(context, output, "GET"); 90 OrthancPluginSendMethodNotAllowed(context, output, "GET");
91 return -1; 91 }
92 } 92 else
93 93 {
94 value = 0; 94 value = 0;
95 for (y = 0; y < 256; y++) 95 for (y = 0; y < 256; y++)
96 {
97 for (x = 0; x < 256; x++, value++)
98 { 96 {
99 buffer[value] = value; 97 for (x = 0; x < 256; x++, value++)
98 {
99 buffer[value] = value;
100 }
100 } 101 }
101 } 102
102 103 OrthancPluginCompressAndAnswerPngImage(context, output, OrthancPluginPixelFormat_Grayscale16,
103 OrthancPluginCompressAndAnswerPngImage(context, output, OrthancPluginPixelFormat_Grayscale16, 104 256, 256, sizeof(uint16_t) * 256, buffer);
104 256, 256, sizeof(uint16_t) * 256, buffer); 105 }
106
105 return 0; 107 return 0;
106 } 108 }
107 109
108 110
109 ORTHANC_PLUGINS_API int32_t Callback3(OrthancPluginRestOutput* output, 111 ORTHANC_PLUGINS_API int32_t Callback3(OrthancPluginRestOutput* output,