}
void kds_s2000w_convert_jpg_to_pnm(blobdata* in, blobdata* out)
+{
+ kds_s2000w_convert_jpg_to_pnm_With_depth(in, out, -1);
+}
+
+void kds_s2000w_convert_jpg_to_pnm_With_depth(blobdata* in, blobdata* out, int depth)
{
ExceptionInfo* exception = NULL;
Image* input_image = NULL;
exception = AcquireExceptionInfo();
image_info = CloneImageInfo(NULL);
strcpy(image_info->filename, "streamout.pnm");
+
+ if (depth > -1)
+ SetImageDepth(input_image, depth);
+
out->data = ImageToBlob(image_info, input_image, &out->size, exception);
DestroyImageInfo(image_info);
void kds_s2000w_convert_terminate();
void kds_s2000w_convert_jpg_to_pnm(blobdata* in, blobdata* out);
+void kds_s2000w_convert_jpg_to_pnm_With_depth(blobdata* in, blobdata* out, int depth);
#endif
\ No newline at end of file
fptr = NULL;
kds_s2000w_convert_init();
- kds_s2000w_convert_jpg_to_pnm(&blob, &output);
+ kds_s2000w_convert_jpg_to_pnm_With_depth(&blob, &output, 8);
kds_s2000w_convert_terminate();
fptr = fopen("output.pnm", "w");