2021-07-18 08:00 PM
The environment I tested is as follows.
IDE: STM32CubeIDE 1.5.1
Package: STM32F767II
Package software version: 1.16.1
JPEG settings are as below.
However, there is a typo in the config file that is actually generated.
[ jpeg_utils_conf.h ]
#ifndef __JPEG_UTILS_CONF_H__
#define __JPEG_UTILS_CONF_H__
/* Includes ------------------------------------------------------------------*/
#include "stm32f7xx_hal.h"
#include "stm32f7xx_hal_jpeg.h"
/* Private define ------------------------------------------------------------*/
/** @addtogroup JPEG_Private_Defines
* @{
*/
/* RGB Color format definition for JPEG encoding/Decoding : Should not be modified*/
#define JPEG_ARGB8888 0 /* ARGB8888 Color Format */
#define JPEG_RGB888 1 /* RGB888 Color Format */
#define JPEG_RGB565 2 /* RGB565 Color Format */
/*
* Define USE_JPEG_DECODER
*/
#define USE_JPEG_DECODER 1 /* 1 or 0 ********* Value different from default value : 1 ********** */
/*
* Define USE_JPEG_ENCODER
*/
#define USE_JPEG_ENCODER 0 /* 1 or 0 */
/*
* Define JPEG_RGB_FORMAT
*/
#define JPEG_RGB_FORMAT JPEG_RGB888 /* JPEG_ARGB8888, JPEG_RGB888, JPEG_RGB565 ********* Value different from default value : 0 ********** */
/* This is the problem.
* Define JPEG_SWAP_RG
*/
#define JPEG_SWAP_RG 1 /* 0 or 1 */
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
#endif /* __JPEG_UTILS_CONF_H__ */
JPEG_SWAP_RB is correct, not JPEG_SWAP_RG.
For this reason, Red and Blue are not swapable.
2021-07-28 02:18 AM
Hello @Kim KyungTack ,
Swap RED, and Blue offsets if needs to change the color order by setting: * #define JPEG_SWAP_RB 1
This is mentioned in the AN4996 Application note Hardware JPEG codec peripheral:
Optionally red and blue swap can be selected using the #define JPEG_SWAP_RB (set to 1 to swap red and blue order in pixels)
Imen