Graphics framework for GR-PEACH. When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

Dependents:   ImageZoomInout_Sample ImageRotaion_Sample ImageScroll_Sample GR-PEACH_LCD_4_3inch_Save_to_USB ... more

License

When you use this library, we judge you have agreed to the following contents.

https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

Note

If you import the GraphicsFramework library, please import GR-PEACH_video library and R_BSP library together.



JPEG Converter

The JPEG Converter driver implements encode and decode functionality which uses the JCU of the RZ/A Series.

Hello World!

Import programJCU_HelloWorld

Hello World for JCU(JPEG Codec Unit). JCU is JPEG codec unit of RZ/A1. When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

API

Import library

Data Structures

struct bitmap_buff_info_t
Bitmap data setting struct. More...
struct encode_options_t
Encode option setting. More...

Public Types

enum jpeg_conv_error_t {
JPEG_CONV_OK = 0, JPEG_CONV_JCU_ERR = -1, JPEG_CONV_FORMA_ERR = -2, JPEG_CONV_PARAM_ERR = -3,
JPEG_CONV_BUSY = -4, JPEG_CONV_PARAM_RANGE_ERR = -7
}

Error codes.

More...
enum wr_rd_swa_t {
WR_RD_WRSWA_NON = 0, WR_RD_WRSWA_8BIT = 1, WR_RD_WRSWA_16BIT = 2, WR_RD_WRSWA_16_8BIT = 3,
WR_RD_WRSWA_32BIT = 4, WR_RD_WRSWA_32_8BIT = 5, WR_RD_WRSWA_32_16BIT = 6, WR_RD_WRSWA_32_16_8BIT = 7
}

Write/Read image pixcel frame buffer swap setting.

More...
enum wr_rd_format_t { WR_RD_YCbCr422 = 0x00, WR_RD_ARGB8888 = 0x01, WR_RD_RGB565 = 0x02 }

Write/Read image pixcel format selects.

More...
enum sub_sampling_t { SUB_SAMPLING_1_1 = 0x00, SUB_SAMPLING_1_2 = 0x01, SUB_SAMPLING_1_4 = 0x02, SUB_SAMPLING_1_8 = 0x03 }

Thinning output image selects.

More...
enum cbcr_offset_t { CBCR_OFFSET_0 = 0x00, CBCR_OFFSET_128 = 0x01 }

Cb/Cr range selects for decode.

More...

Public Member Functions

JPEG_Converter ()
Constructor method of JPEG converter(encode/decode)
virtual ~JPEG_Converter ()
Destructor method of JPEG converter(encode/decode)
JPEG_Converter::jpeg_conv_error_t decode (void *pJpegBuff, bitmap_buff_info_t *psOutputBuff)
Decode JPEG to rinear data.
JPEG_Converter::jpeg_conv_error_t decode (void *pJpegBuff, bitmap_buff_info_t *psOutputBuff, decode_options_t *pOptions)
JPEG data decode to bitmap.
JPEG_Converter::jpeg_conv_error_t encode ( bitmap_buff_info_t *psInputBuff, void *pJpegBuff, size_t *pEncodeSize)
Encode rinear data to JPEG.
JPEG_Converter::jpeg_conv_error_t encode ( bitmap_buff_info_t *psInputBuff, void *pJpegBuff, size_t *pEncodeSize, encode_options_t *pOptions)
Bitmap data encode to JPEG.
JPEG_Converter::jpeg_conv_error_t SetQuality (const uint8_t qual)
Set encode quality.

Correspondence file

A correspondence file of JPEG Converter is as the following table.

JPEGCorrespondence
Width>0(greater than 0)
Height>0(greater than 0)
Color formatYCbCr444, YCbCr422, YCbCr420, YCbCr411
BitmapCorrespondence
Width>0(greater than 0)
Height>0(greater than 0)
Color formatYCbCr422

Notice

You run JPEG converter once destruction each time.

You set whether these JPEG files aren't input, or it check error setting decode(set in "flag" = true). The JPEG file which becomes correspondence outside will be the following condition.

  • File besides the above-mentioned correspondence file.
  • As information in the JPEG file, WIDTH or HEIGHT is larger than output buffer setting.

Buffer area is used encode/decode, set 8 bytes align and non-cash memory area. The output buffer when decoding, is made beyond the size decided in the size of the JPEG file, the format, setting of thinning out. You make output buffer for decode/encode to enough big size in order to stock this result. JPEG Converter, if you do not particularly perform specified, does not check size against the output data at the time of encoding and decoding. You set the output buffer so that there is no effect of corruption by the output data.

Color format

Color format in case to be converted from Bitmap to JPEG is either ARGB8888 or RGB555, YCbCr422. Color format of the If you want to convert from JPEG file to Bitmap file is YCbCr422. You correct "alpha(member of decode_options_t)" of setting and "output_cb_cr_offset(member of decode_options_t)" according to color format when decoding.

  • example
    decode to ARGB8888(WR_RD_ARGB8888 set in format member of bitmap_buff_info_t)
    alpha = 0x01-0xFF
    output_cb_cr_offset = CBCR_OFFSET_0

    decode to YCbCr422(WR_RD_YCbCr422 set in format member of bitmap_buff_info_t)
    alpha = 0
    output_cb_cr_offset = CBCR_OFFSET_0 or CBCR_OFFSET_128

    decode to RGB565(WR_RD_RGB565 set in format member of bitmap_buff_info_t)
    alpha = 0
    output_cb_cr_offset = CBCR_OFFSET_0

Decode/encode settings are optional

If omitted encode/decode settings, it will work with the following settings.
[Decode option setting (member of decode_options_t)]

  • Vertical sub sampling is thinning output image to 1/1.
  • Horizontal sub sampling is thinning output image to 1/1.
  • Output data of Cb/Cr range is -128 to 127.
  • Output data of swap in 8-bit units: 2-1-4-3-6-5-8-7.
  • Alpha value of 0.
  • JPEG format correspondence outside error check.
  • It decode in a synchronous function.

[Encode option setting (member of encode_options_t)]

  • DRI value is 0.
  • Encoding JPEG file start width offset is 0.
  • Encoding JPEG file start height offset is 0.
  • Input data of Cb/Cr range of input data is -128 to 127.
  • Input data swap in 8-bit units: 2-1-4-3-6-5-8-7.
  • It don't check encode size.
  • Quantization Y use default table(Quality75).
  • Quantization C use default table(Quality75).
  • Huffman Y DC use default table.
  • Huffman C DC use default table.
  • Huffman Y AC use default table.
  • Huffman C AC use default table.
  • It encode in a synchronous function.

Synchronous/asynchronous switching

Decoding and encoding setting to operate asynchronously by setting a callback function(decode_options_t and encode_options_t).

Quality

Quality changes are possible. If you want to change the Quality, please specify the table made of Quality you want to change the address of the setting. If you do not want to change the Quality, it will operate at Quality75.

RGA

The RGA library implements fast drawing functionality which uses the RGA of the RZ/A Series.
Supporting compiler is ARMCC, GCC ARM and IAR.

Hello World!

Import programRGA_HelloWorld

Hello World for RGA(Renesas Graphics Architecture). RGA is the Graphics Library of RZ/A1. When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

ospl/inc/r_multi_compiler_typedef.h

Committer:
dkato
Date:
2017-04-24
Revision:
13:1ee2176ef13f
Parent:
0:37e1e6a45ced

File content as of revision 13:1ee2176ef13f:

/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2015 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/**
* @file  r_multi_compiler_typedef.h
* @brief   Compiler Porting Layer. Data types.
*
* $Module: OSPL $ $PublicVersion: 0.90 $ (=R_OSPL_VERSION)
* $Rev: 42 $
* $Date:: 2014-06-03 16:54:02 +0900#$
*/

#ifndef R_MULTI_COMPILER_TYPEDEF_H
#define R_MULTI_COMPILER_TYPEDEF_H


/******************************************************************************
Includes   <System Includes> , "Project Includes"
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */


/******************************************************************************
Typedef definitions
******************************************************************************/

/******************************************************************************
Macro definitions
******************************************************************************/

/**
* @def  R_OSPL_SECTION_INLINE_VERSION
* @brief  R_OSPL_SECTION_INLINE_VERSION
* @par Parameters
*    None
* @return  None.
*/
#define R_OSPL_SECTION_INLINE_VERSION  4


/**
* @def  R_OSPL_LIST_UP_INLINE_BODY
* @brief  Define or not define
* @par Parameters
*    None
* @return  None.
*/
/* #define  R_OSPL_LIST_UP_INLINE_BODY */


/**
* @def  R_OSPL_MAKE_INLINE_BODY
* @brief  Define or not define
* @par Parameters
*    None
* @return  None.
*/
/* #define  R_OSPL_MAKE_INLINE_BODY */


/**
* @def  INLINE
* @brief  Inline function
* @par Parameters
*    None
* @return  None.
*
* @par Description
*    "__INLINE" is reserved by compiler.
*/
/* ->QAC 1252 : QAC considers that && is not short-circuit evaluation */
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L  &&  ! defined( __ICCARM__ ) /* For C99 */ \
&&  ! IS_MBED_USED  ||  defined( __cplusplus )
/* <-QAC 1252 */
#if defined( R_OSPL_MAKE_INLINE_BODY )  &&  ! defined( R_OSPL_LIST_UP_INLINE_BODY )
#define  INLINE  extern inline
#else
#define  INLINE  inline
#endif

/* ->QAC 1252 : QAC considers that && is not short-circuit evaluation */
#elif defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L  &&  defined( __ICCARM__ ) /* For IAR C99 */
/* <-QAC 1252 */
#if defined( R_OSPL_MAKE_INLINE_BODY )
#define  INLINE
/* "extern inline" raises a error, if with "@" operator */
#else
#define  INLINE  inline  /* Special inline */
#endif

#elif defined( __CC_ARM )  &&  ! defined( __GNUC__ )  /* For ARMCC not C99, not -gnu */
#if defined( R_OSPL_MAKE_INLINE_BODY )  &&  ! defined( R_OSPL_LIST_UP_INLINE_BODY )
#if R_OSPL_LIBRARY_MAKING
#define  INLINE  static __inline
#else
#define  INLINE  extern __inline  /* Special inline */
#endif
#else
#if R_OSPL_LIBRARY_MAKING
#define  INLINE  static __inline
#else
#define  INLINE  extern __inline  /* Special inline */
#endif
#endif
/* Function bodys are in shared "i.<FunctionName>" section */

#elif defined( __GNUC__ )  /* For gcc */
#if  IS_MBED_USED
#define  INLINE  static __inline
#else
#if defined( R_OSPL_MAKE_INLINE_BODY )  &&  ! defined( R_OSPL_LIST_UP_INLINE_BODY )
#define  INLINE  __inline__  /* extern inline of C99 */
#else
#define  INLINE  extern __inline__  /* inline of C99 */
#endif
#endif

#elif defined( _SH )  /* For SH compiler */
#if defined( R_OSPL_MAKE_INLINE_BODY )  &&  ! defined( R_OSPL_LIST_UP_INLINE_BODY )
#define  INLINE
#else
#define  INLINE  static
/* "extern" is ignored, if 'C1400 (W) Function "..." in #pragma inline is not expanded' */
#endif
/* No inline qualifier */
/* #ifdef _SH */
/* #pragma inline <function_name> */
/* #endif */

#else
#error
#endif


/**
* @def  STATIC_INLINE
* @brief  Static inline in C source file
* @par Parameters
*    None
* @return  None.
*
* @par Description
*    "__STATIC_INLINE" is reserved by compiler.
*/

#ifndef  __cplusplus

#ifdef __CC_ARM
#define  STATIC_INLINE  static __inline
#endif

#ifdef __ICCARM__
#define  STATIC_INLINE  static inline
#endif

#if  defined( __GNUC__ )  &&  ! defined( __CC_ARM )
#define  STATIC_INLINE  static inline
#endif

#else

#define  STATIC_INLINE  static inline

#endif  /* __cplusplus */


/**
* @def  R_OSPL_SECTION
* @brief  Names section name to function or varaible
* @par Parameters
*    None
* @return  None.
*/
/**
* @def  R_OSPL_SECTION_FOR_ZERO_INIT
* @brief  Names section name to zero initialized varaible
* @par Parameters
*    None
* @return  None.
*/
/* ->MISRA 19.10 : Cannot ( ) */ /* ->MISRA 19.7 : Cannot function */ /* ->SEC M5.1.3 */
#if defined( __CC_ARM )
#define  R_OSPL_SECTION( SectionName, Declaration ) \
		__attribute__ ((section (SectionName)))  Declaration

#define  R_OSPL_SECTION_FOR_ZERO_INIT( SectionName, Declaration ) \
		__attribute__ ((section (SectionName), zero_init))  Declaration

#elif defined( __GNUC__ )  &&  ! defined( __CC_ARM )
#define  R_OSPL_SECTION( SectionName, Declaration ) \
		__attribute__ ((section (SectionName)))  Declaration

#define  R_OSPL_SECTION_FOR_ZERO_INIT( SectionName, Declaration ) \
		__attribute__ ((section (SectionName)))  Declaration

#elif defined( __ICCARM__ )
#define  R_OSPL_SECTION( SectionName, Declaration ) \
		Declaration @ SectionName

#define  R_OSPL_SECTION_FOR_ZERO_INIT( SectionName, Declaration ) \
		Declaration @ SectionName

#elif defined( _SH )  /* For SH compiler */
#define  R_OSPL_SECTION( SectionName, Declaration ) \
		Declaration
/* No section qualifier */
/* #ifdef _SH */
/* #pragma section <section_name> */
/* #endif */
/*   :   */
/* <Not extern code> */
/*   :   */
/* #ifdef _SH */
/* #pragma section */
/* #endif */

#define  R_OSPL_SECTION_FOR_ZERO_INIT( SectionName, Declaration ) \
		Declaration

#else
#error
#endif
/* <-MISRA 19.10 */ /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */


/**
* @def  R_OSPL_SECTION_FOR_INLINE
* @brief  Names section name to inline function
* @par Parameters
*    None
* @return  None.
*/
/* ->MISRA 19.10 : Cannot ( ) */ /* ->MISRA 19.7 : Cannot function */ /* ->SEC M5.1.3 */
#if defined( __CC_ARM )  ||  defined( __GNUC__ )
#if defined( R_OSPL_LIST_UP_INLINE_BODY )
#define  R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
			__attribute__ ((section ("INLINE_BODY")))  Declaration
#else
#define  R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
			__attribute__ ((section (SectionName)))  Declaration
#endif

#elif defined( __ICCARM__ )
#if defined( R_OSPL_MAKE_INLINE_BODY )
#if defined( R_OSPL_LIST_UP_INLINE_BODY )
#define  R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
				Declaration @ "INLINE_BODY"
#else
#define  R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
				Declaration @ SectionName
#endif
#else
#define  R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
			Declaration
#endif

#elif defined( _SH )  /* For SH compiler */
#define  R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
		Declaration
/* No section qualifier */
/* #ifdef _SH */
/* #pragma section <section_name> */
/* #endif */
/*   :   */
/* <Not extern code> */
/*   :   */
/* #ifdef _SH */
/* #pragma section */
/* #endif */

#else
#error
#endif
/* <-MISRA 19.10 */ /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */


/**
* @def  R_OSPL_ALIGNMENT
* @brief  Alignments first addres of global variable
* @param   ByteCount Value of alignment
* @param   Declaration_with_Semicolon Declaration of the variable
* @return  None.
*/
/* ->MISRA 19.10 : Cannot ( ) */ /* ->MISRA 19.7 : Cannot function */ /* ->SEC M5.1.3 */
#if defined( __CC_ARM )
#define  R_OSPL_ALIGNMENT( ByteCount, Declaration_with_Semicolon ) \
		__align( ByteCount )  Declaration_with_Semicolon

#elif defined( __GNUC__ )  &&  ! defined( __CC_ARM )
#define  R_OSPL_ALIGNMENT( ByteCount, Declaration_with_Semicolon ) \
		__attribute__((aligned( ByteCount )))  Declaration_with_Semicolon

#elif defined( __ICCARM__ )
#define  R_OSPL_ALIGNMENT( ByteCount, Declaration_with_Semicolon ) \
		R_OSPL_ALIGNMENT_SUB( ByteCount, Declaration_with_Semicolon )
#define  R_OSPL_ALIGNMENT_SUB( ByteCount, Declaration_with_Semicolon ) \
		_Pragma( "diag_suppress=Pe606" ) \
		_Pragma( "diag_suppress=Pa060" ) \
		_Pragma( "diag_suppress=Pe609" ) \
		R_OSPL_ALIGNMENT_##ByteCount() \
		Declaration_with_Semicolon \
		R_OSPL_ALIGNMENT_##0x4()
/* align 0x4 must be written after ";" */

#define  R_OSPL_ALIGNMENT_0x4()      _Pragma( "data_alignment=0x4" )
#define  R_OSPL_ALIGNMENT_0x8()      _Pragma( "data_alignment=0x8" )
#define  R_OSPL_ALIGNMENT_0x10()     _Pragma( "data_alignment=0x10" )
#define  R_OSPL_ALIGNMENT_0x20()     _Pragma( "data_alignment=0x20" )
#define  R_OSPL_ALIGNMENT_0x40()     _Pragma( "data_alignment=0x40" )
#define  R_OSPL_ALIGNMENT_0x80()     _Pragma( "data_alignment=0x80" )
#define  R_OSPL_ALIGNMENT_0x100()    _Pragma( "data_alignment=0x100" )
#define  R_OSPL_ALIGNMENT_0x200()    _Pragma( "data_alignment=0x200" )
#define  R_OSPL_ALIGNMENT_0x400()    _Pragma( "data_alignment=0x400" )
#define  R_OSPL_ALIGNMENT_0x800()    _Pragma( "data_alignment=0x800" )
#define  R_OSPL_ALIGNMENT_0x1000()   _Pragma( "data_alignment=0x1000" )
#define  R_OSPL_ALIGNMENT_0x2000()   _Pragma( "data_alignment=0x2000" )
#define  R_OSPL_ALIGNMENT_0x4000()   _Pragma( "data_alignment=0x4000" )
#define  R_OSPL_ALIGNMENT_0x8000()   _Pragma( "data_alignment=0x8000" )
#define  R_OSPL_ALIGNMENT_0x10000()  _Pragma( "data_alignment=0x10000" )
#define  R_OSPL_ALIGNMENT_0x20000()  _Pragma( "data_alignment=0x20000" )
#define  R_OSPL_ALIGNMENT_0x40000()  _Pragma( "data_alignment=0x40000" )
#define  R_OSPL_ALIGNMENT_0x80000()  _Pragma( "data_alignment=0x80000" )
#define  R_OSPL_ALIGNMENT_0x100000() _Pragma( "data_alignment=0x100000" )

#define  R_OSPL_ALIGNMENT_4()        _Pragma( "data_alignment=4" )
#define  R_OSPL_ALIGNMENT_8()        _Pragma( "data_alignment=8" )
#define  R_OSPL_ALIGNMENT_16()       _Pragma( "data_alignment=16" )
#define  R_OSPL_ALIGNMENT_32()       _Pragma( "data_alignment=32" )
#define  R_OSPL_ALIGNMENT_64()       _Pragma( "data_alignment=64" )
#define  R_OSPL_ALIGNMENT_128()      _Pragma( "data_alignment=128" )
#define  R_OSPL_ALIGNMENT_256()      _Pragma( "data_alignment=256" )
#define  R_OSPL_ALIGNMENT_512()      _Pragma( "data_alignment=512" )
#define  R_OSPL_ALIGNMENT_1024()     _Pragma( "data_alignment=1024" )
#define  R_OSPL_ALIGNMENT_2048()     _Pragma( "data_alignment=2048" )
#define  R_OSPL_ALIGNMENT_4096()     _Pragma( "data_alignment=4096" )
#define  R_OSPL_ALIGNMENT_8192()     _Pragma( "data_alignment=8192" )
#define  R_OSPL_ALIGNMENT_16384()    _Pragma( "data_alignment=16384" )
#define  R_OSPL_ALIGNMENT_32768()    _Pragma( "data_alignment=32768" )
#define  R_OSPL_ALIGNMENT_65536()    _Pragma( "data_alignment=65536" )

#elif defined( _SH )
#define  R_OSPL_ALIGNMENT( ByteCount, Declaration_with_Semicolon ) \
		Declaration_with_Semicolon
/* No alignment qualifier */
/* Set aligned address by "Map section information" */

#else
#error
#endif
/* <-MISRA 19.10 */ /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */


/* Form: C Language Header */
/******************************************************************************
Variable Externs
******************************************************************************/

/******************************************************************************
Functions Prototypes
******************************************************************************/
/* In "r_multi_compiler.h" */

/***********************************************************************
* End of File:
************************************************************************/
#ifdef __cplusplus
}  /* End of extern "C" */
#endif /* __cplusplus */

#endif /* R_MULTI_COMPILER_TYPEDEF_H */