add_library(${PROJECT_NAME} SHARED ${MV_COMMON_INCLUDE_LIST} ${MV_COMMON_SRC_LIST})
endif()
-TARGET_LINK_LIBRARIES(${MV_COMMON_LIB_NAME} jpeg ${OpenCV_LIBS} capi-media-tool tbm json-glib-1.0)
+TARGET_LINK_LIBRARIES(${MV_COMMON_LIB_NAME} ${OpenCV_LIBS} capi-media-tool tbm json-glib-1.0)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
Name: capi-media-vision
Summary: Media Vision library for Tizen Native API
Version: 0.3.6
-Release: 0
+Release: 1
Group: Multimedia/Framework
License: Apache-2.0 and BSD-2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: zint-devel
BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: dlogutil
-BuildRequires: libjpeg-turbo
-BuildRequires: libjpeg-turbo-devel
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libswscale)
add_library(${PROJECT_NAME} SHARED ${MV_IMAGE_HELPER_INCLUDE_LIST} ${MV_IMAGE_HELPER_SRC_LIST})
endif()
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} jpeg ${OpenCV_LIBS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${OpenCV_LIBS})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
#include <stddef.h>
#include <stdio.h>
-#include <jpeglib.h>
-
/**
* @file ImageHelper.h
* @brief ImageHelper class definition.
unsigned char *pDataBuffer);
/**
- * @brief Convers libjpeg colorspace to the Tizen 'image util' colorspace.
- *
- * @since_tizen 3.0
- * @param [in] inColorspace The libjpeg colorspace to be converted.
- * @param [out] pOutColorspace The Tizen 'image util' colorspace that
- * will be obtained after conversion
- * @return @c 0 on success, otherwise a negative error value
- *
- * @see ImageHelper::convertMVColorspaceToJpeglibColorspace()
- */
- static int convertJpeglibColorspaceToMVColorspace(
- J_COLOR_SPACE inColorspace,
- mv_colorspace_e *pOutColorspace);
-
- /**
- * @brief Convers libjpeg colorspace to the Tizen image util colorspace.
- *
- * @since_tizen 3.0
- * @param [in] inColorspace The Tizen 'image util' colorspace to be
- * converted
- * @param [out] pOutColorspace The libjpeg colorspace that will be
- * obtained after conversion
- * @return @c 0 on success, otherwise a negative error value
- *
- * @see ImageHelper::convertJpeglibColorspaceToMVColorspace()
- */
- static int convertMVColorspaceToJpeglibColorspace(
- mv_colorspace_e inColorspace,
- J_COLOR_SPACE *pOutColorspace);
-
- /**
* @brief Converts image data to the image data of RGB888 colorspace.
*
* @since_tizen 3.0
#include <stdio.h>
#endif
-#include <jpeglib.h>
-
/**
* @file image_helper.h
* @brief Helper functions that provides set of useful methods for image management
unsigned char *data_buffer);
/**
- * @brief Converts libjpeg colorspace to the Tizen 'image util' colorspace.
- *
- * @since_tizen 3.0
- * @param [in] in_colorspace The libjpeg colorspace to be converted.
- * @param [out] out_colorspace The Tizen 'image util' colorspace that
- * will be obtained after conversion
- * @return @c 0 on success, otherwise a negative error value
- *
- * @see convert_mv_colorspace_to_jpeglib_colorspace()
- */
-int convert_jpeglib_colorspace_to_mv_colorspace(
- J_COLOR_SPACE in_colorspace,
- mv_colorspace_e *out_colorspace);
-
-/**
- * @brief Converts libjpeg colorspace to the Tizen image util colorspace.
- *
- * @since_tizen 3.0
- * @param [in] in_colorspace The Tizen 'image util' colorspace to be
- * converted
- * @param [out] out_colorspace The libjpeg colorspace that will be
- * obtained after conversion
- * @return @c 0 on success, otherwise a negative error value
- *
- * @see convert_jpeglib_colorspace_to_mv_colorspace()
- */
-int convert_mv_colorspace_to_jpeglib_colorspace(
- mv_colorspace_e in_colorspace,
- J_COLOR_SPACE *out_colorspace);
-
-/**
* @brief Converts image data to the image data of RGB888 colorspace.
*
* @since_tizen 3.0
return MEDIA_VISION_ERROR_NONE;
}
-int ImageHelper::convertJpeglibColorspaceToMVColorspace(
- J_COLOR_SPACE inColorspace,
- mv_colorspace_e *pOutColorspace)
-{
- if (pOutColorspace == NULL)
- {
- return MEDIA_VISION_ERROR_INVALID_PARAMETER;
- }
-
- switch(inColorspace)
- {
- case JCS_GRAYSCALE:
- (*pOutColorspace) = MEDIA_VISION_COLORSPACE_Y800;
- return MEDIA_VISION_ERROR_NONE;
- case JCS_RGB:
- (*pOutColorspace) = MEDIA_VISION_COLORSPACE_RGB888;
- return MEDIA_VISION_ERROR_NONE;
- default:
- return MEDIA_VISION_ERROR_NOT_SUPPORTED;
- }
-
- return MEDIA_VISION_ERROR_NONE;
-}
-
-int ImageHelper::convertMVColorspaceToJpeglibColorspace(
- mv_colorspace_e inColorspace,
- J_COLOR_SPACE *pOutColorspace)
-{
- // todo: support more colorspaces:
- switch (inColorspace)
- {
- case MEDIA_VISION_COLORSPACE_Y800:
- (*pOutColorspace) = JCS_GRAYSCALE;
- return MEDIA_VISION_ERROR_NONE;
- case MEDIA_VISION_COLORSPACE_RGB888:
- (*pOutColorspace) = JCS_RGB;
- return MEDIA_VISION_ERROR_NONE;
- default:
- return MEDIA_VISION_ERROR_NOT_SUPPORTED;
- }
-
- return MEDIA_VISION_ERROR_NOT_SUPPORTED;
-}
-
int ImageHelper::convertBufferToRGB888(
const unsigned char *pInBuffer,
const ImageData& imageData,
data_buffer);
}
-int convert_jpeglib_colorspace_to_mv_colorspace(
- J_COLOR_SPACE in_colorspace,
- mv_colorspace_e *out_colorspace)
-{
- return ImageHelper::convertJpeglibColorspaceToMVColorspace(in_colorspace, out_colorspace);
-}
-
-int convert_mv_colorspace_to_jpeglib_colorspace(
- mv_colorspace_e in_colorspace,
- J_COLOR_SPACE *out_colorspace)
-{
- return ImageHelper::convertMVColorspaceToJpeglibColorspace(in_colorspace, out_colorspace);
-}
-
int convert_buffer_to_RGB888(
const unsigned char *in_buffer,
const image_data_s *image_data,