--wrap,kds_s2000w_client_set_option,\
--wrap,kds_s2000w_client_init,\
--wrap,kds_s2000w_client_free,\
---wrap,kds_s2000w_convert_tiff_to_pnm,\
---wrap,kds_s2000w_convert_jpg_to_pnm_with_depth"
+--wrap,kds_s2000w_image_converter_tiff_to_pnm,\
+--wrap,kds_s2000w_image_converter_jpg_to_pnm"
CACHE STRING "test coverage compiler flags" FORCE)
ENDIF()
if (params->format == 1)
channels = 3;
- kds_s2000w_metadata_from_image(scanner_image, mdata);
+ kds_s2000w_image_converter_metadata_from_jpg(scanner_image, mdata);
params->depth = mdata->depth;
params->pixels_per_line = mdata->width;
params->lines = mdata->height;
if (params->depth > 8) {
params->depth = 8;
- kds_s2000w_convert_jpg_to_pnm_with_depth(scanner_image, image, params->depth);
+ kds_s2000w_image_converter_jpg_to_pnm(scanner_image, image, params->depth);
} else {
- kds_s2000w_convert_tiff_to_pnm(scanner_image, image);
+ kds_s2000w_image_converter_tiff_to_pnm(scanner_image, image);
}
kds_s2000w_debug_printf_int(DEBUG, "size of pnm image", image->size);
#include "kds_s2000w_image_converter.h"
#include "kds_s2000w_debug.h"
-void kds_s2000w_convert_to_pnm_with_depth(blobdata* in,
+void kds_s2000w_image_converter_metadata_from_jpg(blobdata* image, image_metadata* mdata)
+{
+ kds_s2000w_debug_printf(ALL, "kds_s2000w_metadata_from_image");
+
+ ExceptionInfo* exception = AcquireExceptionInfo();
+ ImageInfo* image_info = CloneImageInfo(NULL);
+ sprintf(image_info->filename, "image.pnm");
+
+ Image* input_image = BlobToImage(image_info, image->data, image->size , exception);
+
+ if (exception->severity != UndefinedException) {
+ kds_s2000w_debug_printf(ERROR, GetExceptionMessage(exception->error_number));
+ CatchException(exception);
+ }
+
+ mdata->width = input_image->columns;
+ mdata->height = input_image->rows;
+ mdata->depth = input_image->depth;
+
+ DestroyImageInfo(image_info);
+ image_info = NULL;
+ DestroyImage(input_image);
+ input_image = NULL;
+ DestroyExceptionInfo(exception);
+ exception = NULL;
+}
+
+void _kds_s2000w_image_converter_to_pnm_depth(blobdata* in,
blobdata* out,
int depth,
const char* format)
exception = NULL;
}
-void kds_s2000w_convert_jpg_to_pnm_with_depth(blobdata* in, blobdata* out, int depth)
+void kds_s2000w_image_converter_jpg_to_pnm(blobdata* in, blobdata* out, int depth)
{
kds_s2000w_debug_printf(ALL, "kds_s2000w_convert_jpg_to_pnm_With_depth");
- kds_s2000w_convert_to_pnm_with_depth(in, out, depth, "jpg");
+ _kds_s2000w_image_converter_to_pnm_depth(in, out, depth, "jpg");
}
-void kds_s2000w_convert_tiff_to_pnm(blobdata* in, blobdata* out)
+void kds_s2000w_image_converter_tiff_to_pnm(blobdata* in, blobdata* out)
{
kds_s2000w_debug_printf(ALL, "kds_s2000w_convert_tiff_to_pnm");
- kds_s2000w_convert_to_pnm_with_depth(in, out, -1, "tiff");
-}
-
-void kds_s2000w_metadata_from_image(blobdata* image, image_metadata* mdata)
-{
- kds_s2000w_debug_printf(ALL, "kds_s2000w_metadata_from_image");
-
- ExceptionInfo* exception = AcquireExceptionInfo();
- ImageInfo* image_info = CloneImageInfo(NULL);
- sprintf(image_info->filename, "image.pnm");
-
- Image* input_image = BlobToImage(image_info, image->data, image->size , exception);
-
- if (exception->severity != UndefinedException) {
- kds_s2000w_debug_printf(ERROR, GetExceptionMessage(exception->error_number));
- CatchException(exception);
- }
-
- mdata->width = input_image->columns;
- mdata->height = input_image->rows;
- mdata->depth = input_image->depth;
-
- DestroyImageInfo(image_info);
- image_info = NULL;
- DestroyImage(input_image);
- input_image = NULL;
- DestroyExceptionInfo(exception);
- exception = NULL;
+ _kds_s2000w_image_converter_to_pnm_depth(in, out, -1, "tiff");
}
\ No newline at end of file