Changed a few warnings
This commit is contained in:
parent
e217e99562
commit
af821828b8
|
@ -1117,7 +1117,8 @@ bool Image::Crop( const Box &limits )
|
||||||
return( Crop( limits.LoX(), limits.LoY(), limits.HiX(), limits.HiY() ) );
|
return( Crop( limits.LoX(), limits.LoY(), limits.HiX(), limits.HiY() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not fully complete */
|
/* Far from complete */
|
||||||
|
/* Need to implement all possible of overlays possible */
|
||||||
void Image::Overlay( const Image &image )
|
void Image::Overlay( const Image &image )
|
||||||
{
|
{
|
||||||
if ( !(width == image.width && height == image.height) )
|
if ( !(width == image.width && height == image.height) )
|
||||||
|
@ -1125,11 +1126,7 @@ void Image::Overlay( const Image &image )
|
||||||
Panic( "Attempt to overlay different sized images, expected %dx%d, got %dx%d", width, height, image.width, image.height );
|
Panic( "Attempt to overlay different sized images, expected %dx%d, got %dx%d", width, height, image.width, image.height );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( colours == image.colours && subpixelorder != image.subpixelorder ) {
|
/* Grayscale ontop of grayscale - complete */
|
||||||
Warning("Attempt to overlay images of same format but with different subpixel order.");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Grayscale ontop of grayscale */
|
|
||||||
if ( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_GRAY8 ) {
|
if ( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_GRAY8 ) {
|
||||||
const uint8_t* const max_ptr = buffer+size;
|
const uint8_t* const max_ptr = buffer+size;
|
||||||
const uint8_t* psrc = image.buffer;
|
const uint8_t* psrc = image.buffer;
|
||||||
|
@ -1145,7 +1142,7 @@ void Image::Overlay( const Image &image )
|
||||||
psrc++;
|
psrc++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RGB24 ontop of grayscale - convert to same format first */
|
/* RGB24 ontop of grayscale - convert to same format first - complete */
|
||||||
} else if ( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_RGB24 ) {
|
} else if ( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_RGB24 ) {
|
||||||
Colourise(image.colours, image.subpixelorder);
|
Colourise(image.colours, image.subpixelorder);
|
||||||
|
|
||||||
|
@ -1165,7 +1162,7 @@ void Image::Overlay( const Image &image )
|
||||||
psrc += 3;
|
psrc += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RGB32 ontop of grayscale - convert to same format first */
|
/* RGB32 ontop of grayscale - convert to same format first - complete */
|
||||||
} else if( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_RGB32 ) {
|
} else if( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_RGB32 ) {
|
||||||
Colourise(image.colours, image.subpixelorder);
|
Colourise(image.colours, image.subpixelorder);
|
||||||
|
|
||||||
|
@ -1195,7 +1192,7 @@ void Image::Overlay( const Image &image )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Grayscale ontop of RGB24 */
|
/* Grayscale ontop of RGB24 - complete */
|
||||||
} else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_GRAY8 ) {
|
} else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_GRAY8 ) {
|
||||||
const uint8_t* const max_ptr = buffer+size;
|
const uint8_t* const max_ptr = buffer+size;
|
||||||
const uint8_t* psrc = image.buffer;
|
const uint8_t* psrc = image.buffer;
|
||||||
|
@ -1211,7 +1208,7 @@ void Image::Overlay( const Image &image )
|
||||||
psrc++;
|
psrc++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RGB24 ontop of RGB24 */
|
/* RGB24 ontop of RGB24 - not complete. need to take care of different subpixel orders */
|
||||||
} else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_RGB24 ) {
|
} else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_RGB24 ) {
|
||||||
const uint8_t* const max_ptr = buffer+size;
|
const uint8_t* const max_ptr = buffer+size;
|
||||||
const uint8_t* psrc = image.buffer;
|
const uint8_t* psrc = image.buffer;
|
||||||
|
@ -1233,7 +1230,7 @@ void Image::Overlay( const Image &image )
|
||||||
} else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_RGB32 ) {
|
} else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_RGB32 ) {
|
||||||
Error("Overlay of RGB32 ontop of RGB24 is not supported.");
|
Error("Overlay of RGB32 ontop of RGB24 is not supported.");
|
||||||
|
|
||||||
/* Grayscale ontop of RGB32 */
|
/* Grayscale ontop of RGB32 - complete */
|
||||||
} else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_GRAY8 ) {
|
} else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_GRAY8 ) {
|
||||||
const Rgb* const max_ptr = (Rgb*)(buffer+size);
|
const Rgb* const max_ptr = (Rgb*)(buffer+size);
|
||||||
Rgb* prdest = (Rgb*)buffer;
|
Rgb* prdest = (Rgb*)buffer;
|
||||||
|
@ -1265,7 +1262,7 @@ void Image::Overlay( const Image &image )
|
||||||
} else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_RGB24 ) {
|
} else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_RGB24 ) {
|
||||||
Error("Overlay of RGB24 ontop of RGB32 is not supported.");
|
Error("Overlay of RGB24 ontop of RGB32 is not supported.");
|
||||||
|
|
||||||
/* RGB32 ontop of RGB32 */
|
/* RGB32 ontop of RGB32 - not complete. need to take care of different subpixel orders */
|
||||||
} else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_RGB32 ) {
|
} else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_RGB32 ) {
|
||||||
const Rgb* const max_ptr = (Rgb*)(buffer+size);
|
const Rgb* const max_ptr = (Rgb*)(buffer+size);
|
||||||
Rgb* prdest = (Rgb*)buffer;
|
Rgb* prdest = (Rgb*)buffer;
|
||||||
|
|
|
@ -400,7 +400,7 @@ LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel,
|
||||||
/* Unable to find a solution for the selected palette and target colourspace. Conversion required. Notify the user of performance penalty */
|
/* Unable to find a solution for the selected palette and target colourspace. Conversion required. Notify the user of performance penalty */
|
||||||
} else {
|
} else {
|
||||||
if( capture )
|
if( capture )
|
||||||
Warning("No match for the selected palette and colourspace. Conversion required, performance penalty expected");
|
Info("No direct match for the selected palette and target colorspace. Format conversion is required, performance penalty expected");
|
||||||
#if HAVE_LIBSWSCALE
|
#if HAVE_LIBSWSCALE
|
||||||
/* Try using swscale for the conversion */
|
/* Try using swscale for the conversion */
|
||||||
conversion_type = 1;
|
conversion_type = 1;
|
||||||
|
@ -479,7 +479,7 @@ LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel,
|
||||||
conversion_fptr = &zm_convert_rgb565_rgba;
|
conversion_fptr = &zm_convert_rgb565_rgba;
|
||||||
subpixelorder = ZM_SUBPIX_ORDER_RGBA;
|
subpixelorder = ZM_SUBPIX_ORDER_RGBA;
|
||||||
} else {
|
} else {
|
||||||
Fatal("Unable to find suitable conversion for selected palette and target colourspace.");
|
Fatal("Unable to find a suitable format conversion for the selected palette and target colorspace.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -516,7 +516,7 @@ LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel,
|
||||||
/* Unable to find a solution for the selected palette and target colourspace. Conversion required. Notify the user of performance penalty */
|
/* Unable to find a solution for the selected palette and target colourspace. Conversion required. Notify the user of performance penalty */
|
||||||
} else {
|
} else {
|
||||||
if( capture )
|
if( capture )
|
||||||
Warning("No match for the selected palette and colourspace. Conversion required, performance penalty expected");
|
Info("No direct match for the selected palette and target colorspace. Format conversion is required, performance penalty expected");
|
||||||
#if HAVE_LIBSWSCALE
|
#if HAVE_LIBSWSCALE
|
||||||
/* Try using swscale for the conversion */
|
/* Try using swscale for the conversion */
|
||||||
conversion_type = 1;
|
conversion_type = 1;
|
||||||
|
@ -591,7 +591,7 @@ LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel,
|
||||||
conversion_fptr = &zm_convert_rgb565_rgba;
|
conversion_fptr = &zm_convert_rgb565_rgba;
|
||||||
subpixelorder = ZM_SUBPIX_ORDER_RGBA;
|
subpixelorder = ZM_SUBPIX_ORDER_RGBA;
|
||||||
} else {
|
} else {
|
||||||
Panic("Unable to find suitable conversion for selected palette and target colourspace.");
|
Fatal("Unable to find a suitable format conversion for the selected palette and target colorspace.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -745,8 +745,11 @@ void LocalCamera::Initialise()
|
||||||
v4l2_jpegcompression jpeg_comp;
|
v4l2_jpegcompression jpeg_comp;
|
||||||
if(palette == V4L2_PIX_FMT_JPEG || palette == V4L2_PIX_FMT_MJPEG) {
|
if(palette == V4L2_PIX_FMT_JPEG || palette == V4L2_PIX_FMT_MJPEG) {
|
||||||
if( vidioctl( vid_fd, VIDIOC_G_JPEGCOMP, &jpeg_comp ) < 0 ) {
|
if( vidioctl( vid_fd, VIDIOC_G_JPEGCOMP, &jpeg_comp ) < 0 ) {
|
||||||
Warning("Failed to get JPEG compression options: %s", strerror(errno) );
|
if(errno == EINVAL) {
|
||||||
|
Debug(2,"JPEG compression options are not available", strerror(errno) );
|
||||||
|
} else {
|
||||||
|
Warning("Failed to get JPEG compression options: %s", strerror(errno) );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Set flags and quality. MJPEG should not have the huffman tables defined */
|
/* Set flags and quality. MJPEG should not have the huffman tables defined */
|
||||||
if(palette == V4L2_PIX_FMT_MJPEG) {
|
if(palette == V4L2_PIX_FMT_MJPEG) {
|
||||||
|
|
Loading…
Reference in New Issue