Home
RZ/A1H Group Graphics Library RGA
Contents
1. 76 6 9 8 Functions Related to WindowSurfacesClass esses 77 6 9 9 Functions Equivalent to window surfaces t Class Member Functions 80 6 9 10 Functions Related to byte per pixel t Class 84 6 9 11 Functions Related to v sync t Class ssssssssssssseseseenen enne enne 85 6 9 12 Functions Related to ex stack t class 88 6 9 13 Functions Related to animation timing function t class 89 6 9 14 Other a 91 6 9 15 Functions m umo 93 6 10 Poning layer Functions nennen E EEEE AAEE sain nnns eren 94 6 10 1 Functions on Default Settings of 94 6 10 2 Porting layer functions of OSPL sess enne nennen nnn entente 96 6 10 3 Porting layer functions of RGPNGG cecececeeceeeeee cesses ceeeeeseaeeeeaaeeeeaeeseaeeesaeeeeaeeeeeeeeaas 97 6 11 Supplementary 101 6 11 1 Correspondence to Canvas 2D and Correspondence to Hardware Acceleration 101 6 11 2 Identifying Image Format sssssssssseseseeenenenn
2. Section Function Name Description 6 9 11 2 V SYNC Initialize Attaches to the V Sync interrupt 6 9 11 3 SYNC Finalize Detaches from the V Sync interrupt 6 9 11 4 R V SYNC Wait Waits until the V Sync interrupt enters 6 9 11 5 R V SYNC WeaitStart Starts to wait for V Sync interrupt 6 9 11 6 R V SYNC Onlnterrupting Receives V Sync interrupt 6 9 11 7 R V SYNC GetAsyncStatus Gets the status of asynchronous operation and interrupt 6 9 112 R V SYNC Initialize V SYNC Initialize Outline Attaches to the V Sync interrupt Header RGA h h vsync h Declaration errnum t R V SYNC Initialize int fast32 t ChannelNum Description Calls back the porting layer function of the interrupt from inside of this function When the V Sync interrupt has already been attached an error occurs When the V Sync interrupt is controlled by the application this function cannot be used This function is used in the window surfaces t class The v sync t class cannot be used when the window surfaces t class is used Argument int fast32 t ChannelNum Channel number of the screen Return value Error code If there is no error the return value is O 6 9 113 V SYNC Finalize V SYNC Finalize Outline Detaches from the V Sync interrupt Header RGA h h vsync h Declaration errnum t R V SYNC Finalize int fast32 t ChannelNum errnum t e Description Argument int fast32 t ChannelNum Channel number of
3. nnne nnns 104 6 11 3 Changing and RGAS sse ener tenen 105 RO1AN2162EJ0200 Rev 2 00 Page 2 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 11 4 Flush MOGG 106 6 11 5 Using SDRAMs 107 6 11 6 Layer structure of sample screen controller 108 6 11 7 Flagged Structure Parameters sss enne enne 109 6 11 8 1 95 2 2 rtr t tte rtu da ea dee ttes 110 6 11 9 Function to Initialize Internal Variables with Constants initConst Function 112 6 11 10 Finalize Finalize Funcion srs sana aa ennemis 113 6 11 11 Compatibility between C Language and JavaScript 115 epe MELIUS MU MEE 116 7 1 Image Format Conversion by 116 7 1 1 Operational Procedure ssssssssssssessssseee eene ennt rnnt enne nnn sn nnns entente 116 7 1 2 116 7 1 3 Sr m 116 7 1 4 Types of Output Binary File menn 117 7 1 5 File Formats in the Output Binary File essen 117 7 1 6 INPUT Formals Em 118 7
4. Type Variable Description Applicable Function None Table 6 4 Static Type Variables Type Variable Description Applicable Function None Table 6 5 Const Type Variables Type Variable Description Applicable Function None R01AN2162EJ0200 Rev 2 00 Page 42 of 128 RENESAS Jul 31 2015 RZ A1 RGA 6 8 Properties 6 8 1 Canvas2D ContextClass Properties 6 8 1 1 List of Properties Section Property Description 6 8 1 2 c LanguageContext Context available for the C language API 6 8 1 3 fillStyle Fill style 6 8 1 4 globalAlpha One alpha value opacity multiplied by all drawings 6 8 1 5 globalCompositeOperation Calculation method for alpha blend 6 8 1 2 c LanguageContext graphics t Canvas2D ContextClass c LanguageContext get only This property is a context available for the C language API Refer to this property when using a function that is provided by the C language API but is not provided by the C API 6 8 1 3 fillStyle char Canvas2D ContextClass fillStyle set only CSS color Canvas2D PatternClass Canvas2D ContextClass fillStyle set only This property specifies a fill method This property has the value of either type shown below For the char type this property specifies the single color fill color expressed by CSS Color For the Canvas2D_PatternClass type this property specifies pattern When the char type is specified the fill method is
5. http www renesas com for the latest and detailed information Renesas Electronics America Inc 2801 Scott Boulevard Santa Clara CA 95050 2549 U S A Tel 1 408 588 6000 Fax 1 408 588 6130 Renesas Electronics Canada Limited 9251 Yonge Street Suite 8309 Richmond Hill Ontario Canada L4C 9T3 Tel 1 905 237 2004 Renesas Electronics Europe Limited Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K Tel 44 1628 585 100 Fax 44 1628 585 900 Renesas Electronics Europe GmbH Arcadiastrasse 10 40472 D sseldorf Germany Tel 49 211 6503 0 Fax 49 211 6503 1327 Renesas Electronics China Co Ltd Room 1709 Quantum Plaza No 27 ZhiChunLu Haidian District Beijing 100191 P R China Tel 86 10 8235 1155 Fax 86 10 8235 7679 Renesas Electronics Shanghai Co Ltd Unit 301 Tower A Central Towers 555 Langao Road Putuo District Shanghai P R China 200333 Tel 86 21 2226 0888 Fax 86 21 2226 0999 Renesas Electronics Hong Kong Limited Unit 1601 1611 16 F Tower 2 Grand Century Place 193 Prince Edward Road West Mongkok Kowloon Hong Kong Tel 852 2265 6688 Fax 852 2886 9022 Renesas Electronics Taiwan Co Ltd 13F No 363 Fu Shing North Road Taipei 10543 Taiwan Tel 886 2 8175 9600 Fax 886 2 8175 9670 Renesas Electronics Singapore Pte Ltd 80 Bendemeer Road Unit 06 02 Hyflux Innovation Centre Singapore 339949 Tel 65 6213 0200 Fax 65 6213 0300 Renesas Elec
6. 6 9 13 3 R ANIMATION TIMING FUNCTI Calculates an attribute value at the specified elapsed time ON GetValue from the time starting animation 6 9 132 Get AnimationTimingFunction R Get AnimationTimingFunction Outline Gets defined animation timing Header RGA h Declaration errnum t R Get AnimationTimingFunction char timing name animation timing function t out timing Description Argument char timing name The name of animation timing The following name can be passed ease linear ease in ease out ease in out animation timing functio Output The address of animation timing object n t out timing Return value Error code If there is no error the return value is O 6 9 13 3 R ANIMATION TIMING FUNCTION GetValue R ANIMATION TIMING FUNCTION GetValue Outline Calculates an attribute value at the specified elapsed time from the time starting animation Header RGA h Declaration float32 t R ANIMATION TIMING FUNCTION GetValue animation timing function t self float32 clamp time float32 t value of previous keyframe float32 t value of next keyframe Description Attribute value is user defined position value color value or other value changed by time Attribute eee y 9 4 i Time 3 3 mM ease linear iss 1 Mertens 5 gt
7. Argument NCGvoid ppObj Output A event flags object NCGuint32 ui32StatelD Not used Return value Error code If there is no error the return value is err 6 10 3 2 NCGSYS DestroyState NCGSYS DestroyState Outline Destroys the event flags of RGPNCG Header ncg state h RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 Page 97 of 128 RENESAS RZ A1 RGA Declaration NCGint32 NCGSYS DestroyState NCGvoid pObj If thread attached event of OSPL was called it is not have to change define Description Change define of this function for the target OS Argument NCGvoid pObj The event flags object Return value Error code If there is no error the return value is err 6 10 3 3 NCGSYS SetState NCGSYS SetState Outline Changes the value of the event flags of RGPNCG Header ncg state h Declaration NCGint32 NCGSYS SetState NCGvoid pObj NCGuint32 ui32State NCGuint32 ui32Flags Description Change define of this function for the target OS If thread attached event of OSPL was called it is not have to change define Argument NCGvoid pObj The event flags object NCGuint32 ui32State See the description of ui32Flags argument NCGuint32 ui32Flags Case of NOGSYS STATE SET SET Changes all bits of the event flags to the value of ui32State argument Case of STATE SET OR Does the OR operation with the event flags Sets 1 to the event flags bits of the column set 1 in ui32State argument C
8. At start turn on for 1 second and turn off for 1 second If bit was 1 turn on for 0 5 second and turn off for 0 5 second If bit was 0 turn on for 0 2 second and turn off for 0 8 second Display next binary digit by shift operation RO1AN2162EJ0200 Rev 2 00 Page 124 of 128 Jul 31 2015 RENESAS RZ A1 RGA 7 3 Converting binary by ConvertBin ConvertBin converts from binary file to C language array or S record format Motorola S record Command Description BinToC Converts from binary file to C language array Variable name can be specified BinToSRec Converts from binary file to S record format Comment load address and execute address can be specified Execute address is usually 0 for data binary SRecToBin Converts from S record format to binary file Window after RGA Tools vbs is double clicked RGA Tools Copyright c 2012 2015 Renesas Electronics Corporation 1 Convert image format RunImagePackager 2 Search error information SearchErrorInformation 3 Convert to binary ConvertBin Number or command gt 3 ConvertBin 1 Binary to C language BinToC 2 Binary to S record format BinToSRec 3 S record format to binary SRecToBin Number or command RO1AN2162EJ0200 Rev 2 00 Page 125 of 128 Jul 31 2015 RENESAS RZ A1 RGA 8 Sample Codes Sample codes are contained in src samples RGA in the DS 5 project See the
9. None NCGVG Init Outline Starts to use Renesas Graphics Processor for OpenVG R GPVG2 Header ncg vg h Declaration NCGvoid NCGVG_Init PNCGVGINFO pVGInfo Description If the Power Down Mode of Renesas graphics processor for Renesas Graphics Processor for OpenVG R GPVG2 was the halted state change to the running state in this function Argument PNCGVGINFO pVGlnfo Not used Return value 6 10 3 12 NCGVG Delnit None NCGVG Delnit Outline Ends to use Renesas Graphics Processor for OpenVG R GPVG2 Header ncg vg h Declaration NCGvoid NCGVG Delnit PNCGVGINFO pVGlnfo Description If necessary change the Power Down Mode of Renesas graphics processor for Renesas Graphics Processor for OpenVG R GPVG2 to the halted state in this function Argument PNCGVGINFO pVGlnfo Not used Return value None RO1AN2162EJ0200 Rev 2 00 Page 100 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 11 Supplementary Explanation 6 11 1 Correspondence to Canvas 2D and Correspondence to Hardware Acceleration In the hardware column Hardware is used x No hardware is used Not applicable Canvas2D API RGA C API RGA C language API E 1 Conformance requirements CanvasRenderingContext2D Canvas2D ContextClass graphics t interface getContext R RGA New Canvas2D Conte R GRAPHICS Initialize xtClass context canvas z CSS currentColor 2 The canvas state save save R GRAPHICS Save restore rest
10. RO1AN2162EJ0200 Rev 2 00 Page 91 of 128 Jul 31 2015 RENESAS RZ A1 Argument Return value RGA The work buffer B is not requested if all following condition were fulfilled JPEG Codec Unit JCU in RZ A1H M can draw directly or any JPEG images are not drawn Thedrawing target address of left up of JPEG image can be divided by 8 Thesize of JPEG image is multiples of MCU Minimum Coded Unit The size is depend on the pixel format of the JPEG data 16pixels x 8lines JPEG image is YCbCr422 format gt 16pixels x 16lines JPEG image is YCbCr420 format gt Opixels x 8lines JPEG image is YCbCr444 format gt S2pixels x 8lines JPEG image is YCbCr411 format The matrix is unit matrix or translation only The return value is set in graphics config t type See 6 6 5 3 graphics config t int t MaxWidthOfJPEG The maximum width of JPEG image int t MaxHeightOfJPEG The maximum height of JPEG image int t The maximum bytes of the drawing target frame MaxBytePerPixelOfFrameB buffer uffer If the matrix is not unit matrix and not translation only this argument is 4 Size bytes required for the work buffer RO1AN2162EJ0200 Rev 2 00 Page 92 of 128 Jul 31 2015 RENESAS RZ A1 6 9 15 RGA Functions in strings 6 9 15 1 List of Functions Section Function Name Description 6 9 15 2 rgb Returns the value of color from CSS Color format 6 9 15 3 rgba Returns the value of co
11. 1 cm 4 2 File Gonfig ration c or Ere Leser aaa NEE RE E a iba rra Pes E Eee RE Erden 9 3 Operation Verification Conditions entren nennen sinn intense rene 11 4 Reference Application Note s 12 b Descrptior gt 13 5 1 Hardware Configuration nanena ts 13 5 2 Listor Pins 10 66 0 14 6 Description 15 6 1 e TINCXUSSIe CUIDA 15 6 1 1 When Drawing on a Buffer Defined by the Application 15 6 1 2 Drawing on the Display Screen 2 2 2 17 6 2 Hardware resource allocation ssssssessesseeeseeeene nenne enne nennen nnne nns 20 6 3 Required Memory 1726 cese tede iaaa oko nate enne rano Loc ue eaa adde 21 6 4 Using OS resoUrces aii eo o dece dep ens eine bbe van Cabe er MD d SE deans 22 6 5 List Of eto URP EE 23 6 6 I ED EFIE 24 6 6 1 Basic Types and Values eec ce eue E deed tec 24 6 6 2 Error CodeS mE 24 6 6 3 Types Only for the C Language sse nnne nennen nnne nns nennen nes 25 6 6 4 Classes Only for the C
12. 1 Single buffer 2 Double buffers Buffer number being displayed or used as source image buffer address array number Buffer number being drawn buffer address array number Outline Drawing destination frame buffer type Header RGA h frame buffer h Description Member Symbol Variable uint8_t buffer address int fast32 t buffer count int fast32 t show buffer index int fast32 t draw buffer index int fast32 t width byte per pixel t byte per pixel R01AN2162EJ0200 Rev 2 00 Jul 31 2015 Frame buffer width pixels Number of bytes per pixel See Table 1 2 Page 30 of 128 RENESAS RZ A1 int fast32 t pixel format t int fast32 t stride height pixel format RGA Number of bytes of pixels having the same x coordinate in the previously below line Specify a multiple of 32 Frame buffer height pixels Pixel format frame buffer delegate t delegate User defined variable Sample Static uint8 t gs frame buffer memory 2 800 480 4 frame buffer t frame frame buffer address 0 frame buffer address 1 frame buffer count 2 fram fram fram fram fram fram fram fram width 800 byte per pix stride 800 height 480 pixel format delegate NULL 1 r 6 6 5 3 graphics config t show buffer index draw buffer index 4 PIX O 1 gs frame buffer memory gs frame buffer memory 0 1 EL FORMAT ARGB8888
13. 2 00 Page 63 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 2 Functions Equivalent to graphics image t Class Member Function 6 9 21 List of Functions Section Function Name Description 6 9 2 2 R GRAPHICS IMAGE InitR8G8B8A8 Initializes the r8g8b8a8 t image object 6 9 2 3 GRAPHICS IMAGE InitSameSizeR Initializes the image object to the same width and 8G8B8A8 height 6 9 2 4 R GRAPHICS IMAGE InitCopyFrame Initializes the image object to which a part of frame BufferR8G8B8A8 buffer being displayed is copied 6 9 2 5 R GRAPHICS IMAGE InitByShareFra Initializes the frame buffer data as an image meBuffer 6 9 2 6 GRAPHICS IMAGE GetProperties Get properties of the image 6 9 2 2 R GRAPHICS IMAGE InitR8G8B8A8 R GRAPHICS IMAGE InitR8G8B8A8 Outline Initializes the r8g8b8a8 t image object Header RGA h Declaration errnum t R GRAPHICS IMAGE InitR8G8B8A8 graphics image t self void image data array size timage data array size int t width int t height Description Initializes internal variables Acquirable image data is arranged in a uint8 t type array in the order of Red Green Blue and Alpha from the upper left pixel to the lower right pixel Argument graphics image t self Image void image data array Starting address of an array to be a memory area that stores images size t Size bytes of the memory area indicated by image data array size image data array int
14. A1 See following The format of Raw format image Binary format When expanding JPEG data on the target board the file is stored as it is Specified for ImagePackager InputFiles File The format of Raw format image RO1AN2162EJ0200 Rev 2 00 Page 117 of 128 Jul 31 2015 RENESAS RZ A1 RGA Offset Size Description 0x00 4byte The bit flags described the type of image bitO 1fixed bit1 reserved bit2 1 Premultiplied alpha O not Premultiplied alpha bit3 bit15 reserved bit16 bit31 0 This endian is depended on the setting of 0x04 4byte The offset value to the image data from the first of Raw format image This endian is depended on the setting of 0x08 4byte reserved 0x0C 2byte The image width pixels This endian is depended on the setting of OxOE 2byte The image height pixels This endian is depended on the setting of endian 0x10 1byte The pixel format 0 RGB565 2 ARGB1555 3 ARGB4444 6 CLUT8 7 CLUT4 8 CLUT1 9 XRGB8888 10 ARGB8888 11 YUV422 20 A8 21 A4 22 A1 0x11 7byte reserved Image data If the pixel format was RGB components this endian is depended on the setting of endian If the pixel format was YUV components this endian is not depended on The offset value of this image data is depended on the setting of Qraw image alignment The byte count par one line stride is depended
15. Declaration errnum_t R GRAPHICS ResetMatrix graphics t self Description Argument graphics t self Graphics drawing context Return value Error code If there is no error the return value is O RO1AN2162EJ0200 Rev 2 00 Page 50 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 1 14 R GRAPHICS SetMatrix 2x3 R GRAPHICS SetMatrix 2x3 Outline Sets each element of the current matrix 2x3 Header RGA h Declaration errnum_t R GRAPHICS SetMatrix 2x3 graphics t self graphics matrix float t sx graphics matrix float t ky graphics matrix float t kx graphics matrix float t sy graphics matrix float ttx graphics matrix float tty Description When the library was ported take care computing error Argument graphics t self Graphics drawing context graphics matrix float t sx 2x3 matrix graphics matrix float t ky SX kx tx graphics matrix float t kx ky sy ty graphics matrix float t sy graphics matrix float t tx 0 0 graphics matrix float t ty Return value Error code If there is no error the return value is 0 6 9 1 15 R GRAPHICS SetMatrix 3x3 R GRAPHICS SetMatrix 3x3 Outline Sets each element of the current matrix Matrix 3x3 Header RGA h Declaration errnum t R GRAPHICS SetMatrix 3x3 graphics t self graphics matrix float t matrix Description When the library was ported take care computing error Argument graphics t self Graphics drawing context graphics matrix float t 3x3 matrix array matrix Matr
16. Language ccc cecececeeeeeeeeeeceeeeeceaeeeeaaeeeeneeseeeesaeeetaaeeseeeeseaees 27 6 6 5 Types Classes Available for C Language and C Language 30 6 6 6 suelto 39 6 6 7 Type oi Porting layers cite ore eter eure ERR 40 6 6 8 Changing state Of Class itecto Deu edt dela aded 41 6 7 Egcce E 42 6 8 eT 43 6 8 1 Canvas2D ContextClass Properties 0 c ccccccceeeeeeeeneeeeeeeeceeeeeaaeeseneeseaeeesaeeesaaeeneneeenaees 43 6 8 2 Canvas2D_ImageClass Properties ssssssssssssssseseeeeeneeen ener 45 6 9 Functions and Methods tet se RE ERE EL Eua EE 46 6 9 1 Functions Equivalent to graphics t Class Member Function 46 6 9 2 Functions Equivalent to graphics image t Class Member Function 64 6 9 3 Functions Equivalent to graphics pattern t Class Member Function 67 6 9 4 Functions Related to Creating C Object ssssssssssssseee enne 68 6 9 5 Canvas2D ContextClass Member Functions cccccccsccsececcceceesssseseeeeeeeesessaeeeeeeseeeses 68 6 9 6 Functions Related to lt 20_1 5 22 76 6 9 7 Functions Related to Canvas2D PatternClass
17. R GRAPHICS Onlnitialize FuncType function RGA h errnum t R GRAPHICS STATIC OnFinalizeDefault graphics t self void default object errnum te Default of the R GRAPHICS OnFinalize FuncType function type graphics t self Address of the object that has been finalized void default object Output Memory allocated in this function errnum te Errors that have occurred No error 0 Error code or e 0 successful and e 0 6 10 15 R GRAPHICS OnFinalize FuncType R GRAPHICS OnFinalize FuncType Outline Header Declaration Description Argument Return value Type of the function that releases memory allocated in the R GRAPHICS Onlnitialize FuncType function RGA h errnum t R GRAPHICS OnFinalize FuncType graphics t self void default object errnum t e Use GRAPHICS STATIC SetOnFinalize to register callback functions of this function type Callback functions of this function type are called back from the end of the R GRAPHICS Finalize function The output default object value is contained in out default object of the R GRAPHICS Onlnitialize FuncType function graphics t self Address of the object that has been finalized void default object Output Memory allocated in this function errnum te Errors that have occurred No error 0 Error code or e 0 successful and e 0 R01AN2162bEJ0200 Rev 2 00 Page 95 of 128 Jul 31 2015 RENESAS RZ A1 6 10 2 RGA uses following functions of OSPL API I
18. R GRAPHICS SetQualityFlags Outline Sets the drawing quality Header RGA h Declaration errnum_t R GRAPHICS SetQualityFlags graphics t self graphics quality flags t qualities Description Argument graphics t self Graphics drawing context graphics quality flags t qualities See section 6 6 5 4 Return value Error code If there is no error the return value is O 6 9 1 45 R GRAPHICS GetQualityFlags R GRAPHICS GetQualityFlags Outline Acquires the current drawing quality Header RGA h Declaration errnum t R GRAPHICS GetQualityFlags graphics t self RO1AN2162EJ0200 Rev 2 00 Page 61 of 128 Jul 31 2015 RENESAS RZ A1 RGA graphics quality flags t out qualities Description Argument graphics t self Graphics drawing context graphics quality flags t out qualities Output See section 6 6 5 4 Return value Error code If there is no error the return value is 0 6 9 1 46 R GRAPHICS SetStrokeColor R GRAPHICS SetStrokeColor Outline Sets the color used for single color fill for the paint object of the current border Header RGA h Declaration errnum t R GRAPHICS SetStrokeColor graphics t self r8g8b8a8 t color Description Argument graphics t self Graphics drawing context r8g8b8a8 t color Border color Return value Error code If there is no error the return value is O 6 9 1 47 GRAPHICS StrokeRect GRAPHICS StrokeRect Outline Draws sides of rectangle Header RGA h Decla
19. YCbCr444 H 1 1 1 V 1 1 1 YCbCr411 H 4 1 1 V 1 1 1 Table 1 5 Supported PNG format RZ A1H M L Decoding module LibPNG zlib f the source image was R8G8B8A8 or YCbCr422 S W rendering is used Width of A8 A4 and A1 format image must be same as width of drawing target frame buffer RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 RENESAS Page 6 of 128 RZ A1 RGA The following tables describes the detail of pixel format RGA for RZ A1 is little endian For example Red of XRGB8888 is at first address of the pixel 2 XRGB8888 bit 31 24 23 16 15 8 7 0 0 Red Green Blue ARGB8888 bit 31 24 23 16 15 8 7 0 Alpha Red Green Blue RGB565 bit 15 11 10 5 4 0 Green Blue ARGBI1555 bit 15 14 10 9 5 4 0 Alpha Red Green Blue ARGB4444 bit 15 12 11 8 7 4 3 0 Alpha Red Green Blue R8G8B8A8 address 0 1 2 3 Red Green Blue Alpha YCbCr422 address 0 1 2 3 Cb Y Left Cr Y Right FourCC UYVY CbCr center grayscale 0x80 CLUT8 bit 7 0 Index RO1AN2162EJ0200 Rev 2 00 Page 7 of 128 Jul 31 2015 RENESAS RZ A1 RGA CLUT4 bit 7 0 Index Left Index Right CLUTI bit 7 6 5 4 3 2 1 0 Index 0 Index 1 Index 2 Index 3 Index 4 Index 5
20. graphics config t structure Outline Header Description Configuration of graphics t type RGA h To customize default values or assemble essential settings use the function described in section 6 10 1 3 R GRAPHICS Onlnitialize FuncType Member Variable Symbol bit flags fast32 t frame buffer t frame buffer void work_buffer_address RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 Description See section 6 11 7 Flagged Structure Parameters mandatory F GRAPHICS FRAME BUFFER F GRAPHICS WORK BUFFER ADDRESS F GRAPHICS WORK BUFFER SIZE F GRAPHICS MAX HEIGHT OF FRAME BUFFER F GRAPHICS QUALITY FLAGS F GRAPHICS BACKGROUND COLOR F GRAPHICS IS FAST MANUAL FLUSH F GRAPHICS WORK BUFFER B ADDRESS F GRAPHICS WORK BUFFER B SIZE F GRAPHICS JPEG DECODER F GRAPHICS WORK SIZE FOR LIBPNG F GRAPHICS INTERNAL EVENT VALUE F GRAPHICS LOCK OBJECT F GRAPHICS CHANNEL OF DMAC 1 F GRAPHICS CHANNEL OF DMAC 2 F GRAPHICS EVENT VALUE OF DMAC 1 F GRAPHICS EVENT VALUE OF DMAC 2 Frame buffer to be drawn for which member variables must be set Set the address of frame buffer t type structure flags Work buffer starting address that must be set if in following condition Set this address in uncached area Drawing Raw format image Page 31 of 128 RENESAS RZ A1 size_t work buffer size int fast32 t max height of frame buf fer graphics quality flags t quality flags r8g8b8a8 t background color bool t is fa
21. lt OutputBinary gt lt InputFiles gt File path BinaryHeader txt type char symbol g BinaryHeader Image path picture bmp type graphics image t symbol g Picture bmp output format RGB565 Image path smile32 bmp type graphics image t symbol g Smile bmp output format ARGB4444 File path JPEG jpg type graphics image t symbol g JPEG jpg gt InputFiles lt ImagePackager gt The folder that contains the XML file is the reference of relative paths A folder path or wild card can be specified for Image path Providing a fixed value header at the top allows checking whether binary data is contained or not 7 1 4 Types of Output Binary File Language e Binary format external reference symbol of C language C language header e Binary format or S record format direct addressing such as in flush C language header e C language source C language header Specified for ImagePackager OutputBinary language and ImagePackager OutputHeader address 7 1 5 File Formats in the Output Binary File Format Description Offset table The array of 4byte integer type in the first of the binary file that indicates the offset value to image data and binary data Raw format image Specified for ImagePackager InputFiles Image output_format ARGBS8888 XRGB8888 X component is 0x00 RGB565 ARGB1555 ARGBA4444 YUV422 CLUT8 CLUTA CLUT1 A8 A4
22. type self Target object to finalize Argument errnum te Error code raised from before There is different whether or not to do the rollback operation whether or not error was raised depending on a function s specification Return value Error code ore 0 successful and e 0 If argument e is not 0 returns the value of e If argument e is 0 returns an error code of this finalize operation Pass error code raised from before to argument e like the following code errnum t Func errnum t e CLASS InitConst amp sample e CLASS Initialize amp sample IF e goto fin e 0 fin e CLASS Finalize amp sample e return If the finalize operation was success the target object becomes Uninitialized state If error was raised in the finalize operation the function returns error code not 0 and may become the following state State after Description and expected behavior finalizing Uninitialized The target object can be deleted In this case all internal objects are finalized even if errors were raised internally and the program can be resumed from error state Uninitialized internal objects are deleted Internal objects which returned to a previous state are not deleted until resource management object deletes it or the system was reset Otherwise the object may keep lock state A callback function related internal object which returned to a previous state may be called Notify the
23. 1 7 Parameters That Can Be Described in BinarylmageConfig image xml 118 7 2 Searching for Error Information by SearchErrorlnformation esses 124 7 3 Converting binary by ConvertBin sess 125 8 Sample COMES E 126 9 Reference Doc ments ice ii etre da eter diced entradas cv dr EHE ER CERE duda 127 Website and SUpport i as adde desee e aea hd ea Ra e adt ed avide ad Rer ERE seda da ud ER ra adc ce 128 Revision Histo c 129 General Precautions the Handling of MPU MCU Products sssssseeene enne 130 NONGO EE 131 RO1AN2162EJ0200 Rev 2 00 Page 3 of 128 Jul 31 2015 RENESAS RZ A1 RGA 1 Specifications The RGA is used to draw graphics images Table 1 1 lists Peripheral Functions to Be Used and Applications Figure 1 1 shows a Block Diagram and Table 1 2 and Table 1 3 list available pixel formats Table 1 1 Peripheral Functions to Be Used and Applications Peripheral Function Application Renesas Graphics Processor for OpenVG R Graphics drawing GPVG2 JPEG Codec Unit JCU JPEG decompression Video Display Controller 5 VDC5 Screen display RZ AIH M L Application RGA C language API RGA C language API Library RGA Library Sample Window Surfaces Driver VDC5 Porting RGPNCG OSPL layer Interrupt control Host PC ImagePackager Im
24. 128 Jul 31 2015 RENESAS RZ A1 6 5 List of Constants Table 6 2 lists Constants Used for the Sample Code Table 6 2 Constants Used for the Sample Code RGA Constant Name Value Value Description for RGAH for RGAS RGA VERSION 120 RGA version RGA FRAME BUFFER ADDRES 32 4 Address alignment of drawing target S ALIGNMENT frame buffer bytes RGA SOURCE IMAGE STRIDE 32 4 Byte count alignment to next line ALIGNMENT stride of source image bytes RGA DESTINATION STRIDE ALI 32 4 Byte count alignment to next line GNMENT stride of drawing target bytes RGA JPEG ADDRESS ALIGNME 8 4 Address alignment of JPEG data NT bytes RGA JPEG MAX WIDTH ALIGN 16 Maximum width of MCU of source MENT JPEG image pixel RGA JPEG MAX HEIGHT ALIGN 16 Maximum height of MCU of source MENT JPEG image pixel RGA VDC5 BUFFER ADDRESS 64 First address alignment of the frame ALIGNMENT buffer shown by Video Display Controller 5 VDC5 bytes RGA WORK BUFFER STRIDE 64 One line size of work buffer bytes RGA WORK BUFFER ADDRESS 64 4 First address alignment of work buffer ALIGNMENT bytes RGA WORK BUFFER HEIGHT A 8 Height alignment of work buffer pixel LIGNMENT RGA WORK BUFFER B ADDRE 32 4 First address alignment of work buffer SS ALIGNMENT B bytes RGA MAX WORK SIZE FOR LI 0x40000 Default size bytes of memory area as B PNG DEFAULT h
25. 2015 RENESAS RZ A1 RGA libPNG a V This decodes PNG image Both RGA for hardware accelerator version and no hardware accelerator version use ibPNG a Both RGA do not use hardware accelerator for decoding PNG image The environment of gcc not supported longjmp function can not continue after raising an error It calls user error fnfunction and PNG ABOHT macro Set the size of work buffer for PNG module to work size for libPNG member variable This library can be made from source files in PNG folder If you want to update the newest LibPNG module modify and build source files for RZ A1 by source files for reference libjpeg a This decodes JPEG image for hardware accelerator version does not use libjpeg a This library be made from source files in JJG JPEG folder If you want to update the newest libjpeg module modify and build source files for RZ A1 by source files for reference RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 Page 10 of 128 RENESAS RZ A1 RGA 3 Operation Verification Conditions Operations of the sample code of this application note are verified under the following conditions Table 3 1 Operation Verification Conditions Item Description MCU used RZ A1 Operating frequency CPU clock 400MHz Image processing clock Gq 266 67MHz Internal bus clock B 133 33MHz Peripheral clock 1 P1 66 67MHz Peripheral clock 0 PO 33 33MHz
26. All trademarks and registered trademarks are the property of their respective owners RO1AN2162EJ0200 Rev 2 00 Page 128 of 128 Jul 31 2015 RENESAS Revision History Description Rev Date Page Summary 1 03 Jul 4 2014 First edition issued 1 10 Dec 16 2014 Supported alpha only source image Enlarged max size of source image 1 20 Feb 10 2015 Supported for RZ 1L Supported PNG Added GRAPHICS COPY lock object Reduced porting work of RGPNCG 2 00 Jul 31 2015 Second edition issued A 129 General Precautions in the Handling of MPU MCU Products The following usage notes are applicable to all MPU MCU products from Renesas For detailed usage notes on the products covered by this manual refer to the relevant sections of the manual If the descriptions under General Precautions in the Handling of MPU MCU Products and in the body of the manual differ from each other the description in the body of the manual takes precedence 1 Handling of Unused Pins Handle unused pins in accord with the directions given under Handling of Unused Pins in the manual The input pins of CMOS products are generally in the high impedance state In operation with an unused pin in the open circuit state extra electromagnetic noise is induced in the vicinity of LSI an associated shoot through current flows internally and malfunctions occur due to the false recognition of the pin state as an input signal become
27. Example of Hardware Configuration Power supply ULINK2 ICE GENMAI board Option board Optional To host PC s USB 1 E Ma LCD output N Optional To host PC s serial port Figure 5 1 Example of Hardware Configuration RZ A1H RO1AN2162EJ0200 Rev 2 00 Page 13 of 128 Jul 31 2015 RENESAS RZ A1 5 2 List of Pins to be Used Table 5 1 lists the pins to be used and their functions Table 5 1 Pins to be Used and their Functions RGA Pin name Description None RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 RENESAS Page 14 of 128 RZ A1 RGA 6 Description of Software 6 1 Outline of Operations 6 1 1 When Drawing on a Buffer Defined by the Application 6 1 1 1 Flowchart Figure 6 1 shows a flowchart of drawing on a frame buffer defined by the application For the actual operation procedure see the attached document RGA Tutorial When using the C language API see the description below using the C language API and the relationship between the C language API described in section 6 11 1 Correspondence to Canvas 2D and Correspondence to Hardware Acceleration and the C language API Initialize the constant part of each object Call the GRAPHICS InitConst function Prepare a frame buffer Set member variables of the frame buffer t type structure Create an object of graphics t class object Call the GRAPHICS Initialize function Sta
28. Index 6 Index 7 Index 0 is the most left pixel Index 7 is the most right pixel A8 bit 7 Alpha A4 bit 7 0 Alpha Right Alpha Left Al bit 7 6 5 4 3 2 1 0 Alpha 7 Alpha 6 Alpha 5 Alpha 4 Alpha 3 Alpha 2 Alpha 1 Alpha 0 Alpha 0 is the most left pixel Alpha 7 is the most right pixel RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 RENESAS Page 8 of 128 RZ A1 RGA 2 File Configuration src drivers o ospl Sample of porting layer for OS less RGA inc C C language header RGPNCG Sample of porting layer for OS less D samples Sample source of RGA RGA Sample source of RGA D Sample_Common Sample source common of platform D scriptlib Internal files for commands RGA_Tools vbs Tools see section 7 lib RGA RGA library RGAH RGA internal library PNG PNG library JPEG JPEG library This is not used for RZ A1H M When you installed RGA library to your project folder copy src drivers inc folder and lib folder When link error was raised copy source files defined error raised function When an error of not found include file copy header files And copy source files of drivers and common functions defined functions that was raised the unreferenced link error Write include RGA h in the application program using RGA Set the work buffer of RGA in uncached area and put in available memory area The address of work buffer the value of work buffer a
29. Initialize Normal Figure 6 1 Figure of changing state of graphics t class Table 6 1 List of functions of each classes having R Finalize member function Class Undefined to Uninitialized Uninitialized to Normal Normal to Uninitialized graphics t GRAPHICS InitConst R GRAPHICS Initialize GRAPHICS Finalize Figure 6 2 shows a Figure of changing state of graphics pattern t class and Table 6 2 shows List of functions of each classes not having R Finalize member function The function not changing state can be called at Normal state Start state Undefined i R GRAPHICS PATTERN Initialize Normal Figure 6 2 Figure of changing state of graphics pattern t class Table 6 2 List of functions of each classes not having R Finalize member function Class Undefined to Normal graphics image t R GRAPHICS IMAGE InitR8G8B8A8 R GRAPHICS IMAGE InitSameSizeR8G8B8A8 R GRAPHICS IMAGE InitCopyFrameBufferR8G8B8A8 R GRAPHICS IMAGE JInitByShareFrameBuffer The object created by ImagePackager is Normal state at the start state graphics pattern t R GRAPHICS PATTERN Initialize RO1AN2162EJ0200 Rev 2 00 Page 41 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 7 List of Variables Table 6 3 shows Global Variables Table 6 4 shows Static Type Variables and Table 6 5 shows Const Type Variables Table 6 3 Global Variables
30. Rev 2 00 Page 49 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 1 10 R GRAPHICS Onlnterrupting R GRAPHICS Onlnterrupting Outline Receives interrupts of drawing hardware Header RGA h Declaration errnum t R GRAPHICS Onlnterrupting void Description See R DRIVER Onlnterrupting function OS Porting Layer OSPL Sample Program Argument None Return value Error code If there is no error the return value is O 6 9 1 11 GRAPHICS Save R GRAPHICS Save Outline Saves the set value of context to the specified status structure Header RGA h Declaration errnum t R GRAPHICS Save graphics t self graphics status t out status Description Argument graphics t self Graphics drawing context graphics status t out status Output Set value of context Return value Error code If there is no error the return value is 0 6 9 1 12 GRAPHICS Restore GRAPHICS Restore Outline Returns the status structure content to context Header RGA h Declaration errnum t R GRAPHICS Restore graphics t self graphics status t status errnum te Description Argument graphics t self Graphics drawing context graphics status t status Set value of context errnum te Errors that have occurred No error 0 Return value Error code ore 0 successful and e 0 6 9 1 13 GRAPHICS ResetMatrix R GRAPHICS ResetMatrix Outline Resets the matrix to be a matrix calculation function target to the unit matrix Header RGA h
31. V 6 9 1 31 Alpha only image V V Square fill V V V V V Byte per pixel 4 4 2 2 2 2 1 1 2 1 8 reference RGB component is not multiplied alpha Restrictions For details see the description on functions RO1AN2162EJ0200 Rev 2 00 Page 5 of 128 Jul 31 2015 RENESAS RZ A1 RGA Table 1 3 Combinations of Available Pixel Formats of Images and Pixel Formats of Drawing Destination Output I IN Input Image JPEG VV VJ VJ VJ VJ V V PNG Vv VJ VJ VJ XRGB8888 VJ s 4 v ARGB8888 V VJ 4 v r4 RGB565 V VJ V V ARGB1555 V v ARGB4444 V V V R8G8B8A8 V v VV VJ VJ Vv YUV422 VJ CLUT8 VJ CLUT4 VJ CLUTI VJ A8 V s r4 A4 V V P4 P4 V Al P4 V P4 V V V RZ AIH M L v RZ AIH M x Not available The JPEG above is a case where JPEG data is specified for arguments of the image drawing function GRAPHICS DrawlImage Table 1 4 shows supported JPEG format When a JPEG file or PNG file is converted to the raw format including XRGB8888 by using the ImagePackager tool see the column of the pixel format Table 1 4 Supported JPEG format RZ A1H M RZ A1L Decoding module JPEG Codec Unit JCU in RZ A1 IJG JPEG libjpeg JPEG standard baseline baseline Pixel format in JPEG YCbCr420 H 2 1 1 V 2 1 1 YCbCr420 H 2 1 1 V 2 1 1 YCbCr422 H 2 1 1 V 1 1 1 YCbCr422 H 2 1 1 V 1 1 1
32. be called at the beginning of the main function but the function can be modified dynamically Other functions must be solved at the time of linkage and cannot be modified dynamically 6 10 1 Functions on Default Settings of RGA 6 10 1 1 List of Functions Section Function Name Description 6 10 1 2 R GRAPHICS STATIC O Default of the callback function that sets the default ninitializeDefault graphics_config_t value 6 10 4 3 GRAPHICS Onlnitialize Type of the callback function that sets the default FuncType graphics config t value 6 10 1 4 R GRAPHICS STATIC O Default of the function that releases memory allocated in the nFinalizeDefault R GRAPHICS Onlnitialize FuncType function 6 10 4 5 R GRAPHICS OnFinalize Type of the function that releases memory allocated in the FuncType R GRAPHICS Onlnitialize FuncType function 6 10 12 R GRAPHICS STATIC OnlnitializeDefault GRAPHICS STATIC OnlnitializeDefault Outline Default of the callback function that sets the default graphics config t value Header RGA h Declaration errnum t R GRAPHICS STATIC OnlnitializeDefault graphics t self graphics config t in out config void out default object Description Default of the R GRAPHICS Onlnitialize FuncType function type Argument graphics t self Address of the object non initialized at which initialization starts graphics config t in out config See section 6 6 5 3 void out default ob
33. be created by using section 7 1 Image Format Conversion by ImagePackager JPEG data can be directly specified for arguments See section 6 11 2 Identifying Image Format This function is affected GRAPHICS SetGlobalAlpha This function is also affected by the current matrix and clipping When drawing an image in the YUV422 format if the value converted from min x or min y by the matrix is not an even number an error occurs When the alpha component is included in the image and is not included in the drawing target frame buffer RGB components to be drawn in the frame buffer are blended to values that have been multiplied by the alpha component When the alpha component is included in the drawing target frame buffer RGB components are blended to values that have not been multiplied by the alpha component An example of pixel format including the alpha component ARGB8888 ARGB4444 ARGB1555 An example of pixel format without alpha component XRGB8888 RGB565 YUV422 RO1AN2162EJ0200 Rev 2 00 Page 56 of 128 Jul 31 2015 RENESAS RZ A1 RGA When drawing characters of raster font specify the image of A8 A4 and A1 Alpha only format to image argument But width of the image must be same as width of drawing target frame buffer for RZ A1H Also the image of A8 A4 and A1 format can not be zoomed Specify a CLUT format image as same bit count as the frame buffer for drawing in the CLUT format frame buffer Only min x 0 an
34. buffer is changed call R WINDOW SURFACES AccessLayerAttributes function Argument window surfaces t self Frame buffers and screen display int t layer num The layer number 0 Innermost 1 Next to the innermost layer frame buffer t Output Frame buffer structure out frame buffer Return value Error code If there is no error the return value is 0 6996 WINDOW SURFACES GetLayerCount R WINDOW SURFACES GetLayerCount Outline Acquires the number of layers Header RGA h window surfaces h Declaration errnum t R WINDOW SURFACES GQGetLayerCount window surfaces t self int t out layer count Description Argument window surfaces t self Frame buffers and screen display int t out layer count Output Number of layers Return value Error code If there is no error the return value is O 6997 WINDOW SURFACES SwapBuffers R WINDOW SURFACES SwapBuffers Outline Swaps the buffer of the specified layer and displays the drawn content Header RGA h window surfaces h Declaration errnum t R WINDOW SURFACES SwapBuffers window surfaces t self int t layer num graphics t graphics Description If buffer was single buffer buffer is not swapped The drawn content is displayed without calling this function but the progress of the drawing is displayed instead If buffer was double buffer the content after swapping is front of 2 frames Call R GRAPHICS Clear function or call R GRAPHICS IMAGE JInitByShareFrameBuffer fun
35. end of the type name uint8 t is set by default A symbol described in the header file Essential The define symbol in the global scope uint8 t type The address alignment of the file Optional alignment pointed from ImagePackager OutputBinary super_class is set by default ImagePackager InputFiles Var Zero one or more elements The values written in XML file are embedded in the binary file type symbol value RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 Type of the symbol written in the header file Essential int32 t uint32 t int16 t uint16 t int8 t uint8 t can be specified The symbol name written in the header file Essential This name is a name of global variable initialized the value embedded in the binary file The value embedded in the binary file Essential Integer or the following special format can be specified Example of integer 10 10 OxFF Page 121 of 128 RENESAS RZ A1 RGA Special format new Image file path width Width of image named by file path Special format new Image file_path height Height of image named by file path file path is the path of image file ImagePackager SourceTemplate Zero one or more elements id Source text SourceWithSection text Header text HeaderWithSection text DeclareVariable text DeclareAddress text RO1AN2162EJ0200_ Rev 2 00 Jul 31 2015 ID of SourceTempl
36. error the return value is 0 6 9 1 24 R GRAPHICS GetProjectiveMatrix R GRAPHICS GetProjectiveMatrix Outline Acquires a matrix that deforms a random profile quadrangle to a random profile quadrangle Header RGA h Declaration errnum t R GRAPHICS GetProjectiveMatrix RO1AN2162EJ0200 Rev 2 00 Page 54 of 128 Jul 31 2015 RENESAS RZ A1 RGA graphics matrix float t source top left x graphics matrix float t source top left y graphics matrix float t source top right x graphics matrix float t source top right y graphics matrix float t source bottom left x graphics matrix float t source bottom left graphics matrix float t source bottom right x graphics matrix float t source bottom right y graphics matrix float t destination top left x graphics matrix float t destination top ILeft y graphics matrix float t destination top right x graphics matrix float t destination top right y graphics matrix float t destination bottom left x graphics matrix float t destination bottom left y graphics matrix float t destination bottom right x graphics matrix float t destination bottom right y graphics matrix float t out matrix Description When the library was ported take care computing error Argument graphics matrix float t source Four point coordinates before conversion graphics matrix float t Four point coordinates after conversion destination graphics matrix float t Output 3x3 mat
37. error information to the end user or make logs after finalize function Reset Calls OSPL RaiseUnrecoverable function from the finalize function R OSPL RaiseUnrecoverable function resets the system or exits the process In this case finalize function is not returned RO1AN2162EJ0200 Rev 2 00 Page 113 of 128 Jul 31 2015 RENESAS RZ A1 RGA State before The object which returned to previous state can not be deleted finalizing Call finalize operation which usually returns to previous state from out of finally block fin in above code and retry the finalize operation If the finalize operation is called from finally block the object will not be deleted Adjust anything before calling the finalize function An object which integrates not deleted object sometimes becomes to Uninitialized state In this case see the description of Uninitialized in this table RO1AN2162EJ0200 Rev 2 00 Page 114 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 11 11 Compatibility between C Language and JavaScript Object JavaScript codes using the Canvas 2D object can be operated as they are by using the C language class provided by this library The following shows codes using variables of the class provided by this library which are the same description of codes using variables that reference the JavaScript object When assignment operation is performed one object can be accessed from two variables Therefore an operation is performe
38. flags 6 10 3 8 NCGVG Attach ISR NCGVG Attach ISR Outline Header Declaration Description Argument Return value Registers the interrupt callback function for Renesas Graphics Processor for OpenVG R GPVG2 ncg vg isr h NCGint32 NCGVG Attach ISR NCGVGISHfp pfninterrupt Change define of this function for the target OS NCGVGISHfp pfninterrupt The interrupt callback function Error code If there is no error the return value is no err 6 10 3 NCGVG Detach ISR NCGVG Detach ISR RO1AN2162EJ0200 Rev 2 00 Page 99 of 128 Jul 31 2015 RENESAS RZ A1 RGA Outline Header Declaration Description Argument Return value 6 10 3 10 NCGVGISRfp Unregisters the interrupt callback function for Renesas Graphics Processor for OpenVG R GPVG2 ncg vg isr h NCGint32 NCGVG Detach ISR NCGVGISHfp pfnlInterrupt Change define of this function for the target OS NCGVGISHfp pfninterrupt The interrupt callback function Error code If there is no error the return value is no err NCGVGISHfp Outline Type of the interrupt callback function for Renesas Graphics Processor for OpenVG R GPVG2 Header ncg defs h Declaration NCGuint32 NCGVGISRfp void Description Call RH GRAPHICS Onlnterrupting function from the last of this callback function In attached RGPNCG NCGVGISRfp type function is NCGVG_RGPVG_ISR Argument None Return value 6 10 3 11 NCGVG Init
39. for RGPNCG NCGenum Abstract of enumeration type for RGPNCG NCGboolean Abstract of _Bool type for RGPNCG NCGbitfield Abstract of bit flags type for RGPNCG 6 NCGchar Abstract of string type for RGPNCG NCGint8 Abstract of int8 t type for RGPNCG NCGint16 Abstract of int16 t type for RGPNCG NCGint32 Abstract of int32 t type for RGPNCG NCGint64 Abstract of int64_t type for RGPNCG 6 NCGuint8 Abstract of uint8 t type for RGPNCG NCGuint16 Abstract of uint16 t type for RGPNCG NCGuint32 Abstract of uint32 t type for RGPNCG NCGuint64 Abstract of uint64 t type for RGPNCG NCGfloat32 Abstract of IEEE 754 single precision floating point number type for RGPNCG amp NCGfloat64 Abstract of IEEE 754 double precision floating point number type for RGPNCG 6 NCGsizei Unsigned integer type described a size for RGPNCG 6 NCGclampf Abstract of floating point number type let the value from 0 0 to 1 0 for RGPNCG NCGfixed Abstract of fixed point number type for RGPNCG 6 Not used in RGA RO1AN2162EJ0200 Rev 2 00 Page 40 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 6 8 Changing state of class Figure 6 1 shows a Figure of changing state of graphics t class and Table 6 1 shows List of functions of each classes having R Finalize member function The function not changing state can be called at Normal state Start state Undefined J R_GRAPHICS_InitConst 2 Uninitialized Ew E R GRAPHICS Finalize R GRAPHICS
40. function OS Porting Layer OSPL Sample Program Argument int fast32 t ChannelNum Channel number of the screen int fast32 t Swaplnterval Number of V Sync interrupts until the frame buffer is swapped 0 or more than O bool t Is1VSyncAtMinimum Information on whether at least one V Sync is waited false never wait true wait 1 times or more than 1 r ospl async t Async Input Output Notify setting NULL is not permitted Return value Error code If there is no error the return value is 0 6 9 11 6 R V SYNC Onlnterrupting R V SYNC Onlnterrupting Outline Receives V Sync interrupt Header RGA h vsync h Declaration errnum t R V SYNC Onlnterrupting r ospl interrupt t InterruptSource Description See R DRIVER Onlnterrupting function OS Porting Layer OSPL Sample Program Argument r ospl interrupt t Interrupt source InterruptSource Return value Error code If there is no error the return value is 0 69 11 7 R V SYNC GetAsyncStatus RH V SYNC GetAsyncStatus Outline Gets the status of asynchronous operation and interrupt RO1AN2162EJ0200 Rev 2 00 Page 86 of 128 Jul 31 2015 RENESAS RZ A1 RGA Header RGA h vsync h Declaration errnum t R V SYNC GetAsyncStatus int fast32 t ChannelNum constr v sync async status t out Status Description See R DRIVER GetAsyncStatus function OS Porting Layer OSPL Sample Program Argument int fast32 t ChannelNum Channel number of the screen const Output Pointer
41. gt ease in ease out ease in out RO1AN2162EJ0200 Rev 2 00 Page 89 of 128 Jul 31 2015 RENESAS RZ A1 RGA Example timing name linear value of previous keyframe 10 value of next keyframe 20 clamp time 0 5 This case returns 15 Argument animation timing function t The animation timing object self float32 t clamp time The percentage of time from previous key frame clamp 0 0 to next key frame clamp timez1 0 decimal from 0 0 to 1 0 float32 t The value of attribute at the previous key frame value of previous keyframe float32 t The value of attribute at the next key frame value of next keyframe Return value The value of attribute at the time of clamp time argument RO1AN2162EJ0200 Rev 2 00 Page 90 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 14 Other Functions 6 9 14 1 List of Functions Section Function Name Description 6 9 14 2 R RGA Get R8G8B8A8 Returns the R8G8B8A8 color value 6 9 14 3 CalcWorkBufferSize Calculates the size required for the work buffer 6 9 14 4 R RGA CalcWorkBufferB Size Calculates the size required for the work buffer B 6 9 142 Get R8G8B8A8 Get R8G8B8A8 Outline Returns the R8G8B8A8 color value Header RGA h Declaration r8g8b8a8 t R Get R8G8B8A8 int t red int t green int t blue int t alpha Description Argument int t red int t green Each color component 0 to 255 int t blue int t alpha Return v
42. h Declaration errnum_t WindowSurfacesClass swap buffers int fast32 t layer Canvas2D ContextClass amp context Description See 6 9 9 7 R WINDOW SURFACES SwapBuffers Argument int fast32 t layer num Layer number 0 Innermost 1 Next to the innermost layer Outline Canvas2D ContextClass amp Drawn graphics context context Return value Error code If there is no error the return value is 0 6 9 86 alloc offscreen stack WindowSurfacesClass alloc offscreen stack WindowSurfacesClass Outline Allocates the off screen buffer from VRAM stack Header RGA h Declaration errnum_t WindowSurfacesClass alloc offscreen stack frame buffer t in out frame buffer Description See 6 9 9 12 R WINDOW SURFACES AllocOffscreenStack Argument frame buffer t Input output The off screen buffer in out frame buffer Return value Error code If there is no error the return value is O 6 9 87 free offscreen stack WindowSurfacesClass free offscreen stack WindowSurfacesClass Outline Frees the off screen buffer to VRAM stack Header RGA h Declaration errnum_t WindowSurfacesClass free_offscreen_stack const frame buffer t frame buffer Description See 6 9 9 13 R WINDOW SURFACES FreeOffscreenStack Argument frame buffer t Input output The freeing off screen buffer out frame buffer Return value Error code If there is no error the return value is O 6 9 8 8 do message loop WindowSurfacesClass do message loop W
43. int t destination width Width and height of the drawing target int t destination height Return value Error code If there is no error the return value is O 6 9 1 32 GRAPHICS FillRect R GRAPHICS FillRect Outline Fills the rectangle area specified by the argument Header RGA h Declaration errnum_t R GRAPHICS FillRect graphics t self int t min x int t min y int t width int t height Description This function is affected by the current matrix the current fill and clipping No border is drawn This function is affected GRAPHICS SetGlobalAlpha Argument graphics t self Graphics drawing context int tmin x int tmin y Minimum X and Y coordinates of rectangle int t width int t height Width and height of rectangle Return value Error code If there is no error the return value is O 6 9 1 33 GRAPHICS SetFillColor R GRAPHICS SetFillColor Outline Changes the paint object of the current fill to single color fill and sets the fill color Header RGA h RO1AN2162EJ0200 Rev 2 00 Page 58 of 128 Jul 31 2015 RENESAS RZ A1 RGA Declaration errnum_t R GRAPHICS SetFillColor graphics t self rg8b8a8 t Color Description The initial value is opaque black Argument graphics t self Graphics drawing context r8g8b8a8 t color Fill color Use RGA Get R8G8B8A68Y for the fill color setting Return value Error code If there is no error the return value is 0 6 9 1 34 GRAPHICS SetFillPatte
44. neither intended nor authorized for use in products or systems that may pose a direct threat to human life or bodily injury artificial life support devices or systems surgical implantations etc or may cause serious property damages nuclear reactor control systems military equipment etc You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application for which it is not intended Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for which the product is not intended by Renesas Electronics 6 You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges 7 Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions Further Renesas Electronic
45. of pixel format including the alpha component ARGB8888 ARGB4444 ARGB1555 An example of pixel format without alpha component XRGB8888 RGB565 YUV422 RO1AN2162EJ0200 Rev 2 00 Page 70 of 128 Jul 31 2015 RENESAS RZ A1 RGA Argument graphics_image_t Image Image int tMinX int t MinY Minimum X and Y coordinates of drawing destination int t Width int t Height Width and height of drawing destination int t SourceMinX Minimum X and Y coordinates in the image int t SourceMinY int t SourceWidth Width and height in the image int t SourceHeight int t DestinationMinX Minimum X and Y coordinates of drawing destination int t DestinationMinY int t DestinationWidth Width and height of drawing destination int t DestinationHeight Return value 6 9 57 createlmageData Canvas2D ContextClass createlmageData Canvas2D_ContextClass Outline Creates an image object of r8g8b8a8 t Header RGA h Declaration Canvas2D ImageClass Canvas2D ContextClass createlmageData int t Width int t Height Canvas2D ImageClass Canvas2D ContextClass createlmageData Canvas2D ImageClass ImageReferencedWidthHeight Description Secures a memory area internally from the heap area Argument int t Width int t Height Width and height of image Canvas2D ImageClass Image object that references width and height ImageReferencedWidthHeight Return value Created Image object undefined Error 6 9 5 8 getlmageData Canvas2D ContextClass getIm
46. on the setting of stride alignment and so on If this image data had CLUT Color Look Up Table Palette there are image data after CLUT The elements of CLUT are ARGB8888 format depended on the endian by endian setting The count of elements are 256 CLUT8 16 CLUT4 or 2 CLUT1 7 1 6 Input Formats e BMP format 32 bits or 24 bits 256 16 or 2 colors for CLUT e PNG format Supports data with alpha e JPEG format See the description on path of ImagePackager InputFiles Image 7 1 7 Parameters That Be Described in BinarylmageConfig image xml ImagePackager OutputBinary One or more parameters Two or more parameters are used to output both Binary language and C language path Path of the binary file output destination Essential symbol C language s external reference symbol global variable name that supports all binary files Essential When outputting multiple binary files do not change this parameter in each binary file When ImagePackager OutputHeader address is set this parameter is a macro name having the address value language Programming language of output binary data Optional Binary and C SRec S record can be set Binary is set by default section Specified section is embedded in the output source Example section _Binarylmage C_Binarylmage section is created This is filled at Section in ImagePackager SourceTemplate RO1AN2162EJ020
47. possible Unused pins should be handled as described under Handling of Unused Pins in the manual 2 Processing at Power on The state of the product is undefined at the moment when power is supplied The states of internal circuits in the LSI are indeterminate and the states of register settings and pins are undefined at the moment when power is supplied In a finished product where the reset signal is applied to the external reset pin the states of pins are not guaranteed from the moment when power is supplied until the reset process is completed In a similar way the states of pins in a product that is reset by an on chip power on reset function are not guaranteed from the moment when power is supplied until the power reaches the level at which resetting has been specified 3 Prohibition of Access to Reserved Addresses Access to reserved addresses is prohibited The reserved addresses are provided for the possible future expansion of functions Do not access these addresses the correct operation of LSI is not guaranteed if they are accessed 4 Clock Signals After applying a reset only release the reset line after the operating clock signal has become stable When switching the clock signal during program execution wait until the target clock signal has stabilized When the clock signal is generated with an external resonator or from an external oscillator during a reset ensure that the reset line is only released after full
48. return value is 0 R01AN2162bEJ0200 Rev 2 00 Page 82 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 9 11 R WINDOW SURFACES AccessLayerAttributes WINDOW SURFACES AccessLayerAttributes Outline Accesses attributes of the specified display layer Header RGA h window_surfaces h Declaration errnum_t R_WINDOW_SURFACES AccessLayerAttributes window_surfaces_t self layer_attributes_t in_out_attributes Description Not all attributes are available It depends on the device and support status Argument window surfaces t self Frame buffers and screen display layer attributes t Input output Attributes of layer 6 6 5 7 in out attributes Return value Error code If there is no error the return value is 0 6 9 9 12 WINDOW SURFACES AllocOffscreenStack R WINDOW SURFACES AllocOffscreenStack Outline Allocates the off screen buffer from VRAM stack Header RGA h window surfaces h Declaration errnum t R WINDOW SURFACES AllocOffscreenStack window surfaces t self frame bufer t in out frame buffer Description Input member variable in frame buffer t is stride height buffer count Output member variable in frame buffer t is all element of buffer address array If the memory was few E FEW ARRAY error is returned Allocated off screen buffer is freed by calling H WINDOW SURFACES Finalize function Argument window surfaces t self Frame buffers and screen display frame bufer t Input output The off s
49. stabilization of the clock signal Moreover when switching to a clock signal produced with an external resonator or by an external oscillator while program execution is in progress wait until the target clock signal is stable 5 Differences between Products Before changing from one product to another i e to one with a different type number confirm that the change will not lead to problems The characteristics of MPU MCU in the same group but having different type numbers may differ because of the differences in internal memory capacity and layout pattern When changing to products of different type numbers implement a system evaluation test for each of the products Notice 1 Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information 2 Renesas Electronics has used reasonable care in preparing the information included in this document but Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omiss
50. t width int t height Width and height of image Return value Error code If there is no error the return value is 0 69 23 R GRAPHICS IMAGE JInitSameSizeR8G8B8A8 R GRAPHICS IMAGE InitSameSizeR8G8B8A8 Outline Initializes the image object to the same width and height Header RGA h Declaration errnum t R GRAPHICS IMAGE InitSameSizeR8G8B8A8 graphics image t self void image data array size timage data array size graphics image t same size image Description Initializes internal variables Argument graphics image t self Image void image data array X Starting address of an array to be a memory area that stores images size t Size bytes of the memory area indicated by image data array size image data array graphics image t Image object that references width and height same size image Return value Error code If there is no error the return value is O 6924 GRAPHICS IMAGE InitCopyFrameBufferR8G8B8A8 R GRAPHICS IMAGE InitCopyFrameBufferR8G8B8A8 Outline Initializes the image object to which a part of frame buffer being displayed is copied RO1AN2162EJ0200 Rev 2 00 Page 64 of 128 Jul 31 2015 RENESAS RZ A1 RGA Header RGA h Declaration errnum t R GRAPHICS IMAGE InitCopyFrameBufferR8G8B8A8 graphics image t self void image data array size timage data array size graphics t context int tmin x int t min y int t width int t height Description Initializes internal variables Acquirable image data
51. the screen Return value Error code or e 0 successful and e 0 RO1AN2162EJ0200 Rev 2 00 Page 85 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 11 4 R V SYNC Wait R V SYNC Wait Outline Waits until the V Sync interrupt enters Header RGA h h vsync h Declaration errnum t R V SYNC WaitForlnterrupt int fast32 t ChannelNum int fast32 t Swaplnterval bool t Is1 VSyncAtMinimum Description Waits until the V Sync interrupt enters for the number of times specified by Swaplnterval from the previous swap In the case of Is1VSyncAtMinimum false when the V Sync interrupt has already entered for the number of times specified by Swaplnterval the processing immediately returns from this function Argument int fast32 t ChannelNum Channel number of the screen int fast32 t Swaplnterval Number of V Sync interrupts until the frame buffer is swapped 0 or more than 0 bool t Is1VSyncAtMinimum Information on whether at least one V Sync is waited false never wait true wait 1 times or more than 1 Return value Error code If there is no error the return value is O 6 9 11 55 R V SYNC WaitStart V SYNC WaitStart Outline Starts to wait for V Sync interrupt Header RGA h vsync h Declaration errnum t R V SYNC WaitStart int fast32 ChannelNum int fast32 t Swaplnterval bool t Is1 VSyncAtMinimum r ospl async t Async Description This is the asynchronous function of R V SYNC Wait function See R DRIVER TransferStart
52. wait for drawing 6 9 1 9 R GRAPHICS GetAsyncStatus Gets the status of asynchronous operation and interrupt 6 9 1 10 R GRAPHICS Onlnterrupting Receives interrupts of drawing hardware 6 9 1 11 R GRAPHICS Save Saves the set value of context to the specified status structure 6 9 1 12 R GRAPHICS Restore Returns the status structure content to context 6 9 1 13 R GRAPHICS ResetMatrix Resets the target matrix of the matrix calculation function to the unit matrix 6 9 1 14 R GRAPHICS SetMatrix 2x3 Sets each element of the matrix 2x3 6 9 1 15 GRAPHICS SetMatrix 3x3 Sets each element of the matrix 3x3 6 9 1 16 R GRAPHICS GetMatrix 3x3 Acquires each element of the matrix 6 9 1 17 R GRAPHICS TranslateMatrixl Translates matrix from the current matrix integer type specified 6 9 1 48 R GRAPHICS TranslateMatrix Translate matrix from the current matrix floating point type specified 6 9 1 19 GRAPHICS ScaleMatrix Enlarges or reduces matrix from the current matrix 6 9 1 20 R GRAPHICS RotateMatrixDegree Rotates matrix from the current matrix Rotation center 0 0 6 9 1 21 R GRAPHICS ShearMatrix Makes shear deformation from the current matrix 6 9 1 22 GRAPHICS TransformMatrix Multiplies the current matrix by the specified 2x3 matrix 6 9 1 23 GRAPHICS MultiplyMatrix Multiplies the current matrix by the specified 3x3 matrix 6 9 1 24 R GRAPHICS GetProjectiveMatrix Acquires a matrix that deforms a random profile q
53. work area Refer to RH OSPL SET DEBUG WORK 5 E EXIT TEST 0x1E 30 Request of exit from the test E NOT SUPPORTED PIXEL 0x9400 Unsupported pixel format FORMAT 37888 Change to supported pixel format See Table 1 2 Available Pixel Formats of Drawing Destination 6 6 3 Types Only for the C Language The following are types supplied by the RGA and used only for the C language Type definitions shown in this section are also available for the C language but there are classes available for the C language For details see section 6 6 4 For types available for the C language also see section 6 6 5 Types Classes Available for C Language and C Language 6 6 3 1 List of Types Table 6 3 C Language Dedicated Types Provided by RGA Section Type Description 6 6 3 2 graphics_t Graphics drawing context 6 6 3 3 graphics image t Input image 6 6 3 4 graphics pattern t Image arranged pattern 6 6 32 graphics t graphics t structure Outline Graphics drawing context Header RGA h Description Function equivalent to the member function See section 6 9 1 Renesas Graphics Processor for OpenVG R GPVG2 or software rendering is used in the RZ A1H Member Variable Access Inhibit 6 6 3 3 graphics image t graphics image t structure Outline Image Header RGA h Description Function equivalent to the member function See section 6 9 1 42 The ImagePackager tool converts this type from a
54. 0 Rev 2 00 Page 118 of 128 Jul 31 2015 RENESAS RZ A1 Qendian image alignment image alignment symbol raw stride alignment raw stride alignment 4 Qtable format 2source template Qsuper class R01AN2162bEJ0200 Rev 2 00 Jul 31 2015 RGA Endian Optional LittleEndian or BigEndian can be selected endian pointed from super_class is set by default Alignment bytes of the starting address of raw format image data Optional Only 2 can be set Qraw image alignment pointed from super class is set by default When outputting multiple binary files do not change this parameter in each binary file The raw format header is not aligned by this setting The define symbol name containing the raw image alignment value Optional The define symbol name is output to the header file to be generated Compile the program using binary files by using the header Example raw image alignment symbol GRAPHICS RAW IMAGE ALIGNMENT The code filled in the header file define RAW IMAGE ALIGNMENT 32 The define sentence of the symbol name is not output by default When outputting multiple binary files do not change this parameter in each binary file Alignment of the number of bytes up to the line immediately below in an image to be output Optional The number of bytes is carried to a multiple of the value specified for value Qraw stride alignm
55. 2 4 height Image height 6 8 2 5 data Array containing pixel color components 6 8 22 SIC graphics image t Canvas2D ImageClass src set only This property retains the raw image data structure created by ImagePackager 6 82 3 width int t Canvas2D ImageClass width get only This property retains the image width 6 8 2 4 height int_t Canvas2D ImageClass height get only This property retains the image height 6 8 2 5 data uint8 t Canvas2D ImageClass data get only This property is an array containing pixel color components Upper left is the top Color components are arranged in the order of R G B and A R G B A 0 to 255 RO1AN2162EJ0200 Rev 2 00 Page 45 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 Functions and Methods 6 9 1 Functions Equivalent to graphics t Class Member Function 6 9 1 1 List of Functions Section Function Name Description 6 9 1 2 R GRAPHICS InitConst Initializes the constant part 6 9 1 3 R GRAPHICS Initialize Initializes the graphics drawing context object 6 9 1 4 GRAPHICS Finalize Finalizes the graphics drawing context object 6 9 1 5 R GRAPHICS SetFrameBuffer Changes the drawing target 6 9 1 6 R GRAPHICS GetFrameBuffer Gets the drawing target 6 9 1 7 R GRAPHICS Finish Waits until drawing is completed 6 9 1 8 R GRAPHICS FinishStart Starts to
56. 2EJ0200 Rev 2 00 Page 115 of 128 Jul 31 2015 RENESAS RZ A1 RGA 7 Tools 7 1 Image Format Conversion by ImagePackager The ImagePackager packs multiple image files into a single binary file for the target board or a source file for the target board and PC When image files are packed they can also be converted to the raw format of any pixel formats The integrated file is used as a source of binary data or C language data In an XML file specify image files to be packed File names and extension name are not ignored case insensitive comparison ImagePackager is one of commands in RGA Tools vbs It calls vbs files and exe files internally 7 1 1 Operational Procedure 1 Make image xml file 2 Double click RGA Tools vbs file at armcc common src samples RGA select ImagePackager command in opened window specify image xml file This makes header file and binary file or C language data source RGA Tools Copyright c 2012 2015 Renesas Electronics Corporation 1 Convert image format RunImagePackager 2 Search error information SearchErrorInformation Number or command 1 Renesas Image Packager Copyright c 2012 2015 Renesas Electronics Corporation Make one binary file from many image files and other files Enter only Open sample folder Setting file ImagePackagerConfig xml 3 Write include directive with a generated header file and pass a symbol of image defined in the hea
57. 4 Default value of ImagePackager OutputBinary raw_stride_alignment This default value is 1 Default value of ImagePackager OutputBinary raw_stride_alignment_4 This default value is Zero one or more elements Path of target file attached with SuperClass Wildcard can be specified Essential Example path jpg Default value of ImagePackager InputFiles File alignment This default value is 4 Page 123 of 128 RENESAS RZ A1 RGA 7 2 Searching for Error Information by SearchErrorlnformation When an error occurs in the debug version library the R DEBUG BREAK IF ERROR function shows the location raising an error For RZ A1 it output the following message to serial output If target board did not have serial port there is the way of getting error information by using LED and so on See following sentence printf output ERROR error ID 1 file C folder Library c 2095 gt If you want to change to debug configuration change the linking library from lib RGA For lt SubModule gt Release RGA a to lib RGA For lt SubModule gt Debug RGA a delete R_OSPL_NDEBUG 1 in define of the project settings When the SearchErrorInformation command is executed by double clicking RGA_Tools vbs more advanced error information than the error code can be obtained from the file name and the line number in the library Window after RGA_Tools vbs is double clicked RGA Tools Copyrigh
58. GB1555 4 1 lt lt 6 0x44 ARGB1555 PIXEL FORMAT YCbCr422 2 1 lt lt 16 0x10002 YCbCr422 PIXEL_FORMAT_YUV422 2 1 lt lt 16 0x10002 YUV422 PIXEL FORMAT YUV422 G 2 1 lt lt 16 0 10002 YCbCr422 RAY SCALE IS 0x80 Cb Cr 0x80 is gray PIXEL FORMAT JPEG 12 2 lt lt 8 0x20C JPEG PIXEL FORMAT PNG 12 3 lt lt 8 0x30C PNG PIXEL_FORMAT_GIF 12 4 lt lt 8 0x40C GIF Reserved PIXEL_FORMAT_CLUT1 12 1 lt lt 12 0x100C 1 bit CLUT PIXEL_FORMAT_CLUT4 12 4 lt lt 12 0x400C 4 bit CLUT PIXEL_FORMAT_CLUT8 12 8 lt lt 12 0x800C 8 bit CLUT 6 6 5 11 frame_buffer_delegate_t This is a class of objects referenced from the delegate member variable of frame_buffer_t This class can be defined by libraries that use frame_buffer_t or by the application This class is defined as follows by default Therefore frame_buffer_t delegate is a void type include RGA h typedef void frame buffer delegate t To change the type define the type before performing include for the header file that defines frame_buffer_delegate_t and then perform define frame_buffer_delegate_t frame_buffer_delegate_t RO1AN2162EJ0200_ Rev 2 00 Jul 31 2015 RENESAS Page 35 of 128 RZ A1 RGA typedef MyFrameBufferClass frame buffer delegate t fdefine frame buffer delegate t frame buffer delegate t include RGA h default define frame buffer delegate t 6 6 5 12 V sync t
59. Operating voltage Power supply voltage I O 3 3V Power supply voltage Internal 1 18V Integrated development environment ARM integrated development environment ARM Development Studio 5 DS 5TM Version 5 16 C compiler ARM C C Compiler Linker Assembler Ver 5 03 Build 102 Compiler options Excluded directory path O3 Ospace cpu Cortex A9 littleend arm apcs interwork no unaligned access fpu vfpv3 fp16 g Operating mode Boot mode 0 CSO space 16bit boot Communication setting of terminal software e Communication speed 115200bps e Data length 8 bits e Parity None e Stop bit length 1 bit e Flow control None Board used GENMAI board e RTK772100BC00000BR R7S72100 CPU board e RTK77210000B00000BR R7S72100 Option board Device used LCD Serial interface D sub 9 pin connector R01AN2162bEJ0200 Rev 2 00 Jul 31 2015 Page 11 of 128 RENESAS RZ A1 RGA 4 Reference Application Note s For additional information associated with this document refer to the following application note s RZ AIH Group Example of Initialization RO1AN1646EJ RZ AIH Group I O definition header file lt iodefine h gt RO1AN1860EJ RZ AIH Group OS porting layer OSPL Sample Program RO1 AN1887EJ RO1AN2162EJ0200 Rev 2 00 Page 12 of 128 Jul 31 2015 RENESAS RZ A1 RGA 5 Description of Hardware 5 1 Hardware Configuration Figure 5 1 shows
60. RAPHICS GetGlobalComposite Acquires the calculation method for alpha blend Operation 6 9 1 42 R GRAPHICS STATIC SetOnlnitiali Registers a callback function that sets the default ze graphics config t value 6 9 1 48 R GRAPHICS STATIC SetOnFinaliz Registers a function that releases the memory allocated e in the R GRAPHICS Onlnitialize FuncType function 6 9 1 44 R GRAPHICS SetQualityFlags Sets the drawing quality 6 9 1 45 R GRAPHICS GetQualityFlags Acquires the current drawing quality 6 9 1 46 R GRAPHICS SetStrokeColor Sets the color used for single color fill for the paint object of the current border 6 9 1 47 R GRAPHICS StrokeRect Draws sides of rectangle 6 9 1 48 R GRAPHICS BeginSoftwareRender Notifies the graphics library of the start of software ing rendering 6 9 1 49 R GRAPHICS EndSoftwareRenderin Notifies the graphics library of the end of software 9 rendering 6 9 1 50 R GRAPHICS EndRenderinglInFin Calls this function from the end of the function that performs software rendering 6 9 1 51 R GRAPHICS BeginSoftwareRender GRAPHICS BeginSoftwareRendering for the ing2 memory on L2 cache 6 9 1 52 GRAPHICS BeginSoftwareRender Calls R GRAPHICS BeginSoftwareRendering2 ingA depending on the address RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 Page 47 of 128 RENESAS RZ A1 RGA 6 9 1 2 GRAPHICS lInitConst GRAPHICS _InitConst Outline Initializes the constant part used by
61. RENESAS APPLICATION NOTE RZ A1 Group R01AN2162EJ0200 Rev 2 00 Graphics Library RGA Jul 31 2015 Introduction This application note describes the Graphics Library RGA Renesas Graphics Architecture of RZ A1 The following lists features of the RGA Allows high speed drawing using the hardware acceleration The API created based on the W3C standard HTML Canvas 2D Context achieves easy learning In addition the RGA provides C API that is operable as an interface that is backward compatible with HTML Canvas 2D Context The memory area provided by the application is available as a drawing destination or for input images Allows drawing of translucent images and translucent drawing using an alpha mask The RGA provides a conversion tool that can access image files as global variables This conversion tool operates on the host PC Target Device RZ A1H RZ AIM RZ AIL Restrictions This library is not compatible with the vector graphics supported by Renesas Graphics Processor for OpenVG R GPVG2 The hardware acceleration is used only for a part of drawing Table 1 2 6 11 1 RZ A1L does not use hardware acceleration And it can not use a part of drawing Table 1 3 This library cannot be used in multiple tasks Use the RGA in a single task RO1AN2162EJ0200 Rev 2 00 Page 1 of 128 Jul 31 2015 RENESAS RZ A1 RGA Contents Graphics Library RGA m T
62. RGA h Declaration errnum t R GRAPHICS Clip graphics t self Description When the current default path is empty or is not a rectangle an error occurs When the current default path is empty drawing is disabled in any area If this function is called when the current clipping area is a part of the frame buffer the area common to the previous clipping area and the default path becomes a new clipping area RO1AN2162EJ0200 Rev 2 00 Page 59 of 128 Jul 31 2015 RENESAS RZ A1 RGA To restore entire drawing call R GRAPHICS Restore Argument graphics t self Graphics drawing context Return value Error code If there is no error the return value is O 6 9 1 38 GRAPHICS SetGlobalAlpha R GRAPHICS SetGlobalAlpha Outline Sets an alpha value opacity to be multiplied by all drawings Header RGA h Declaration errnum t R GRAPHICS SetGlobalAlpha graphics t self uint8 t alpha value Description The default value is 255 This function affects the following drawing functions Figure fill functions such as R GRAPHICS FillRect Pattern drawing function R GRAPHICS FillRect Border drawing functions such as R GRAPHICS StrokeRect Image drawing functions such as R GRAPHICS Drawlmage This function does not affect the following drawing function R GRAPHICS Clear Argument graphics t self Graphics drawing context uint8 t alpha value Alpha value 0 to 255 A smaller value makes drawing light Return value Error code If there is n
63. RZ A1H SDRAM is out of PL310 which has L2 cache If the target frame buffer the source image is in SDRAM it is necessary to set and operate related with PL310 6 1 5 1 Setting of enabling L2 cache If PL310 Enable function was not called write like the following code which calls PL310 Enable function for enabling L2 cache include core ca9 io h for pl310 h include p1310 h L2 cache If present you may also need to Invalidate and Enable L2 cache here 12 id PL310 GetID if 12 id ty L310 InvAllByWay PL310 Enable 6 11 5 2 Setting of NS bit in MMU of CPU Set 1 at NS bit in MMU TTB of SDRAM area if NS bit was set 0 6 11 5 3 Setting of the cache attribute output from bus masters AWCACHE ARCACHE If memory map was changed modify define of R_OSPL_AXI_Get2ndCacheAttribute function and R OSPL MEMORY GetLevelOfFlush function in OSPL porting layer RGA changes the cache attribute setting AWCACHE ARCACHE in the register of RZ A1H depend on whether bus masters Renesas Graphics Processor for OpenVG R GPVG2 and JPEG Codec Unit JCU access On Chip RAM or SDRAM RGA gets the value of the cache attribute from above porting functions 6 11 54 Changing calling functions for fast manual flush mode In RZ A1H if a frame buffer or a source image was in SDRAM and all bus master in RZ A1H access to SDRAM using L2 cache it does not have to flush L2 ca
64. S GetClearColor Outline Acquires the color used for R GRAPHICS Clear Header RGA h Declaration errnum t R GRAPHICS GetClearColor graphics t self r amp g8b8a8 t out color Description Use GRAPHICS SetBackgroundColor to set the clear color Argument graphics t self Graphics drawing context r8g8b8a8_t out color Output Clear color Return value Error code If there is no error the return value is O 6 9 1 28 GRAPHICS Clear R GRAPHICS Clear Outline Clears the rectangle area Header RGA h Declaration errnum t R GRAPHICS Clear graphics t self int t min x int t min y int t width int t height Description Use GRAPHICS SetBackgroundColor to set the clear color When a double buffer is used the drawing buffer is cleared Therefore the cleared content is not displayed only by calling this function Use R WINDOW SURFACES SwapBuffers to apply display This function is affected by clipping Argument graphics t self Graphics drawing context int t min x int t min y Rectangle area int t width int t height Return value Error code If there is no error the return value is O 6 9 1 29 GRAPHICS Drawlmage R GRAPHICS Drawlmage Outline Draws an image at coordinates min x min y with the same size Header RGA h Declaration errnum t R GRAPHICS Drawlmage graphics t self graphics image t image int tmin x int t min y Description Image data to be specified for the image argument can
65. SetFrameBuffer GRAPHICS SetFrameBuffer Outline Changes the drawing target Header RGA h Declaration errnum t R GRAPHICS SetFrameBuffer graphics t self frame buffer t frame buffer Description Argument graphics t self Graphics drawing context frame buffer t frame buffer Frame buffer to be drawn Return value Error code If there is no error the return value is O 69 1 6 R GRAPHICS GetFrameBuffer GRAPHICS GetFrameBuffer RO1AN2162EJ0200 Rev 2 00 Page 48 of 128 Jul 31 2015 RENESAS RZ A1 RGA Outline Gets the drawing target Header RGA h Declaration errnum t R GRAPHICS GetFrameBuffer graphics t self frame buffer t out frame buffer Description Argument graphics t self Graphics drawing context frame buffer t Output Frame buffer to be drawn out frame buffer Return value Error code If there is no error the return value is O 6 9 17 R GRAPHICS Finish R GRAPHICS Finish Outline Waits until drawing is completed Header RGA h Declaration errnum t R GRAPHICS Finish graphics t self Description This waits for finish drawing by RGA or by the application directly to the frame buffer and changes to the state to able to show the frame buffer In fast manual flush mode see section 6 11 4 when the CPU directly reads or writes frame buffer data in the cache area or non cache area after the RGA API is called enclose by calling R GRAPHICS BeginSoftwareRendering to R GRAPHICS End
66. SoftwareRendering These functions wait hardware rendering and flush the CPU cache only if necessary If the process waits for finish drawing asynchronously call R GRAPHICS FinishStart function Argument graphics t self Graphics drawing context Return value Error code If there is no error the return value is 0 6 9 1 8 R GRAPHICS FinishStart R GRAPHICS FinishStart Outline Starts to wait for drawing Header RGA h Declaration errnum t R GRAPHICS FinishStart graphics t self ospl async t Async Description This is asynchronous version of R GRAPHICS Finish function See R DRIVER TransferStart function OS Porting Layer OSPL Sample Program Argument graphics t self Graphics drawing context r ospl async t Async Input Output Notify setting NULL is not permitted Return value Error code If there is no error the return value is O 6 9 1 9 R GRAPHICS GetAsyncStatus R GRAPHICS GetAsyncStatus Outline Gets the status of asynchronous operation and interrupt Header RGA h Declaration errnum t R GRAPHICS GetAsyncStatus graphics t self const graphics async status t out Status Description See R DRIVER GetAsyncStatus function OS Porting Layer OSPL Sample Program Argument graphics t self Graphics drawing context const graphics async status t Output Pointer to the structure of interrupt and out Status asynchronous operation Return value Error code If there is no error the return value is 0 RO1AN2162EJ0200
67. TATE WAIT OR Waits for any bits are 1 that bits are 1 in the specified ui32State argument NCGuint32 ui32Timeout NCG TIMEOUT INFINITE is passed Error code If there is no error the return value is NCG no err 6 10 3 6 NCGSYS SetStateEventValue NCGSYS SetStateEventValue Outline Header Declaration Description Argument Return value Sets using value of OS event flags ncg state h NCGvoid NCGSYS SetStateEventValue NCGvoid pObj NCGuint32 ui32EventValue Define this function if not defined If thread attached event of OSPL was called it is not have to change define Event flags specified with NCGSYS_SetState function is set to variables in NCG Event flags specified with NCGSYS_SetStateEventValue function is set to OS objects NCGvoid pObj A event flag of NCG NCGuint32 ui82EventValue Value setting to OS event flags None 6 10 3 7 NCGSYS GetLastCreatedState NCGSYS GetLastCreatedState Outline Header Declaration Description Argument Return value Returns last created event flags ncg state h NCGvoid NCGSYS GetLastCreatedState void Define this function if not defined If thread attached event of OSPL was called it is not have to change define This function returns an event flags created by NCGSYS CreateState function Thread preemption does not occurred from calling NCGSYS CreateState function to calling NCGSYS_GetLastCreatedState function None Last created event
68. _SOURCE_IMAGE_STRIDE_ALIGNMENT constant value In RGA example run the batch file RGAH bat or RGAS bat in the following folder RGA_Sample armcc common src samples RGA Sample_Common Images BinaryImageMakeRG AH bat BinaryImageMakeRGAS bat RO1AN2162EJ0200 Rev 2 00 Page 105 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 11 4 Flush Mode In auto flush mode drawn content can be displayed only by calling R GRAPHICS Finish or R WINDOW SURFACES SwapBuffers In fast manual flush mode however cache flush operation is required Auto flush mode is enabled by default In this mode you need not pay attention to the description of this section To enable fast manual flush mode set graphics config t is fast manual flush to true Since unnecessary flush operation is not performed in the graphics library in this mode the processing may be performed quickly To perform the flush operation efficiently enclose the processing that accesses the frame buffer shared with the drawing hardware or image data by R GRAPHICS BeginSoftwareRendering section 6 9 1 48 to R GRAPPHICS EndSoftwareRendering section 6 9 1 49 When the application defined buffer was drawn by software call GRAPHICS Finish in similar to drawing by RGA R GRAPHICS BeginSoftwareRendering Access the frame buffer shared with the drawing hardware or image data R GRAPHICS EndSoftwareRendering R GRAPHICS EndRenderingInFin At the end of functio
69. age file Outline of ____ bmp jpg png image data Binary module provided by Renesas Sample source provided by Renesas Interface 1 RZ AIL does not have the function The function is operated by software Figure 1 1 Block Diagram The coordinate system of this library has an origin at the upper left The value in the X axis direction increases from left to right The value in the Y axis direction increases downward The maximum width of a frame buffer to be drawn RO1AN2162EJ0200 Rev 2 00 Page 4 of 128 Jul 31 2015 RENESAS RZ A1 RGA is 1280 pixels and its maximum height is 1024 pixels The maximum size of source image is 2048x2048 First address and size of 1 line of the frame buffer and source image must be a multiple of 32 Left Right Left Right ee 0 0 X axis 0 0 X axis Up Up Cie 1279 0 Target Frame Buffer Source Image 0 1023 D Down own 0 2047 Y axis Y axis Figure 1 2 Max size of drawing target and source image Table 1 2 Available Pixel Formats of Drawing Destination ox o gt ay a gt RE amp lt p 29 9 Bo e 00 00 00 00 Q a Hardware rendering V V Software rendering V V V V V V V Matrix enlargement V V reduction blend Image drawing 3 6 9 1 29 etc DrawlmageChild V V
70. ageData Canvas2D ContextClass Outline Creates an image object to which a part of the frame buffer being displayed is copied Header RGA h Declaration Canvas2D ImageClass Canvas2D ContextClass getlmageData int t MinX int t MinY int t Width int t Height Description Argument int tMinX int t MinY Minimum X and Y coordinates of range to be acquired frame buffer coordinates int t Width int t Height Width and height of range to be acquired Return value Created Image object undefined Error 6 9 5 9 putlmageData Canvas2D ContextClass putlmageData Canvas2D ContextClass Outline Draws an image Header RGA h Declaration void Canvas2D_ContextClass putImageData Canvas2D ImageClass ImageData t MinX int t MinY void Canvas2D ContextClass putlmageData Canvas2D ImageClass ImageData iint t MinX int t MinY int t DirtyX int t DirtyY int t DirtyWidth int t DirtyHeight Description When DirtyX DirtyY DirtyWidth or DirtyHeight is specified a part of the Image object image is drawn but the image is not enlarged or reduced RO1AN2162EJ0200 Rev 2 00 Page 71 of 128 Jul 31 2015 RENESAS RZ A1 RGA Argument Canvas2D ImageClass Image object containing the image to be drawn ImageData int tMinX int t MinY Minimum X and Y coordinates of drawing destination canvas coordinates int t DirtyX int t DirtyY Minimum X and Y coordinates in Image Image coordinates int t DirtyWidth Size in Image Siz
71. alue R8G8B8A8 color value 6 9 143 RGA CalcWorkBufferSize R RGA CalcWorkBufferSize Outline Calculates the size required for the work buffer Header RGA h Declaration size t R RGA CalcWorkBufferSize int t MaxHeightOfFrameBuffer Description Parameters may change in the future R RGA CalcWorkBufferSize is the define macro Requested size for work buffer Maximum length of display list 64 Maximum height of the frame buffer multiple of 8 4 2 Bytes Maximum length of display list 184 See 6 6 5 3 graphics config t Argument int t Maximum height of the frame buffer to be a drawing MaxHeightOfFrameBuffer destination Return value Size bytes required for the work buffer 6 9 144 CalcWorkBufferB Size CalcWorkBufferB Size Outline Calculates the size required for the work buffer B Header RGA h Declaration size t R RGA CalcWorkBufferB Size int t MaxWidthOfJPEG int t MaxHeightOfJPEG int t MaxBytePerPixelOfFrameBuffer Description Parameters may change in the future R RGA CalcWorkBufferB Size is the define macro Requested size for work buffer B ceil_16 MaxWidthOfJPEG ceil_16 MaxHeightOfJPEG MaxBytePerPixelOfFrameBuffer Bytes ceil 16 round up to multiples of 16 When PNG image was decoded the work area size is set to work size for libPNG member variable of is allocated in work buffer B But R RGA CalcWorkBufferB Size macro is not added this size
72. aration void Canvas2D ContextClass rect int t MinX int t MinY int t Width int t Height RO1AN2162EJ0200 Rev 2 00 Page 72 of 128 Jul 31 2015 RENESAS RZ A1 RGA Description Argument Return value int t MinX int t MinY int t Width int t Height None Minimum X and Y coordinates of rectangle Width and height of rectangle 6 9 5 14 clip Canvas2D ContextClass clip Canvas2D ContextClass Outline Header Declaration Description Argument Return value Sets the shape of the current default path to a clipping area RGA h void Canvas2D ContextClass clip When the current default path is empty or is not a single rectangle an error occurs When the current default path is empty drawing is disabled in any area If this function is called when the current clipping area is a part of the frame buffer the area common to the clipping area and the default path is a new clipping area To restore entire drawing call restore None 6 9 5 15 setTransform Canvas2D ContextClass setTransform Canvas2D ContextClass Outline Header Declaration Description Argument Return value Sets each element of the current matrix RGA h void Canvas2D ContextClass setTransform graphics matrix float tsx graphics matrix float t ky graphics matrix float t kx graphics matrix float t sy graphics matrix float ttx graphics matrix float tty graphics matrix float t sx 2x3 matrix graphics m
73. ase of NCGSYS STATE SET AND Does the AND operation with the event flags Sets O to the event flags bits of the column set 0 in ui32State argument Return value Error code If there is no error the return value is NCG no err 6 10 34 NCGSYS GetState NCGSYS GetState Outline Gets the value of the event flags of RGPNCG Header ncg state h Declaration NCGuint32 NCGSYS GetState NCGvoid pObj NCGuint32 ui32Flags Description Change define of this function for the target OS If thread attached event of OSPL was called it is not have to change define Argument NCGvoid pObj The event flags object NCGuint32 ui32Flags Not used Return value The value of the event flags 6 10 3 5 NCGSYS WaitState NCGSYS WeaitState Outline Waits for the value of the event flags of RGPNCG until specified value Header ncg state h Declaration NCGint32 NCGSYS WaitState NCGvoid pObj NCGuint32 ui32State NCGuint32 ui32Flags NCGuint32 ui32Timeout Description Change define of this function for the target OS If thread attached event of OSPL was called it is not have to change define Argument NCGvoid pObj The event flags object NCGuint32 ui32State The value of bits set to 1 waiting for bits that become to 1 RO1AN2162EJ0200 Rev 2 00 Page 98 of 128 Jul 31 2015 RENESAS RZ A1 Return value RGA NCGuint32 ui32Flags Case of NCGSYS STATE WAIT AND Waits for all bits are 1 that bits are 1 in the specified ui32State argument Case of NCGSYS S
74. ate tag Essential This value is referred from ImagePackager OutputBinary source_template Template of source file Essential The following tags can be filled in the template Section Section name The value of ImagePackager OutputBinary section Symbol Variable name The value of ImagePackager OutputBinary symbol Size Size of the binary file bytes e BinaryData Binary data Template of source file if a section was specified Optional If SourceWithSection tag was not specified the content specified by Source tag is used even if a section was specified Template of header file Essential The following tags can be filled in the template include define Macro name avoiding double include The value of ImagePackager OutputBinary OutputHeader Qiinclude define DeclareBinarylmageSymbol Declares of symbols in the binary data The content of DeclareVariable text or DeclareAddress text and define by raw_image_alignment_symbol e Variables define list as variables Section Section name The value of ImagePackager OutputBinary section Symbol Variable name The value of ImagePackager OutputBinary symbol e Size Size of the binary file bytes e StartAddress Start address of the binary data LastAddress Last address of the binary data Template of header file if a section was specified Optional If HeaderWithSection tag
75. ation errnum t WindowSurfacesClass initialize WindowSurfacesConfigClass amp in out config Description See 6 9 9 3 R WINDOW SURFACES Initialize Argument WindowSurfacesConfigCla Parameters See 6 6 4 7 ss amp in out config Return value Error code If there is no error the return value is 0 6 9 83 destroy WindowSurfacesClass destroy WindowSurfacesClass Outline Destroy an object as WindowSurfacesClass Header RGA h Declaration void WindowSurfacesClass destroy Description See 6 9 9 4 R WINDOW SURFACES Finalize Argument None Return value None 6 9 84 get layer frame buffer WindowSurfacesClass get layer frame buffer WindowSurfacesClass Outline Acquires the pointer to the frame buffer structure of the specified layer Header RGA h Declaration errnum_t WindowSurfacesClass get layer frame buffer int fast32 t layer num frame buffer t out frame buffer Description See 6 9 9 5 R WINDOW SURFACES GetLayerFrameBuffer Argument int fast32 t layer num Layer number 0 Innermost 1 Next to the innermost layer Outline frame buffer t Output Frame buffer structure out frame buffer Return value Error code If there is no error the return value is 0 RO1AN2162EJ0200 Rev 2 00 Page 77 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 85 swap buffers WindowSurfacesClass swap buffers WindowSurfacesClass Outline Swaps the buffer of the specified layer and displays the drawn content Header RGA
76. atrix float t ky SX kx tx graphics matrix float t kx ky sy ty graphics matrix float t sy graphics matrix float t tx graphics matrix float t ty None 6 9 5 16 translate Canvas2D ContextClass translate Canvas2D ContextClass Outline Header Declaration Description Argument Return value Translates the current matrix M RGA h void Canvas2D ContextClass translate graphics matrix float t tx graphics matrix float t ty 1 0 tx 0 1 t 0 0 1 graphics matrix float t tx graphics matrix float t ty Displacement When the origin is at the upper left plus of X means right direction and plus of Y means downward direction None RO1AN2162EJ0200_ Rev 2 00 Jul 31 2015 Page 73 of 128 RENESAS RZ A1 RGA 6 9 5 17 scale Canvas2D ContextClass scale Canvas2D ContextClass Outline Enlarges or reduces the current matrix M Header RGA h Declaration void Canvas2D ContextClass translate graphics matrix float t sx graphics matrix float t sy Description SX 0 0 MEM 0 sy 0 0 0 1 Argument graphics_matrix_float_t tx Magnification Center of enlargement reduction Origin graphics_matrix_float_t ty Return value None 6 9 5 18 rotate Canvas2D_ContextClass rotate Canvas2D_ContextClass Outline Rotates the current matrix M Center coordinates of rotation 0 0 Header RGA h Declaration void Canvas2D_ContextClass rotate graphics_matrix_float_t angle Desc
77. attached document RGA Tutorial about the operational procedure RO1AN2162EJ0200 Rev 2 00 Page 126 of 128 Jul 31 2015 RENESAS RZ A1 RGA 9 Reference Documents User s Manual Hardware RZ A1 Group User s Manual Hardware The latest version can be downloaded from the Renesas Electronics website R7S72100 RTK772100BC00000BR GENMAT User s Manual The latest version can be downloaded from the Renesas Electronics website R7S72100 CPU GENMAJ Optional Board RTK7721000B00000BR User s Manual The latest version can be downloaded from the Renesas Electronics website ARM Architecture Reference Manual ARMv7 A and ARMv7 R edition Issue C The latest version can be downloaded from the ARM website ARM Generic Interrupt Controller Architecture Specification Architecture version 1 0 The latest version can be downloaded from the ARM website Technical Update Technical News The latest information can be downloaded from the Renesas Electronics website User s Manual Development Tools ARM Software Development Tools ARM Compiler toolchain ARM DS 5 etc can be downloaded from the ARM website The latest version can be downloaded from the ARM website HTML Canvas 2D Context W3C Candidate Recommendation 29 March 2012 RO1AN2162EJ0200 Rev 2 00 Page 127 of 128 Jul 31 2015 RENESAS RZ A1 RGA Website and Support Renesas Electronics Website http www renesas com Inquiries http www renesas com contact
78. bit width unsigned integer as byte size ptrdiff t Same as pointer bit width signed integer as difference between pointers bit flags fast32 t Same as uint fast32 t bit flags bit field bit flags32 t Same as uint32 t bit flags bit field float32 t 32 bit float Defined by standard library when ARM NEON defined floato4 t 64 bit float Defined by standard library when ARM NEON defined float128 t 128 bit float 6 6 2 Error Codes Error code can be got from the return value of C language API Error code of C API can be got from R_OSPL_GetErrNum function Refer to 7 2 Searching for Error Information by SearchErrorInformation Symbol Value Description 0 0 No error E OTHERS 1 Others error E FEW_ARRAY 2 Error of few fixed length array E FEW MEMORY 3 Few heap memory area E FIFO OVER 4 Failed to enqueue E NOT FOUND SYMBOL 5 Not defined the symbol E NO NEXT 6 There is not next element of list E ACCESS DENIED 7 Error of denied read or write E NOT IMPLEMENT YET 9 Not implemented yet E ERRNO OxOE 14 Refer to errno E LIMITATION OxOF 215 Limitation E STATE 0x10 216 Cannot do at this state E PATH NOT FOUND 0x12 218 Not found file or folder E BAD COMMAND ID 0x16 22 Out of number of command ID E TIME OUT 0x17 23 Time out RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 Page 24 of 128 RENESAS RZ A1 RGA E NO DEBUG TLS 0 10 29 Not set debug
79. c WINDOW SURFACES WaitForVSync Outline Waits for V Sync signal of the screen Header RGA h window surfaces h Declaration errnum t R WINDOW SURFACES WaitForVSync window surfaces t self int fast32 t swap interval bool t is 1 v sync at minimum Description Waits until the V Sync interrupt enters for the number of times specified by Swaplnterval from the previous swap In the case of Is1VSyncAtMinimum false when the V Sync interrupt has already entered for the number of times specified by Swaplnterval the processing immediately returns from this function Argument window surfaces t self Frame buffers and screen display int fast32 swap interval Number of V Sync interrupts until the frame buffer is swapped 0 or more than O bool t Information on whether at least one V Sync is is 1 v sync at minimum waited false never wait true wait 1 times or more than 1 Return value Error code If there is no error the return value is O 6 9 9 10 R WINDOW SURFACES DoMessageLoop R WINDOW SURFACES DoMessageLoop Outline Enters the message loop Header RGA h window surfaces h Declaration errnum t R WINDOW SURFACES DoMessageLoop window surfaces t self Description Upon completion of the application the processing returns from this function For the terminating method see the sub class specifications Argument window surfaces t self Frame buffers and screen display Return value Error code If there is no error the
80. che It is recommended this setting by set to MMU and define R OSPL AXI Get2ndCacheAttribute function and R OSPL MEMORY GetLevelOfFlush function If MMU setting was needed to flush L2 cache and fast manual flush mode 6 11 4 was enabled flush L2 cache by changing the code calling R GRAPHICS BeginSoftwareRendering2 function or _ GRAPHICS BeginSoftwareRenderingA function instead of R GRAPHICS BeginSoftwareRendering function RO1AN2162EJ0200 Rev 2 00 Page 107 of 128 Jul 31 2015 RENESAS RZ A1 6 11 6 RGA Layer structure of sample screen controller The following table describes the correspondence relation between the layer structure of window surfaces t 6 6 5 5 and planes of Video Display Controller 5 VDC5 Table 6 6 Layer structure of sample screen controller for RZ A1H M id of layer attributes t 6 6 5 7 The plane name of VDC5 Not used Graphics 3 1 Graphics 2 If window surfaces config t pixel format PIXEL FORMAT YCbCr422 the pixel format becomes RGB565 0 Graphics 1 1 Background color Graphics 0 Table 6 7 Layer structure of sample screen controller for RZ A1L pixel formatZPIXEL FORMAT YCbCr422 id of layer attributes t 6 6 5 7 The plane name of VDC5 1 Graphics 3 0 Graphics 2 1 Background color Graphics 0 Table 6 8 Layer structure of sample screen controller for RZ A1L pix
81. creen buffer in out frame buffer Return value Error code If there is no error the return value is 0 6 9 9 13 R WINDOW SURFACES FreeOffscreenStack R WINDOW SURFACES FreeOffscreenStack Outline Frees the off screen buffer to VRAM stack Header RGA h window surfaces h Declaration errnum t R WINDOW SURFACES FreeOffscreenStack window surfaces t self frame bufer t frame buffer Description Input member variable in frame buffer t is buffer count buffer address If freeing order is not reverse of allocating order E ACCESS DENIED error is returned Argument window surfaces t self Frame buffers and screen display frame bufer t Input output The freeing off screen buffer in out frame buffer Return value Error code If there is no error the return value is O RO1AN2162EJ0200 Rev 2 00 Page 83 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 10 Functions Related to byte per pixel t Class 6 9 10 1 List of Functions Section Function Name Description 6 9 10 2 R RGA BitPerPixelType To Byte Converts the number of bits per pixel to the number of bytes PerPixelType per pixel with decimal part 6 9 10 3 R RGA BytePerPixelType To Bit Converts the number of bytes per pixel with decimal part PerPixelType to the number of bits per pixel 6 9 10 4 R BYTE PER PIXEL IslInteger Returns information on whether the number of bytes per pixel is an integer 6 9 102 RGA BitPerPixelType To BytePerPi
82. ction with showing frame buffer and copy front of 1 frame by calling RH GRAPHICS Drawlmage function RO1AN2162EJ0200 Rev 2 00 Page 81 of 128 Jul 31 2015 RENESAS RZ A1 RGA When Graphics NULL is specified completion of drawing is not waited before the buffer is swapped Argument window surfaces t self Frame buffers and screen display int t layer num The layer number 0 Innermost 1 Next to the innermost layer graphics t graphics The drawn graphics context NULL enabled Return value Error code If there is no error the return value is O 6 9 9 8 WINDOW SURFACES SwapBuffersStart R WINDOW SURFACES SwapBuffersStart Outline Starts to swap for displaying the drawn content Header RGA h window surfaces h Declaration errnum t R WINDOW SURFACES SwapBuffersStart window surfaces t self int tlayer num graphics t graphics r ospl async t async Description Wait for finish drawing by calling R GRAPHICS FinishStart function before calling this function See R DRIVER TransferStart function OS Porting Layer OSPL Sample Program Argument window surfaces t self Frame buffers and screen display int t layer num The layer number 0 Innermost 1 Next to the innermost layer graphics t graphics The drawn graphics context NULL enabled r ospl async t async Input Output Notify setting NULL is not permitted Return value Error code If there is no error the return value is 0 699 9 WINDOW SURFACES WeaitForVSyn
83. d as if the value of the pointer that indicates the C language object is copied object 1 reference object 1 When accessing a member describe a period instead of the gt operator hyphen inequality sign object l attr 1 Since the destructor is not automatically activated as in the case of JavaScript explicitly call the destroy member function to delete objects This corresponds delete operator of C language object l destroy The compatibility between the C language provided by this library and JavaScript applies only to codes for objects In the C language not all JavaScript codes operate as they are such as required variable declaration When an error occurs the return value of R_OSPL_GetErrNum function is not 0 No exception occurs Call the R OSPL CLEAR function when returning from the error Even if a method of an error object is called no internal processing is performed However save and restore methods do operations in the error state Sample code of error check code if OSPL GetErrNum 0 Sample code of error clear code R OSPL CLEAR ERROR If an error was raised in the function creating an object R OSPL GetErrNum function returns not 0 and undefined object is returned from the creating function Whether the return value is the undefined object or not can be determined by operator of the object handle variable RO1AN216
84. d min y 0 can be specified as a drawing position If source image s width was not byte unit an error is raised If CLUT color in the video controller was fit with drawing image set CLUT of graphics image properties t 6 6 5 14 to the video controller In fast manual flush mode see section 6 11 4 when the image data specified for the image argument exists in the array variables prepared by the application flushing is required However flushing is not required when ROM data is used When performing flush directly flush the CPU cache or enclose the image data read write processing by R GRAPHICS BeginSoftwareRendering to R GRAPHICS EndSoftwareRendering If the frame buffer which has source image was same as target frame buffer and there was overlap between the specified source and destination area this function returns an error Argument graphics t self Graphics drawing context graphics image t image Image int tmin x int t min y Minimum X and Y coordinates Return value Error code If there is no error the return value is O 6 9 1 30 GRAPHICS DrawlmageResized R GRAPHICS DrawlmageResized Outline Enlarges or reduces an image and draws it in the specified rectangle Header RGA h Declaration errnum_t R GRAPHICS DrawlmageResized graphics t self graphics image t image int t min x int t min y int t width int t height Description See the description on the _ GRAPHICS DrawlImage function See 6 9 1 29 Arg
85. ddress member variable in GRAPHICS STATIC OnlnitializeDefault function is changed to uncached area by calling R_OSPL_ToUncachedAddress function in ospl memory c file from inside of RGA or checked to be already in uncached area and changed to physical address accessible from hardware by calling R OSPL ToPhysicalAddress function If memory area became few reduce frame buffer to the size of showing only and set the size of work buffer B to 0 Check that the memory map by setting in ospl memory c is same as the setting of MMU See Memory section in OS porting guide section in application note of RZ A1H group OS porting layer OSPL R01 AN1887JJ Table 2 1 Main header files in src drivers RGA inc File Name Description RGA h Main of RGA RGA API h Sub of RGA API This file is included from RGA h RGA Config h Sub of RGA setting This file is included from RGA h RGA_Cpp h Sub of RGA C API This file is included from RGA h Table 2 2 Library files File Name RGA RGA Description hardware software rendering rendering libRGA a V V Main of RGA Hardware accelerator using version is in ForRGAH folder No hardware accelerator using version is ForRGAS folder libRGA a has the rendering routine RGAS libRGAH a V libRGA a internal module RGAH This is not used by RGA for no hardware accelerator version RO1AN2162EJ0200 Rev 2 00 Page 9 of 128 Jul 31
86. der file to R GRAPHICS DrawlImage function or other functions 4 If binary file was generated write it at the address written in image xml file and start drawing operations The address is written at ImagePackager OutputBinary OutputHeader address in image xml file or generated header file ImagePackager can be started by the following command in the command prompt gt armcc common src samples RGA Sample Common Images cscript nologo N NRGA Tools vbs RunImagePackager BinaryImageConfig image xml 7 1 2 List of files File Description RGA_Tools vbs Script file which contains ImagePackager image xml Setting file of ImagePackager bmp jpg png Input image file Output binary file A file which contains images and files to download to the target board Output source file A source file which contains image data and file data to put in the program 7 1 3 Sample BinaryImageConfig image xml RO1AN2162EJ0200 Rev 2 00 Page 116 of 128 Jul 31 2015 RENESAS RZ A1 RGA lt xml version 1 0 encoding UTF 8 gt lt ImagePackager gt lt OutputBinary path BinaryImage RZ AlH c language C symbol g RGA Sample source template ImagePackagerLib SourceTemplate xml default super class ImagePackagerLib SuperClass xml default gt lt OutputHeader path BinaryImage RZ Al1H h include define BINARYIMAGE RZ AlH H
87. e Description alize 6 9 3 2 R GRAPHICS PATTERN Initi Initializes the pattern object 6 9 32 R GRAPHICS PATTERN Initialize R GRAPHICS PATTE HN Initialize Outline Header Declaration Description Argument Return value Initializes the pattern object RGA h errnum t R GRAPHICS PATTERN Initialize graphics pattern t self graphics image t image repetition t repetition graphics t context Initializes internal variables Set the object of GraphicsPatternClass to R GRAPHICS SetFillPattern graphics pattern t self Pattern object graphics image t image Pattern component image repetition t repetition Repetition setting normally GRAPHICS REPEAT graphics t context Belonging context Error code If there is no error the return value is O RO1AN2162EJ0200 Rev 2 00 Page 67 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 4 Functions Related to Creating C Object 6 9 4 1 List of Functions Section Function Name Description 6 9 4 2 R New Canvas2D ContextClass Creates an object of Canvas2D ContextClass 6 9 4 3 New Canvas2D ImageClass Creates an object of Canvas2D ImageClass 6 9 4 2 R RGA New Canvas2D ContextClass R RGA New Canvas2D ContextClass Outline Header Declaration Description Argument Return value 6 9 4 3 Creates an object of Canvas2D ContextClass RGA h Canvas2D ContextClass R RGA New Canvas2D ContextC
88. e canvas clearRect clearRect GRAPHICS Clear 4 fillRect fillRect R GRAPHICS FillRect V strokeRect 10 Drawing text to the canvas 11 Drawing images to the canvas drawImage dx dy drawImage R GRAPHICS DrawlImage V drawImage dx dy dw drawImage R GRAPHICS DrawImageResized 4 drawImage sx sy sw sh dx drawImage R GRAPHICS DrawlImageChild V dy dw dh 12 Pixel manipulation createImageData Width createImageData R GRAPHICS IMAGE Height InitR8G8B8A8 createImageData ImageData createImageData GRAPHICS IMAGE InitSameSizeR8G8B8A8 ImageData width ImageData width R GRAPHICS IMAGE GetProperti es ImageData height ImageData height R GRAPHICS IMAGE GetProperti es ImageData data ImageData data R GRAPHICS IMAGE GetProperti es getImageData getImageData R GRAPHICS IMAGE InitCopyFrameBufferR8G8B8A8 putImageData putImageData R GRAPHICS DrawlImage R GRAPHICS DrawImageChild RO1AN2162EJ0200 Rev 2 00 Page 102 of 128 Jul 31 2015 RENESAS RZ A1 RGA 13 Compositing globalAlpha globalAlpha R GRAPHICS SetGlobalAlpha V globalCompositeOperation globalCompositeOperation R GRAPHICS 4 SetGlobalCompositeOperation 14 Shadows RO1AN2162EJ0200 Rev 2 00 Page 103 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 11 2 Identifying Image Format The first few bytes of the graphics_image_t type structure to be specified for the arg
89. e to be drawn int t DirtyHeight Return value None 6 9 5 10 fillRect Canvas2D ContextClass fillRect Canvas2D ContextClass Outline Fill the rectangle area Header RGA h Declaration void Canvas2D_ContextClass fillRect int t MinX int t MinY int t Width int t Height Description This function is affected by the current matrix and paint of the current fill No border is drawn This function is affected by the globalAlpha property Argument int t MinX int t MinY Minimum X and Y coordinates of rectangle int t Width int t Height Width and height of rectangle Return value 6 9 5 11 createPattern Canvas2D_ContextClass createPattern Canvas2D ContextClass Outline Creates a pattern object Header RGA h Declaration Canvas2D PatternClass Canvas2D ContextClass createPattern graphics image t Image char Repetition Description Set the pattern object for the fillStyle property Argument graphics image t Image Image as a pattern component char Repetition Repetition setting Specify repeat Return value Created pattern object 6 9 5 12 beginPath Canvas2D ContextClass beginPath Canvas2D ContextClass Outline Resets the default path content to null Header RGA h Declaration void Canvas2D ContextClass beginPath Description Argument None Return value None 6 9 5 13 rect Canvas2D ContextClass rect Canvas2D ContextClass Outline Adds a rectangle to the default path Header RGA h Decl
90. eap area allocated by PNG decoding This memory area is allocated in work buffer B See work size for libPNG member variable RO1AN2162EJ0200 Rev 2 00 Page 23 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 6 Types and Classes 6 6 1 X Basic Types and Values Symbol Description char t 8 bit character bool t Logical data type The value is true 1 or false 0 int t The signed integer for this library is a 32 bit signed integer int8 t 8 bit signed integer defined by standard library int16 t 16 bit signed integer defined by standard library int32 t 32 bit signed integer defined by standard library intc4 t 64 bit signed integer defined by standard library uint8 t 8 bit unsigned integer defined by standard library 6 t 16 bit unsigned integer defined by standard library uint32 t 32 bit unsigned integer defined by standard library uint64 t 64 bit unsigned integer defined by standard library int fast8 t Fastest 8 bit minimum width signed integer int fast16 t Fastest 16 bit minimum width signed integer int fast32 t Fastest 32 bit minimum width signed integer uint fast8 t Fastest 8 bit minimum width unsigned integer uint fast16 t Fastest 16 bit minimum width unsigned integer uint fast32 t Fastest 32 bit minimum width unsigned integer uintptr t Same as pointer bit width unsigned integer as physical address size t Same as pointer
91. ed content is not displayed only by calling this function To apply the displayed content use R WINDOW SURFACES SwaphBuffers This function is affected by clipping Argument int t MinX int t MinY Minimum X and Y coordinates of rectangle int t Width int t Height Width and height of rectangle Return value 69 54 save Canvas2D ContextClass save Canvas2D ContextClass Outline Saves the set value of context in the internal stack Header RGA h Declaration void Canvas2D ContextClass save Description A heap area is secured internally for the internal stack Argument Return value 6 9 5 5 restore Canvas2D ContextClass restore Canvas2D ContextClass Outline Returns the set value of context to the context from the internal stack Header RGA h Declaration void Canvas2D ContextClass restore Description Releases the heap area used internally as an internal stack Argument Return value Error code If there is no error the return value is 0 RO1AN2162EJ0200 Rev 2 00 Page 69 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 5 6 drawlmage Canvas2D ContextClass drawlmage Canvas2D ContextClass Outline Header Declaration Description Draws an image RGA h void Canvas2D ContextClass drawlmage graphics image t Image int t MinX int t MinY void Canvas2D ContextClass drawlmage graphics image t Image int t MinX int t MinY int t Width int t Height void Canvas2D ContextClas
92. el formatzPIXEL FORMAT YCbCr422 id of layer attributes t 6 6 5 7 The plane name of VDC5 Not used Graphics 3 1 Graphics 2 RG565 0 Graphics 0 YCbCr422 RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 Page 108 of 128 RENESAS RZ A1 RGA 6 11 7 Flagged Structure Parameters Flags member variables in the structure are used as a bit field When the bit is 1 the corresponding member variable is enabled in this coding pattern When the bit is 0 it is treated that the default value is set or not change for the member variable as omitted Updating the version allows binary compatibility even when structure members increase FuncA ConfigClass config config Flags F FuncA Paraml F FuncA Param2 config Paraml 10 config Param2 2 FuncA amp config The default value is config Param3 because Flags I F FuncA Param3 does not exist RO1AN2162EJ0200 Rev 2 00 Page 109 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 11 8 Defaultable Flags Defaultable flags are the type that can select three options setting to ON setting to OFF and no setting unchanged for each array element when setting logic type array variables Symbols for setting to ON and setting to OFF are defined When these symbols are not used settings remain unchanged The variable type that stores defaultable flags is a 32 bit integer type These flags are defined as a flag that sets the lower 16 bits to ON and a flag that se
93. ent pointed from super class is set by default Example raw stride alignment 32 Pixel format of output image in which the number of bytes up to the line immediately below is 4 Two or more CSV formats can be specified Optional This setting takes precedence over the 2raw stride alignment setting Example raw stride alignment 4 YUV422 The format of the table Optional Offset Fills not only the body but also the offset to the body in the binary file because re compile does not have to be done even if the size of the image or the file was changed Embed Fills images and files normally Default value is the following value e f language Binary table_format Offset e language C table_format Embed ID of the template of the output source file in the case of language C Optional Set the value of ImagePackager SourceT emplate id It is able to set the reference to the other XML file ImagePackagerLib is replaced to the folder path containing ImagePackagerLib vbs Example source template ImagePackagerLib SourceTempla te xml default ID of the super class attached to the binary file Optional Set the value of ImagePackager SuperClass id It is able to set the reference to the other XML file ImagePackagerLib is replaced to the folder path containing ImagePackagerLib vbs Page 119 of 128 RENESAS RZ A1 RGA Example super class ImagePackage
94. escription Default value is set by the constructor Menor Symbol frame buffer Set the address of frame buffer structure bool t Fast manual flush mode 6 11 4 or not Default value is is fast manual flush false 6 6644 Canvas2D_ImageClass finclude RGA h class Canvas2D ImageClass This is a referable image object type only for the C language This class follows a coding rule of JavaScript For the description on properties refer to property specifications section 6 8 2 For the description on member functions refer to function specifications section 6 9 6 6 64 5 Canvas2D PatternClass finclude RGA h class Canvas2D PatternClass This is an image arranged pattern class only for the C language This class follows a coding rule of JavaScript For the description on member functions refer to function specifications section 6 9 7 6 6 4 6 WindowSurfacesClass include RGA h class WindowSurfacesClass This is a frame buffer and showing screen class only for the C language This class follows a coding rule of mbed For the description on member functions refer to function specifications section 6 9 8 6 6647 WindowSurfacesConfigClass include RGA h class WindowSurfacesConfigClass This is a class of argument for WindowSurfacesClass initialize member function for C language This class follows a coding rule of mbed Member variables of this class are inherited from window
95. f 2nd instance as graphics t class was initialized an error is raised Video Display Controller 5 VDC5 s hardware layers are allocated with layers in window surfaces t object If graphics config t jpeg decoder GRAPHICS JPEG DECODER RGA does not access to JPEG Codec Unit JCU RO1AN2162EJ0200 Rev 2 00 Page 20 of 128 Jul 31 2015 RENESAS RZ A1 6 3 Required Memory Size Table 6 1 shows Required Memory Size Table 6 1 Required Memory Size RGA Memory Size bytes Note ROM 32732 libRGA a Code ROM 25240 libRGAH a Code ROM 48 libRGA a Read Only Data ROM 0 libRGAH a Read Only Data ROM 802 libRGA a Read Write Data ROM RAM 28 libRGAH a Read Write Data RAM 0 libRGA a Zero Initialized Data RAM 940 libRGAH a Zero Initialized Data RAM Refer to R CalcWorkBufferSize 6 9 14 3 Work buffer RAM Refer to R CalcWorkBufferB Size 6 9 14 4 Work buffer B RAM 1536000 2x16bit x800x480 Frame buffer RAM 2304000 3x16bit x800x480 Back buffer for application Note These required memory sizes vary depending on the C compiler version and the compile option RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 RENESAS Page 21 of 128 RZ A1 RGA 6 4 Using OS resources RGPNCG attached RGA for RTX uses the thread assigned signal in NCGSYS State function bits of event will be used RO1AN2162EJ0200 Rev 2 00 Page 22 of
96. f the memory map or OS was changed change define of OSPL API functions or replace to functions already changed More information is in the document of RZ A1 group OS Porting Layer OSPL Sample Program RO1 AN1887EJ Porting layer functions of OSPL Functions depended on the memory map VV ON ON ON R OSPL ToCachedAddress R OSPL ToUncachedAddress R_OSPL_ToPhysicalAddress R_OSPL_MEMORY_GetLevelOfFlush R OSPL AXI Get2ndCacheAttribute Functions depended on OS VV VV ON WV R OSPL THREAD GetCurrentId R OSPL EVENT Set R OSPL EVENT Clear R OSPL EVENT Wait R OSPL MEMORY Flush R OSPL Delay Functions depended on the compiler or OS VV ON ON ON ON WV INLINE STATIC INLINE R OSPL SECTION R OSPL ALIGNMENT R OSPL EnableAllInterrupt R OSPL DisableAllInterrupt R OSPL MEMORY Barrier Functions depended on hardware R OSPL FTIMER InitializeIfNot R OSPL FTIMER Get Functions no depended on some functions R01AN2162bEJ0200 Rev 2 00 Jul 31 2015 RENESAS RGA Page 96 of 128 RZ A1 6 10 3 RGA Porting layer functions of RGPNCG RGA uses following functions of RGPNCG If the OS was changed change define of RGPNCG functions or replace functions to function already changed If NCGSYS_ State functions use event flags of OSPL it is necessary to port NCGSYS_ State functions Functions depended on OS Section Function Na
97. ffer RGA can not copy at this condition Also draw the source image a part of the buffer by calling R GRAPHICS DrawlmageChild function Argument graphics image t self Image frame buffer t Frame buffer that contains the image frame buffer Return value Error code If there is no error the return value is O 692 6 R GRAPHICS IMAGE GetProperties R GRAPHICS IMAGE GetProperties Outline Get image properties Header RGA h Declaration errnum_t R GRAPHICS IMAGE GetProperties graphics image t self graphics image properties t out properties Description In the case of fast manual flush mode 6 11 4 Flush operation must be done before the array pointed by out properties address is read or written The data in the ROM does not have to be flushed When you want to flush flush CPU cache directly call R GRAPHICS Finish or sandwich reading or writing the image data between R GRAPHICS BeginSoftwareRendering and R GRAPHICS EndSoftwareRendering RO1AN2162EJ0200 Rev 2 00 Page 65 of 128 Jul 31 2015 RENESAS RZ A1 RGA Argument graphics image t self Image graphics image properties Output Image properties 6 6 5 14 t out properties Return value Error code If there is no error the return value is 0 RO1AN2162EJ0200 Rev 2 00 Page 66 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 3 Functions Equivalent to graphics pattern t Class Member Function 6 9 3 1 List of Functions Section Function Nam
98. g on the Display Screen 6 1 2 1 Flowchart Figure 6 3 shows a flowchart of drawing on the display screen For the actual operation procedure see the attached document RGA Tutorial When using the C language API see the description below using the C language API and the relationship between the C language API described in section 6 11 1 Correspondence to Canvas 2D and Correspondence to Hardware Acceleration and the C language API Initialize the constant part of each object Call the R WINDOW SURFACES InitConst function and the GRAPHICS InitConst function Create a display screen and a frame buffer Call the R WINDOW SURFACES Initialize function and the R WINDOW SURFACES GetLayerFrameBuffer function Create an object of the graphics t class object Call the GRAPHICS Initialize function Start of animation loop Call the drawing API Initializing Call the GRAPHICS FillRect function etc Drawing Display the drawing result Call the R WINDOW SURFACES Swap function End of animation loop Finalize the graphics t class object Call the GRAPHICS Finalize function Finalize the display screen and the frame buffer Call the R WINDOW SURFACES Finalize function Figure 6 3 Drawing on the Display Screen Flowchart Processing Finalization RO1AN2162EJ0200 Rev 2 00 Page 17 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 1 22 Sequence Chart The following shows an operation timing char
99. he image does not have CLUT this value is NULL Set to layer attributes t 6 6 5 7 int fast32 t Count of array elements of CLUT Set to layer attributes t CLUT count 6 6 5 7 6 6 5 15 graphics composite operation t This is a calculation method type for alpha blend include RGA h Constant Name Value Description GRAPHICS SOURCE Performs calculation SRC over DST of general alpha blend OVER RO1AN2162EJ0200 Rev 2 00 Page 36 of 128 Jul 31 2015 RENESAS RZ A1 RGA Whether the calculation formula is the premultiplied alpha expression depends on whether alpha is present in the flag included in the header of an image to be drawn or in the drawing target pixel format default GRAPHICS DESTINA 7 This type is used for drawing the inverted alpha mask TION OUT Only the alpha component of drawing destination varies according to the following expression a dst a dst 1 a src When drawing an image on a frame buffer without alpha component GRAPHICS DESTINATION OUT cannot be set When the final drawing destination is XRGB8888 draw the inverted alpha mask on the back buffer of ARGB8888 Set 255 for the R GRAPHICS SetGlobalAlpha function or the globalAlpha property GRAPHICS COPY 0 Performs no alpha blend and copy from source image data It may be fast at that rate For faster when PNG image with alpha channel was decoded to the back buffer if CRAPHICS COPY was specified it
100. indow surfaces h Description Member Symbol Description Variable bit flags fast32 t flags For flags see section 6 11 7 Flagged Structure Parameters F WINDOW SURFACES PIXEL FORMAT F WINDOW SURFACES LAYER COUNT F WINDOW SURFACES BUFFER HEIGHT F WINDOW SURFACES BACKGROUND COLOR pixel format t Pixel format of showing window See section 6 6 5 10 pixel format Condition The following value can be set for the sample of RZ A1H PIXEL FORMAT ARGB8888 PIXEL FORMAT XRGB8888 PIXEL FORMAT RGB565 default PIXEL FORMAT ARGBA4444 PIXEL FORMAT ARGB1555 PIXEL FORMAT YCbCr422 PIXEL FORMAT CLUT 1 PIXEL FORMAT CLUTA4 PIXEL FORMAT CLUT8 int fast32 t Count of creating layer layer count Default is 1 If count was 2 all pixel formats of layers are same But If pixel format was PIXEL FORMAT YCbCr422 overlay layer s format is PIXEL FORMAT ARGBA4444 int fast32 t Height of the frame buffer buffer height Default is the height of the screen r8g8b8a8 t Background color See 6 6 5 19 and 6 9 1 25 background color Default is H Get R8G8B8A8 255 255 255 0 6 6 57 layer attributes t layer attributes t structure RO1AN2162EJ0200 Rev 2 00 Page 33 of 128 Jul 31 2015 RENESAS RZ A1 RGA Outline Header Description Member Variable 6 6 5 8 The following lists parameter types of the Rh WINDOW SURFACES AccessLayerAttributes function RGA h window surfaces h See Laye
101. indowSurfacesClass Outline Enters the message loop Header RGA h Declaration errnum_t WindowSurfacesClass do message loop Description See 6 9 9 8 R WINDOW SURFACES DoMessageLoop Argument None Return value Error code If there is no error the return value is 0 6 9 89 access layer attributes WindowSurfacesClass access layer attributes WindowSurfacesClass Outline Accesses attributes of the specified display layer Header RGA h RO1AN2162EJ0200 Rev 2 00 Page 78 of 128 Jul 31 2015 RENESAS RZ A1 RGA Declaration Description Argument Return value errnum_t WindowSurfacesClass access layer attributes LayerAttributesClass amp in out Attributes See 6 9 9 11 R WINDOW SURFACES AccessLayerAttributes LayerAttributesClass amp Input output Attributes of layer See 6 6 4 8 in out Attributes Set read or write to access member variable Error code If there is no error the return value is 0 RO1AN2162EJ0200 Rev 2 00 Page 79 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 9 Functions Equivalent to window surfaces t Class Member Functions 6 9 9 1 List of Functions Section Function Name Description 6 9 9 2 R WINDOW SURFACES InitConst Initializes internal variables with constants 6 9 9 3 R WINDOW SURFACES Initialize Initializes the display device or window and starts displaying graphics 6 9 9 4 R WINDOW SURFACES Finalize Finalizes the di
102. ions from the information included herein 3 Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is granted hereby under any patents copyrights or other intellectual property rights of Renesas Electronics or others 4 You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from such alteration modification copy or otherwise misappropriation of Renesas Electronics product 5 Renesas Electronics products are classified according to the following two quality grades Standard and High Quality The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below Standard Computers office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots etc High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems and safety equipment etc Renesas Electronics products are
103. is arranged in a uint8 t type array in the order of Red Green Blue and Alpha from the upper left pixel to the lower right pixel Argument graphics image t self Image void image data array X Starting address of an array to be a memory area that stores images size t Size bytes of the memory area indicated by image data array size image data array argument graphics t context Context with copy source frame buffer to be drawn int tmin x int tmin Minimum X and Y coordinates frame buffer coordinates of the range to be acquired int t width int t height Width and height of the range to be acquired Return value Error code If there is no error the return value is 0 6 925 R GRAPHICS IMAGE InitByShareFrameBuffer R GRAPHICS IMAGE JInitByShareFrameBuffer Outline Initializes the frame buffer data as an image Header RGA h Declaration errnum t R GRAPHICS IMAGE InitByShareFrameBuffer graphics image t self frame buffer t frame buffer Description Initializes internal variables The VRAM area indicated by frame buffer buffer address frame buffer show buffer index at the time when this function is called is shared with image self Condition This function can not initialize CLUT format image RGA supports static CLUT format image made from ImagePackager Condition When wrong stride alignment error was raised change width of the buffer witch becomes to fit stride alignment and copy the image to the bu
104. is not necessary to clear the back buffer on ahead 6 6 5 16 graphics status t graphics status t structure Outline This is an area type that stores graphics drawing context Header RGA h Description Function equivalent to the member function 69 1 11 R GRAPHICS Save 6 9 1 12 GRAPHICS Restore Member Variable Access Inhibit 6 6 5 17 graphics matrix float t This is a matrix element type include RGA h typedef float graphics matrix float t 6 6 5 18 repetition t This is a type that specifies the pattern repetition method include RGA h Constant Name Value Description GRAPHICS REPEAT 1 Repeating 6 6 5 19 r8g8b8a8 t r8g8b8a8 t structure Outline Pixel format in which bytes are arranged in the order of red green blue and alpha Header RGA h Description Setting range A value of 0 black transparent to 255 light opaque is specified for each of red green blue and alpha Symbol Variable ured Uint8 1 green uint _t_u blue RO1AN2162EJ0200 Rev 2 00 Page 37 of 128 Jul 31 2015 RENESAS RZ A1 RGA uint8_t u alpha Alpha opaque level 6 6 5 20 animation timing function t animation timing function t structure Outline This is an object describing timing of animation Bezier function Header RGA h Description For the function equivalent to the member function see section 6 9 13 Member Variable Access Inhibi
105. ite operation t out composite operation Description Argument graphics t self Graphics drawing context graphics composite operation t Output Calculation method out composite operation Return value Error code If there is no error the return value is 0 6 9 1 42 GRAPHICS STATIC SetOnlnitialize GRAPHICS STATIC SetOnlnitialize Outline Registers a callback function that sets the default graphics config t value Header RGA h Declaration errnum t R GRAPHICS STATIC SetOnlnitialize R GRAPHICS Onlnitialize FuncType callback function Description GRAPHICS STATIC OnlnitializeDefault function is called back when this function is not called Argument GRAPHICS Onlnitialize FuncT Callback function or NULL ype callback function Return value Error code If there is no error the return value is O 6 9 1 43 GRAPHICS STATIC SetOnFinalize R GRAPHICS STATIC SetOnFinalize Outline Registers a function that releases the memory allocated in the R GRAPHICS Onlnitialize FuncType function Header RGA h Declaration errnum t R GRAPHICS STATIC SetOnFinalize R GRAPHICS OnFinalize FuncType callback function Description R GRAPHICS STATIC OnlnitializeDefault function is called back when this function is not called Argument GRAPHICS OnFinalize FuncT Callback function or NULL ype callback function Return value Error code If there is no error the return value is O 6 9 1 44 GRAPHICS SetQualityFlags
106. ix 0 Matrix 3 Matrix 6 Matrix 1 Matrix 4 Matrix 7 Matrix 2 Matrix 5 Matrix 8 Return value Error code If there is no error the return value is 0 6 9 1 16 R GRAPHICS GetMatrix 3x3 GRAPHICS GetMatrix 3x3 Outline Acquires each element of the current matrix Matrix Header RGA h Declaration errnum t R GRAPHICS GetMatrix 3x3 graphics t self graphics matrix float t out matrix Description Argument graphics t self Graphics drawing context graphics matrix float t Output 3x3 matrix array out matrix Matrix 0 Matrix 3 Matrix 6 Matrix 1 Matrix 4 Matrix 7 Matrix 2 Matrix 5 Matrix 8 Return value Error code If there is no error the return value is 0 RO1AN2162EJ0200 Rev 2 00 Page 51 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 1 17 GRAPHICS TranslateMatrixl GRAPHICS TranslateMatrixl Outline Translates the current matrix M Integer type specified Header RGA h Declaration errnum t R GRAPHICS TranslateMatrixl graphics t self int t tx int tty Description 1 0 tx 0 1 t M M 0 0 1 Argument graphics_t self Graphics drawing context int_t tx int_t ty Displacement When the origin is at the upper left plus of X means right direction and plus of Y means downward direction Return value Error code If there is no error the return value is 0 6 9 1 18 R GRAPHICS TranslateMatrix R GRAPHICS TranslateMatrix Outline Translates the current matrix M Floa
107. ject Output Memory allocated in this function Return value Error code If there is no error the return value is 0 6 10 13 R GRAPHICS Onlnitialize FuncType R GRAPHICS Onlnitialize FuncType Outline Type of the callback function that sets the default graphics config t value Header RGA h Declaration errnum_t R GRAPHICS Onlnitialize FuncType graphics t self graphics config t in out config void out default object Description Use R GRAPHICS STATIC SetOnlnitialize to register callback functions of this function type Callback functions of this function type are called back immediately after R GRAPHICS Initialize is called out default object is used only to be released in inter R GRAPHICS Onlnitialize FuncType When R GRAPHICS Onlnitialize FuncTyper is not called back it is not necessary to set out default object Argument graphics t self Address of the object non initialized at which initialization starts graphics config t in out config See section 6 6 5 3 void out default object Output Memory allocated in this function RO1AN2162EJ0200 Rev 2 00 Page 94 of 128 Jul 31 2015 RENESAS RZ A1 Return value RGA Error code If there is no error the return value is O 6 10 1 4 R GRAPHICS STATIC OnFinalizeDefault R GRAPHICS STATIC OnFinalizeDefault Outline Header Declaration Description Argument Return value Default of the function that releases memory allocated in the
108. laration errnum t R GRAPHICS EndSoftwareRendering graphics t self Description This function must be called in fast manual flush mode see section 6 11 4 RO1AN2162EJ0200 Rev 2 00 Page 62 of 128 Jul 31 2015 RENESAS RZ A1 RGA To call this function from functions that support error processing also call R GRAPHICS EndRenderinglnFin at the end of the function Argument graphics t self Graphics drawing context Return value Error code If there is no error the return value is O 6 9 1 50 R GRAPHICS EndRenderingInFin R GRAPHICS EndRenderingInFin Outline Call this function from the end of the function that performs software rendering Header RGA h Declaration errnum_t R GRAPHICS EndRenderingInFin graphics t self errnum te Description This function must be called in fast manual flush mode see section 6 11 4 To call this function from functions that support error processing also call R GRAPHICS EndRenderinglnFin at the end of the function Argument graphics t self Graphics drawing context errnum te Errors that have occurred No error 0 Return value Error code If there is no error the return value is O 6 9 1 51 R GRAPHICS BeginSoftwareRendering2 R GRAPHICS BeginSoftwareRendering2 Outline R GRAPHICS BeginSoftwareRendering for the memory on L2 cache Header RGA h Declaration errnum_t R GRAPHICS BeginSoftwareRendering2 graphics t self Description This function is usually not called This functio
109. lass Canvas2D ContextConfigClass amp in out Config Canvas2D ContextClass R RGA New Canvas2D ContextClass graphics config t in out config Initializes internal variables When the object is not used call the destroy method Canvas2D ContextConfigClass amp See section 6 6 4 3 in out Config graphics config t in out config See section 6 6 5 2 Canvas2D context object Error undefined R RGA New Canvas2D ImageClass R RGA New Canvas2D ImageClass Outline Header Declaration Description Argument Return value Creates an object of Canvas2D ImageClass RGA h Canvas2D ImageClass RH RGA New Canvas2D ImageClass This function is corresponding to new Image of Canvas2D Created an object as Canvas2D_ImageClass Error undefined 6 9 5 Canvas2D ContextClass Member Functions 6 9 5 1 List of Functions Section Function Name Description 6 9 5 2 destroy Deletes the object of Canvas2D_ContextClass 6 9 5 3 clearRect Clears the rectangle area 6 9 5 4 save Saves the set value of context in the internal stack 6 9 5 5 restore Returns the set value of context to the context from the internal stack 6 9 5 6 drawlmage Draws an image 6 9 5 7 createlmageData Creates an image object of r8g8b8a8 t 6 9 5 8 getlmageData Creates an image to which a part of frame buffer being displayed is copied 6 9 5 9 putlmageData Draws an image 6 9 5 10 fillRect Fill
110. lor from CSS Color format with alpha 6 9 15 2 rgb rgb Outline Returns the value of color from CSS Color format Header RGA h Declaration r8g8b8a8 t rgb int t red max255 int t green max255 int t blue max255 Description Example rgb 255 255 0 Target fillStyle 6 8 1 3 The value of alpha component is maximum value 1 0 Argument int t red max255 The value of red component 0 255 Return value int t green max255 The value of green component 0 255 int t blue max255 The value of blue component 0 255 The value of R8G8B8A68 color 6 9 15 3 rgba rgba Outline Returns the value of color from CSS Color format with alpha Header RGA h Declaration r8g8b8a8 t rgba int t red max255 int t green max255 int t blue max255 float32 t alpha max1 Description Example rgba 255 255 0 0 5 Target fillStyle 6 8 1 3 Argument int t red max255 The value of red component 0 255 Return value R01AN2162bEJ0200 Rev 2 00 Jul 31 2015 The value of green component 0 255 int t blue max255 The value of blue component 0 255 float32 t alpha max1 The value of alpha component 0 0 1 0 The value of R8G8B8A8 color int t green max255 Page 93 of 128 RENESAS RZ A1 RGA 6 10 Porting layer Functions This section describes porting layer functions called back from RGA The package contains a sample which can be modified by the user For functions with names that end with FuncType a function to be registered must
111. me Description 6 10 3 1 NCGSYS CreateState Creates an event flags of RGPNCG 6 10 3 2 NCGSYS DestroyState Destroys the event flags of RGPNCG 6 10 3 3 NCGSYS_SetState Changes the value of the event flags of RGPNCG 6 10 3 4 NCGSYS GetState Gets the value of the event flags of RGPNCG 6 10 3 5 NCGSYS WaitState Waits for the value of the event flags of RGPNCG until specified value 6 10 3 6 NCGSYS SetStateEventV Sets using value of OS event flags alue 6 10 3 7 NCGSYS_GetLastCreated Returns last created event flags State 6 10 3 8 NCGVG Attach ISR Registers the interrupt callback function for R GPVG2 6 10 3 9 NCGVG Detach ISR Unregisters the interrupt callback function for R GPVG2 6 10 3 10 NCGVGISRfp Type of the interrupt callback function for R GPVG2 Functions depended on the policy of Power Down Modes Section Function Name Description 6 10 3 11 NCGVO Init Starts to use R GPVG2 6 10 3 12 NCGVG Delnit Ends to use R GPVG2 Functions no depended on gt NCGSYS_Abort gt NCGSYS CPUVAddrToSysPAddr gt NCGSYS ReadReg gt NCGSYS WiriteReg 6 10 3 1 NCGSYS CreateState NCGSYS CreateState Outline Creates an event flags of RGPNCG Header ncg state h Declaration NCGint32 NCGSYS CreateState NCGvoid ppObj NCGuint32 ui32StatelD Description Change define of this function for the target OS If thread attached event of OSPL was called it is not have to change define
112. n R GRAPHICS Finish WINDOW SURFACES SwapBuffers The following describes specific examples of processing that must be enclosed When directly reading or writing the frame buffer from outside the graphics library However enclosing this processing is not necessary when accessing the frame buffer from a non cache area When reading or writing image data specified for GRAPHICS DrawlImage or image data obtained from R GRAPHICS IMAGE GetAddress However enclosing this processing is not necessary when reading or writing image data provided in the ROM When this read or write operation is performed in the API that reads and writes files When these functions are called frame buffer data or image data is flushed from the CPU cache to the physical memory or hardware drawing is completed as needed If you do not want to use these functions call GRAPHICS Finish before accessing the frame buffer shared with the drawing hardware or image data After the frame buffer or the image data is accessed write back the CPU cache Sample e R GRAPHICS BeginSoftwareRendering graphics IF e goto fin Access to frame buffer directly IF error e ERROR CODE goto fin e R GRAPHICS EndSoftwareRendering graphics goto fin fin e R_GRAPHICS EndRenderingInFin graphics e RO1AN2162EJ0200 Rev 2 00 Page 106 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 11 5 Using SDRAM For
113. n image file and outputs this type data It is also possible to dynamically generate a graphics image t class object without using the ImagePackager tool Member Variable Access Inhibit 6 6 3 4 graphics pattern t graphics pattern t structure Outline image arranged pattern Header RGA h 5 RZ A1H group OS Porting Layer OSPL Sample Program RO1 AN1887EJ RO1AN2162EJ0200 Rev 2 00 Page 25 of 128 Jul 31 2015 RENESAS RZ A1 RGA Description Function equivalent to the member function See section 6 9 3 Member Variable Access Inhibit RO1AN2162EJ0200 Rev 2 00 Page 26 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 6 4 Classes Only for the C Language The following describes C language classes provided by the RGA Be careful of coding because classes provided by the RGA are created to be compatible with JavaScript For details see section 6 11 11 Compatibility between C Language and JavaScript Object For classes types available for the C language also see section 6 6 5 Types Classes Available for C Language and C Language 6 6 4 1 List of Types Table 6 4 C Language Dedicated Types Provided by RGA Section Type Description 6 6 4 2 Canvas2D ContextClass Graphics drawing context 6 6 4 3 Canvas2D ContextConfigClass Setting of Canvas2D ContextClass 6 6 4 4 Canvas2D ImageClass Input image 6 6 4 5 Canvas2D PatternClass Image arranged pattern 6 6 4 6 WindowSurfacesClass F
114. n is called in the case of RGA using RGAH defined R OSPL AXI Get2ndCacheAttribute function as accessing not used L2 cache from OpenVG hardware in RZ A1H and fast manual flush mode see section 6 11 4 For RZ A1H this function is used before software rendering to the frame bufffer in SDRAM Depending on a condition this function waits for finishing drawing like R GRAPHICS Finish function Argument graphics t self Graphics drawing context Return value Error code If there is no error the return value is O 6 9 1 52 GRAPHICS BeginSoftwareRenderingA R GRAPHICS BeginSoftwareRenderingA Outline Calls R GRAPHICS BeginSoftwareRendering2 depending on the address Header RGA h Declaration errnum t R GRAPHICS BeginSoftwareRenderingA graphics t self void Address Description This function is usually not called This function is called in the case of RGA using RGAH defined R OSPL AXI Get2ndCacheAttribute function as accessing not used L2 cache from OpenVG hardware in RZ A1H and fast manual flush mode see section 6 11 4 This function calls RH OSPL MEMORY GetLevelOfFlush function with specified address and calls Rh GRAPHICS BeginSoftwareRendering or R GRAPHICS BeginSoftwareRendering2 depending on the level of flush Argument graphics t self Graphics drawing context void Address Buffer address to render by software Return value Error code If there is no error the return value is 0 RO1AN2162EJ0200 Rev
115. n the case of png or jpg extension incompressibly expanded files are output to binary files When expanding a file on the target board specify JPEG file for ImagePackager InputFiles File For images with no alpha channel or images whose all alpha values are OxFF information that shows that alpha blending is not required is embedded in the output data This information may allow fast drawing type Type of symbols described in the header file Essential symbol type Specify graphics_image_t symbol A symbol described in the header file Essential The define symbol in the global scope type type When is used the symbol is replaced with a file name Example g Extension Format gt g Sample jpg ARGB8888 output_format Format of files to be output Essential If input file was 24bit 32bit Window bitmap file JPEG file PNG file with alpha without alpha values ARGB8888 XRGB8888 X component is 0x00 RGB565 ARGB1555 ARGB4444 YUVA22 A8 A4 and A1 can be specified When CLUT8 is specified input a 256 color Windows bitmap file When CLUT4 is specified input a 16 color Windows bitmap file When CLUT1 is specified input a monochrome Windows bitmap file RO1AN2162EJ0200 Rev 2 00 Page 120 of 128 Jul 31 2015 RENESAS RZ A1 RGA premultiplied alpha The following table describes alpha component of output image If input image was 256 16 colors
116. ndow surfaces t Frame buffer and screen display sample 6 6 5 6 window surfaces config t window surfaces t setting 6 6 5 7 layer attributes t Parameter of the R WINDOW SURFACES AccessLayerAttributes function 6 6 5 8 access_t Operations such as specifying set values write and acquiring set values read 6 6 5 9 byte_per_pixel_t Number of bytes per pixel 6 6 5 10 pixel_format_t Pixel format 6 6 5 11 frame_buffer_delegate_t Data related to frame buffer 6 6 5 12 v_sync_t V Sync signal synchronization of display screen 6 6 5 13 vram_ex_stack_t Stack for off screen buffer in external RAM 6 6 5 14 graphics image properties t Properties of the image 6 6 5 15 graphics composite operation t Type of composite operation 6 6 5 16 graphics status t Area to store graphics drawing context 6 6 5 17 graphics matrix float t Element of matrix 6 6 5 18 repetition t Pattern repetition type 6 6 5 19 r8g8b8a8 t Pixel format arranged in the order of R G B and A 6 6 5 20 animation timing function t Timing of animation Bezier function 6 6 5 21 graphics jpeg decoder t Constant value of a kind of JPEG decoder 6 6 5 22 graphics async status t Status of drawing graphics and interrupt status 6 6 5 2 frame buffer t frame buffer t structure Description Array of starting address of the frame buffer logical address of cache area same as normal variables Specify a multiple of 32 Number of buffer address array elements
117. o error the return value is 0 6 9 1 39 R GRAPHICS GetGlobalAlpha R GRAPHICS GetGlobalAlpha Outline Acquires an alpha value opacity to be multiplied by all drawings Header RGA h Declaration errnum t R GRAPHICS GetGlobalAlpha graphics t self uint8 t out alpha value Description Argument graphics t self Graphics drawing context uint8 t out alpha value Output Alpha value 0 to 255 A smaller value makes drawing light Return value Error code If there is no error the return value is O 6 9 1 40 R GRAPHICS SetGlobalCompositeOperation R GRAPHICS SetGlobalCompositeOperation Outline Sets the calculation method for alpha blend Header RGA h Declaration errnum_t R GRAPHICS SetGlobalCompositeOperation graphics t self graphics composite operation t composite operation Description The following case other than GRAPHICS SOURCE OVER can be set Image drawing such as GRAPHICS Drawlmage Argument graphics t self Graphics drawing context graphics composite operation t Calculation method composite operation Return value Error code If there is no error the return value is O 69 1 41 R GRAPHICS GetGlobalCompositeOperation R GRAPHICS GetGlobalCompositeOperation Outline Acquires the calculation method for alpha blend RO1AN2162EJ0200 Rev 2 00 Page 60 of 128 Jul 31 2015 RENESAS RZ A1 RGA Header RGA h Declaration errnum t R GRAPHICS GetGlobalCompositeOperation graphics t self graphics compos
118. or monochrome Windows bitmap file see the input color as CLUT referenced color at the following table Notice PNG format created by Paint Brush for Windows 7 always has alpha component Input Output Alpha component of output Image Image With A Every format A component of the input image Without ARGB OxFF A component Y component luminance only converted input image from RGB to YCbCr Two or more values can be specified in the CSV format In that case however include Format in symbol Format will be replaced to the name of pixel format This parameter shows whether to multiply RGB components by the alpha component Optional no Not multiplied default yes RGB components are converted to multiplied values before they are output This choice is available only when the alpha component is not contained in the drawing destination already yes The input image has already been multiplied This choice is available only when the alpha component is not contained in the drawing destination ImagePackager InputFiles File Zero one or more elements Not converted data are embedded in the binary file path type symbol alignment Path of files to be input Essential Reference of relative paths ImagePackager InputFiles base_folder Type of symbols described in the header file Optional symbol type When the file content is an array attach to the
119. ore GRAPHICS Restore 3 Transformations scale x y scale x y GRAPHICS ScaleMatrix 4 rotate angle rotate angle GRAPHICS RotateMatrixRadian VY translate x y translate x y R GRAPHICS TranslateMatrix 4 transform a b c d e f transform a b c d e f GRAPHICS TransformMatrix 4 setTransform a b c d e f setTransform a b c d e f GRAPHICS SetMatrix 2x3 4 Line styles lineWidth lineCap lineJoin miterLimit 5 Text styles 6 Building paths moveTo closePath JineTo quadraticCurveTo bezierCurveTo arcTo arc Tect 7 Fill and stroke styles fillStyle single color fillStyle gradation fillStyle pattern StrokeStyle single color StrokeStyle gradation RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 rect fillStyle fillStyle RENESAS R_GRAPHICS_Rect R GRAPHICS SetFillColor R GRAPHICS SetFillPattern Page 101 of 128 RZ A1 RGA StrokeStyle pattern createLinearGradient createRadialGradient CanvasGradient addColorStop createPattern createPattern R GRAPHICS PATTERN Initializ e 8 The current default path beginPath beginPath R GRAPHICS BeginPath E filo stroke drawS ystemFocusRing drawCustomFocusRing scrollPathIntoView clip clip R GRAPHICS Clip V Only a single rectangle Only a single rectangle AsPointInPath 9 Drawing rectangles to th
120. pplication note of OSPL Lock object managing right to use RGA Lock area is from GRAPHICS Initialize function to R GRAPHICS Finalize function See application note of OSPL Channel number of DMAC used in RGA Channel number of DMAC used in RGA Flag of notification event as the end of DMA transfer Flag of notification event as the end of DMA transfer 6 6 5 4 graphics quality flags t This is a defaultable flag indicating the drawing quality See section 6 11 8 Defaultable Flags include RGA h Constant Name Value Description GRAPHICS RENDERING QUALITY ANTIALIASED 1 Enable the antialiasing at the borders R01AN2162EJ0200 Rev 2 00 Jul 31 2015 Page 32 of 128 RENESAS RZ A1 RGA GRAPHICS RENDERING QUALITY NONANTIALIASED 1 lt lt 16 Disable the antialiasing at the borders GRAPHICS IMAGE QUALITY ANTIALIASED 2 Enable the interpolation filter for image GRAPHICS IMAGE QUALITY NONANTIALIASED 2 16 Disable the interpolation filter for image 6 6 5 5 window surfaces t window surfaces t structure Outline This is a sample type of the frame buffer and screen display Header RGA h window surfaces h Description For the function equivalent to the member function see section 6 9 9 Member Variable Access Inhibit 6 6 5 6 window surfaces config t window surfaces config t structure Outline This is a type that sets window surfaces t Header RGA h w
121. ption Input member variable in frame buffer t is stride height buffer count Output member variable in frame buffer t is all element of buffer address array If the memory was few E FEW ARRAY error is returned Allocated off screen buffer is freed by calling Rh VRAM EX STACK Initialize function Argument vram ex stack t self The stack in the external RAM frame bufer t Input output The off screen buffer in out frame buffer Return value Error code If there is no error the return value is O 6 9 124 VRAM EX STACK Free R VRAM EX STACK Free Outline Frees the off screen buffer to the external RAM Header RGA h RGA SampleLib Port h Declaration errnum t R VRAM EX STACK Free ex stack t self frame bufer t frame buffer Description Input member variable in frame buffer t is buffer count buffer address If freeing order is not reverse of allocating order E ACCESS DENIED error is returned Argument vram ex stack t self The stack in the external RAM frame bufer t Input output The freeing off screen buffer in out frame buffer Return value Error code If there is no error the return value is O RO1AN2162EJ0200 Rev 2 00 Page 88 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 13 Functions Related to animation timing function t class 6 9 13 1 List of Functions Section Function Name Description 6 9 13 2 R Get AnimationTimingFunction Gets defined animation timing
122. r structure of sample screen controller Symbol access t access bit flags fast32 t flags int fast32 t id int fast32 t priority bool t is show r8g8b8a8 t color key bool t is color key r8g8b8a8 t layer color int fast32 t int fast32 t int fast32 t int fast32 t int fast32 t offset x int fast32 t offset y uint32 t CLUT x y width height int fast32 t CLUT count Description Whether to set or acquire values essential Section 6 11 7 Flagged Structure Parameters essential Above value logical or e g F LAYER ID Layer number to be accessed 1 background essential See 6 11 6 Reserved Reserved Reserved Reserved Color of entire layer available only for ID 1 See 6 6 5 19 and 6 9 1 25 Left position of layer window pixel Top position of layer window pixel Width of layer window pixel Height of layer window pixel X coord in frame buffer at left end of layer window Y coord in frame buffer at top end of layer window Array of colors to set to CLUT Color Look Up Table optional Set CLUT of graphics image properties t section 6 6 5 14 Pixel format is ARGB8888 If CLUT was overwritten for second image first image using CLUT is not shown correctly Count of elements of CLUT Set this with CLUT variable Set CLUT count of graphics image properties t section 6 6 5 14 Setting range Max is 256 CLUT8 16 CLUTA 2 CLUT1 access t This is a type that specifies Write setting set val
123. rLib SuperClass xml d efault ImagePackager OutputBinary OutputHeader One or more elements ImagePackager OutputHeader Zero or one element path Path of the header file output destination Essential Qinclude define The define symbol name to prevent the header file from being included twice Optional Default name BINARY IMAGE address Memory address to allocate binary files Optional Specify the memory address in the 0x00000000 format This parameter is used when allocating addresses directly in the flash memory in addition to the program image to be linked Since the set address is output to the header file to be created compile the program that references binary data by using the header If this parameter is omitted the C language s external reference symbol global variable name specified for ImagePackager OutputBinary symbol is used ImagePackager InputFiles Only one element base_folder A path to be the reference of ImagePackager InputFiles Image path Optional The reference of relative paths is the folder that contains the BinarylmageConfig image xml file Default path ImagePackager InputFiles Image Zero one or more elements The data converted to Raw format are embedded in the binary file path Path of image files to be input Essential As the reference of relative paths the path of the ImagePackager InputFiles Gbase folder folder and the sub folder are also input when a wild card is specified I
124. rame buffer and showing screen 6 6 4 7 WindowSurfacesConfigClass Argument of WindowSurfacesClass initialize 6 6 4 8 LayerAttributesClass Argument of WindowSurfacesClass access layer attributes 6 6 4 2 Canvas2D_ContextClass include RGA h class Canvas2D ContextClass This is a graphics drawing context class only for the C language This class follows a coding rule of JavaScript Renesas Graphics Processor for OpenVG M R GPVG2 or software rendering is used in the RZ A1H For the description on properties refer to property specifications section 6 8 1 For the description on member functions refer to function specifications sections 6 9 5 and 6 9 4 2 The graphics_t type member functions are made available by using the c_LanguageContext property See section 6 9 1 Sample Canvas2D ContextClass canvas2d R_RGA New Canvas2D ContextClass frame JavaScript start of compatible part canvas2d clearRect 0 0 frame width frame height canvas2d Style 0f0 canvas2d fillRect 100 100 200 100 JavaScript end of compatible part if OSPL GetErrNum 0 error R WINDOW SURFACES SwapBuffers canvas2d destroy 6 6 4 3 Canvas2D ContextConfigClass Canvas2D ContextConfigClass structure Outline This is a setting of Canvas2D_ContextClass for the C language RO1AN2162EJ0200 Rev 2 00 Page 27 of 128 Jul 31 2015 RENESAS RZ A1 RGA Header RGA h D
125. ration errnum t R GRAPHICS StrokeRect graphics t self int tmin x int t min y int t width int t height Description This function is affected by line width border color and clipping Fill is not made When the current matrix is not the unit matrix an error occurs This function is affected by GRAPHICS SetGlobalAlpha Argument graphics t self Graphics drawing context int tmin x int t min y Minimum X and Y coordinates of rectangle int t width int t height Width and height of rectangle Return value Error code If there is no error the return value is O 6 9 1 48 GRAPHICS BeginSoftwareRendering R GRAPHICS BeginSoftwareRendering Outline Notifies the graphics library of the start of software rendering Header RGA h Declaration errnum_t R GRAPHICS BeginSoftwareRendering graphics t self Description This function must be called in fast manual flush mode see section 6 11 4 For RZ A1H this function is used before software rendering to the frame bufffer in On Chip RAM See 6 9 1 52 R GRAPHICS BeginSoftwareRenderingA Depending on a condition this function waits for finishing drawing like R GRAPHICS Finish function Argument graphics t self Graphics drawing context Return value Error code If there is no error the return value is O 6 9 1 49 GRAPHICS EndSoftwareRendering R GRAPHICS EndSoftwareRendering Outline Notifies the graphics library of the end of software rendering Header RGA h Dec
126. ription cos angle sin angle 0 MM sin angle cos angle 0 0 0 1 Argument graphics_matrix_float_t Rotation angle unit degree When the origin is at the angle upper left plus means clockwise direction Return value None R01AN2162EJ0200 Rev 2 00 Page 74 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 5 19 transform Canvas2D ContextClass transform Canvas2D ContextClass Outline Multiplies the specified 2x3 matrix by the current matrix M Header RGA h Declaration void Canvas2D ContextClass transform graphics matrix float t sx graphics matrix float t ky graphics matrix float t kx graphics matrix float t sy graphics matrix float ttx graphics matrix float tty Description SX kx tx k t MEM y sy y 0 0 1 Argument graphics matrix float tsx 2x3 matrix to be multiplied graphics matrix float t ky graphics matrix float t kx graphics matrix float t sy graphics matrix float t tx graphics matrix float tty Return value None RO1AN2162EJ0200 Rev 2 00 Page 75 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 6 Functions Related to Canvas2D ImageClass 6 9 6 1 List of Functions Section Function Name Description 6 9 6 2 destroy Deletes the Canvas2D_ImageClass object 6 9 62 destroy Canvas2D_ImageClass destroy Canvas2D ImageClass Outline Deletes the Canvas2D_ImageClass object Header RGA h Declaration void Canvas2D_ImageClass destroy Description Argument Ret
127. rix array with nine elements out matrix Return value Error code If there is no error the return value is O 6 9 1 25 R GRAPHICS SetBackgroundColor R GRAPHICS SetBackgroundColor Outline Sets the background color Header RGA h Declaration errnum_t R GRAPHICS SetBackgroundColor graphics t self r8g8b8a8 t color Description When a frame buffer without alpha is to be drawn the background color is the same as the clear color The default background color is white When a frame buffer with alpha is to be drawn the background color is specified color and the clear color drawing to the target is transparent black even if any color specified Set the background color for the back layer for correct look Argument graphics t self Graphics drawing context r8g8b8a8 t color Use R RGA Get R8G8B8A68 to acquire the background color Return value Error code If there is no error the return value is O 6 9 1 26 R GRAPHICS GetBackgroundColor R GRAPHICS GetBackgroundColor Outline Acquires the background color Header RGA h Declaration errnum t R GRAPHICS GetBackgroundColor graphics t self r8g8b8a8 t out color Description Argument graphics t self Graphics drawing context r8g8b8a8 t out color Output Background color Return value Error code If there is no error the return value is 0 RO1AN2162EJ0200 Rev 2 00 Page 55 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 1 27 GRAPHICS GetClearColor R GRAPHIC
128. rn R GRAPHICS SetFillPattern Outline Sets the pattern for the current fill paint object Header RGA h Declaration errnum t R GRAPHICS SetFillPattern graphics t self graphics pattern t pattern Description Use R GRAPHICS FillRect for drawing Argument graphics t self Graphics drawing context graphics pattern t pattern Use R GRAPHICS PATTERN Initialize to initialize the pattern object Return value Error code If there is no error the return value is O 6 9 1 35 GRAPHICS BeginPath R GRAPHICS BeginPath Outline Resets the default path content to null Header RGA h Declaration errnum_t R GRAPHICS BeginPath graphics t self Description Argument graphics t self Graphics drawing context Return value Error code If there is no error the return value is O 6 9 1 36 R GRAPHICS Rect R GRAPHICS Rect Outline Adds a rectangle to the default path Header RGA h Declaration errnum_t R GRAPHICS Rect graphics t self int t min x int t min y int t width int t height Description This function is used to set the clipping area Argument graphics t self Graphics drawing context int tmin x int tmin y Minimum X and Y coordinates of rectangle int t width int t height Width and height of rectangle Return value Error code If there is no error the return value is 0 6 9 1 37 R GRAPHICS Clip R GRAPHICS Clip Outline Sets the shape of the current default path to a clipping area Header
129. rror the return value is O 6 9 1 22 GRAPHICS TransformMatrix R GRAPHICS TransformMatrix Outline Multiplies the current matrix M by the specified 2x3 matrix Header RGA h Declaration errnum t R GRAPHICS TransformMatrix graphics t self graphics matrix float t sx graphics matrix float t ky graphics matrix float t kx graphics matrix float t sy graphics matrix float ttx graphics matrix float tty Description SX kx tx k t MESS y sy y 0 0 1 When the library was ported take care computing error Argument graphics_t self Graphics drawing context graphics_matrix_float_tsx 2x3 matrix to be multiplied graphics_matrix_float_t ky graphics matrix float t kx graphics matrix float t sy graphics matrix float t tx graphics matrix float tty Return value Error code If there is no error the return value is 0 6 9 1 23 R GRAPHICS MultiplyMatrix R GRAPHICS MultiplyMatrix Outline Multiplies the current matrix M by the specified 3x3 matrix Matrix Header RGA h Declaration errnum t R GRAPHICS MultiplyMatrix graphics t self graphics matrix float t matrix Description Matrix 0 Matrix 3 Matrix 6 MM Matrix 1 Matrix 4 Matrix 7 Matrix 2 Matrix 5 Matrix 8 When the library was ported take care computing error Argument graphics_t self Graphics drawing context graphics matrix float t 2 3 matrix to be multiplied array with nine elements matrix Return value Error code If there is no
130. rt of animation loop Call the drawing API Initializing Call the GRAPHICS FillRect function Wait until drawing is completed Drawin Call the R_GRAPHICS_Finish function 5 Display drawing result stored in frame buffer End of animation loop Finalize the graphics t class object Call the GRAPHICS Finalize function Finalizing Figure 6 1 Drawing on a Buffer Defined by the Application Flowchart RO1AN2162EJ0200 Rev 2 00 Page 15 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 1 1 2 Sequence Chart The following shows an operation timing chart of the software application and library and hardware drawing hardware and display hardware in the case of drawing on the frame buffer provided by the application Prepare a frame buffer Call the drawing API 2 Buffering or waiting Call R GRAPHICS Finish Waiting for an interrupt gt Asynchronous message Synchronous message gt Return Figure 6 2 Operation sequence Initialization Drawing 1 Drawing 2 End of drawing d 5 N 5 T Drawing hardware Frame buffer Always displayed or display is controlled by the application When the frame buffer is always displayed drawing progress is displayed When the frame buffer is always displayed it is displayed correctly R01AN2162bEJ0200 Rev 2 00 Jul 31 2015 RENESAS Page 16 of 128 RZ A1 RGA 6 1 2 Drawin
131. ry applications or use by the military including but not limited to the development of weapons of mass destruction When exporting the Renesas Electronics products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations 10 It is the responsibility of the buyer or distributor of Renesas Electronics products who distributes disposes of or otherwise places the product with a third party to notify such third party in advance of the contents and conditions set forth in this document Renesas Electronics assumes no responsibility for any losses incurred by you or third parties as a result of unauthorized use of Renesas Electronics products 11 This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics 12 Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics tENESAS SALES OFFICES Renesas Electronics Corporation http Awww renesas com Refer
132. s amp ENABLE SAMPLE FLAG C errnum t SampleClass setDefaultableFlags SampleClass self DefaultableFlagsType Flags self gt Flags self gt Flags Flags amp Ox0000FFFF self gt Flags self gt Flags amp Flags gt gt 16 errnum t SampleClass getDefaultableFlags SampleClass self DefaultableFlagsType out Flags BitField flags self gt Flags amp 0x0000FFFF out_Flags flags flags lt lt 16 When the argument of the function to acquire the current flag SampleClass_getDefaultableFlags above is a defaultable flag the upper 16 bits of an acquirable value are an inverted value of the lower 16 bits For this reason both symbols for setting to ON and symbols for setting to OFF can be used for decision statements Since the internal variable that retains the current flag is the internal specification there is no problem with specifications in which upper 16 bits are disabled RO1AN2162EJ0200 Rev 2 00 Page 110 of 128 Jul 31 2015 RENESAS RZ A1 RGA Inverted value of lower 16 bits upper 16 bits Current flag lower 16 bits RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 RENESAS Page 111 of 128 RZ A1 RGA 6 11 9 Function to Initialize Internal Variables with Constants initConst Function In the C language class that includes the finalizing function finalize function the initConst function must be called first before calling the initialize f
133. s drawlmage graphics image t Image int t SourceMinX int t SourceMinY int t SourceWidth int t SourceHeight int t DestinationMinX int t DestinationMinY int t DestinationWidth int t DestinationHeight JPEG data can be directly specified for arguments See section 6 11 2 Identifying Image Format When neither width nor height is specified the width and height of the drawing destination are the same as the image width and height When SourceMinX to DestinationHeight are specified a part of an image is drawn Image SourceMinY Frame buffer SourceHeight 4 SourceWidth DestinationMinY DestinationMinX DestinationHeight eM Destination Width When SourceWidth DestinationWidth or SourceHeight DestinationHeight images are enlarged or reduced This function is affected by Canvas2D_ContextClass GlobalAlpha and the current matrix When drawing an image in the YUV422 format if the value converted from MinX or MinY by the matrix is not an even number an error occurs When the alpha component is included in the image and is not included in the drawing target frame buffer RGB components to be drawn in the frame buffer are blended to values that have been multiplied by the alpha component When the alpha component is included in the drawing target frame buffer RGB components are blended to values that have not been multiplied by the alpha component An example
134. s products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or systems manufactured by you 8 Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations 9 Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations You should not use Renesas Electronics products or technology described in this document for any purpose relating to milita
135. single color fill Refer to rrggbb rgb 6 6 6 1 rgb 6 9 15 2 rgba 6 9 15 3 The initial value is opaque black Use the fillRect method for drawing patterns 6 8 1 4 globalAlpha float32 t Canvas2D ContextClass globalAlpha get set This property retains a single alpha value opacity to be multiplied by all drawings The default value is 1 0 If a value less than 0 0 is set 0 0 is retained If a value larger than 1 0 is set 1 0 is retained This property affects the following drawing functions Figure fill functions such as fillRect Canvas2D ContextClass Pattern drawing functions such as fillRect Canvas2D_ContextClass Border drawing functions such as strokeRect Canvas2D_ContextClass Image drawing functions such as drawImage Canvas2D_ContextClass This property does not affect the following drawing function clearRect Canvas2D_ContextClass RO1AN2162EJ0200 Rev 2 00 Page 43 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 8 1 5 globalCompositeOperation char Canvas2D ContextClass globalCompositeOperation get set This property retains the calculation method for alpha blend See section 6 6 5 15 RO1AN2162EJ0200 Rev 2 00 Page 44 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 8 2 Canvas2D_ImageClass Properties 6 8 2 1 List of Properties Section Property Description 6 8 2 2 src Image data structure 6 8 2 3 width Image width 6 8
136. splay device 6 9 9 5 R WINDOW SURFACES GetLayerF Acquires the pointer to the frame buffer structure of the rameBuffer specified layer 6 9 9 6 WINDOW SURFACES GetLayer Acquires the number of layers Count 6 9 9 7 R WINDOW SURFACES SwapBuff Swaps the buffer of the specified layer and displays the ers drawn content 6 9 9 8 WINDOW SURFACES SwapBuff Starts to swap for displaying the drawn content ersStart 6 9 9 9 R WINDOW SURFACES WaitForV Waits for V Sync signal of the screen Sync 6 9 9 10 WINDOW SURFACES DoMessag Enters the message loop eLoop 6 9 9 11 WINDOW SURFACES AccessLa Accesses attributes of the specified display layer yerAttributes 6 9 9 12 R WINDOW SURFACES AllocOffsc Allocates the off screen buffer from VRAM stack reenStack 6 9 9 13 R WINDOW SURFACES FreeOffscr Frees the off screen buffer to VRAM stack eenStack 6992 WINDOW SURFACES InitConst R WINDOW SURFACES InitConst Outline Initializes internal variables with constants Header RGA h window surfaces h Declaration void R WINDOW SURFACES InitConst window surfaces t self Description Argument window surfaces t self Frame buffers and screen display Return value 6 9 9 3 None R WINDOW SURFACES Initialize R WINDOW SURFACES Initialize Outline Initializes the display device or window Header RGA h window surfaces h Declaration errnum t R WINDOW SURFACES Initialize window surfaces t self windo
137. st manual flush void work buffer b address size t work buffer b size graphics jpeg decoder t jpeg decoder size t work size for libPNG bit flags32 t internal event value BSP CFG USER LOCKI NG TYPE lock object int fast32 t channel of DMAC 1 int fast32 t channel of DMAC 2 int fast32 t event value of DMAC 1 int fast32 t event value of DMAC 2 RGA Using work buffer B Size bytes of work buffer used internally Set this with work buffer address See section 6 9 14 3 R CalcWorkBufferSize Maximum height of frame buffer to be drawn Set this with work buffer address Drawing quality see section 6 6 5 4 Background color see section 6 9 1 25 Whether the mode is fast manual flush mode section 6 11 4 Work buffer B starting address that must be set if in following condition X coord value of left of JPEG image is not alignment by 4 when frame buffer was 16 bit color X coord value of left of JPEG image is not alignment by 2 when frame buffer was 32 bit color Drawing JPEG image with matrix Size bytes of work buffer B Set this with work buffer b address See section 6 9 14 4 RGA CalcWorkBufferB Size Using JPEG decoder Size bytes of memory area as heap area allocated by PNG decoding This memory area is allocated in work buffer B The value of thread attached event Default value is R OSPL A FLAG 20x0001 Application can not wait this value See a
138. surfaces config t type See 6 6 5 6 Also member variables are initialized to default value by constructor It is not necessary to set flags member variable 6 6 4 8 LayerAttributesClass include RGA h class LayerAttributesClass This is a class of argument for WindowSurfacesClass access layer attributes member function for C language This class follows a coding rule of mbed RO1AN2162EJ0200 Rev 2 00 Page 28 of 128 Jul 31 2015 RENESAS RZ A1 RGA Member variables of this class are inherited from layer attributes t type See 6 6 5 7 Also member variables are initialized to default value by constructor It is not necessary to set flags member variable RO1AN2162EJ0200 Rev 2 00 Page 29 of 128 Jul 31 2015 RENESAS RZ A1 6 6 5 RGA Types Classes Available for C Language and C Language For types available from the C language also see section 6 6 3 Types Only for the C Language For types available from the C language also see section 6 6 4 Classes Only for the C Language 6 6 5 1 List of Classes Types Table 6 5 Types Classes Provided by RGA which are Available for C Language and C Language Section Type Description 6 6 5 2 frame buffer t Drawing destination frame buffer 6 6 5 3 graphics config t Type for setting graphics t 6 6 5 4 graphics quality flags t Defaultable flag indicating drawing quality 6 6 5 5 wi
139. t 6 6 5 21 graphics jpeg decoder t Constant value of a kind of JPEG decoder dinclude RGA h Constant Name Value Description GRAPHICS JPEG DECODER NONE 0 Not used JPEG decoder JPEG hardware decoder can be used from any other than RGA GRAPHICS JPEG DECODER HARD 1 JPEG hardware decoder default 6 6 5 22 graphics async status t graphics async status t structure Outline Status of drawing graphics and interrupt status Header RGA h Description Member Symbol Description Variable r ospl async state t Status of drawing graphics Inhibit write access This State value will update by calling R GRAPHICS GetAsyncStatus function Seer ospl async state t type OS Porting Layer OSPL Sample Program Others are access inhibit RO1AN2162EJ0200 Rev 2 00 Page 38 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 6 6 String Format 6 6 6 1 rrggbb rgb This format describes a color by hex number of CSS Color format Target fillStyle 6 8 1 3 e g FFFFOO Red component is 255 Green component is 255 Blue component is 0 and Alpha component is 1 0 e g FFO Red component is 255 Green component is 255 Blue component is 0 and Alpha component is 1 0 RO1AN2162EJ0200 Rev 2 00 Page 39 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 6 7 Type of porting layers 6 6 7 1 List Type Description NCGvoid Abstract of void type
140. t c 2012 2015 Renesas Electronics Corporation 1 Image format conversion RunImagePackager 2 Error information search SearchErrorInformation Number or command gt 2 SearchErrorInformation sth Path or file name of error source file gt Library c Error line number gt 2095 SoftFillRectangle YUV422 Rectangle Left must be even SoftFillRectangle YUV422 Rectangle Left must be an even number If you want to break the location raising the error call _ SET BREAK ERROR ID function at the first of the program The argument is error ID attribute of the above ERROR tag R OSPL SET BREAK ERROR ID 1 In RZ A1 connected with ULINK2 after connecting the target loading the program open src drivers ospl porting DebugBreak c file by drag and drop to DS 5 set a breakpoint by right click at the left of the line defined R DebugBreak function DS 5 breakpoints gt Toggle Hardware Breakpoint When the program was re started CPU breaks at the location raising the error In DS 5 caller function is shown in Debug Control view Even if the target board did not have serial port you can get information from LED or GPIO connected with oscilloscope The operational procedure is to call LED control function and waiting function e g R OSPL Delay from R DebugBreak function and display the argument of R DebugBreak function like Morse code Example
141. t of the software application and library and hardware drawing hardware and display hardware in the case of drawing on the frame buffer provided by the RGA s WindowSurfaces library RO1AN2162EJ0200 Rev 2 00 Page 18 of 128 Jul 31 2015 RENESAS RZ A1 RGA Application ope pope Drawing hardware hardware Display hardware and frame buffer Create a display screen and a frame buffer Create a graphics t class object For details refer to section 6 1 1 2 Call the drawing API twice or more For details refer to section 6 1 1 2 Call R WINDOW SURFACES Swap Call R WINDOW SURFACES Swap Waiting for an interrupt Initialization Drawn on frame buffer 1 End of drawing Setting for displaying frame 1 Waiting for an interrupt Waiting for an interrupt Drawn on frame buffer 2 End of drawing Setting for displaying frame 2 Waiting for an interrupt Finalize graphics t class object display screen and frame buffer Figure 6 4 Operation sequence R01AN2162EJ0200 Rev 2 00 Jul 31 2015 RENESAS Initialization black color is displayed V Sync Frame 1 is displayed V Sync Frame 2 is displayed Finalization unless LCD is turned off the screen is broken Page 19 of 128 RZ A1 RGA 6 2 Hardware resource allocation Renesas Graphics Processor for OpenVG M R GPVG2 and JPEG Codec Unit JCU are allocated by an instance as graphics t class I
142. the RGA Header RGA h Declaration void R GRAPHICS JInitConst graphics t self Description Refer to section 6 11 9 Function to Initialize Internal Variables with Constants initConst Function Argument graphics t self Graphics drawing context Return value None 6 9 1 3 R GRAPHICS Initialize R GRAPHICS Initialize Outline Initializes the graphics drawing context object Header RGA h Declaration errnum_t R GRAPHICS Initialize graphics t self graphics config t config Description Initializes internal variables Initializes Renesas Graphics Processor for OpenVG R GPVG2 and JPEG Codec Unit JCU For the built in version register the interrupt handler before calling this function When self is no longer be used call R GRAPHICS Finalize There is only one context When two or more frame buffers was drawn change the frame buffer by R GRAPHICS SetFrameBuffer function Argument graphics t self Graphics drawing context graphics config t config See section 6 6 5 2 Return value Error code If there is no error the return value is 0 6 9 1 4 R GRAPHICS Finalize R GRAPHICS Finalize Outline Finalizes the graphics drawing context object Header RGA h Declaration errnum t R GRAPHICS Finalize graphics t self errnum t e Description Argument graphics t self Graphics drawing context errnum te Errors that have occurred No error 0 Return value Error code ore 0 successful and e 0 6 9 15 R GRAPHICS
143. the rectangle area 6 9 5 11 createPattern Creates a pattern object 6 9 5 12 beginPath Resets the default path content to null 6 9 5 13 rect Adds a rectangle to the default path 6 9 5 14 clip Sets the shape of the current default path to a clipping area 6 9 5 15 setTransform Sets each element of the matrix 6 9 5 16 translate Translates the current matrix RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 Page 68 of 128 RENESAS RZ A1 RGA 6 9 5 17 scale Enlarges or reduces the current matrix 6 9 5 18 rotate Rotates the current matrix Rotation center 0 0 6 9 5 19 transform Multiplies the specified 2x3 matrix by the current matrix 6 9 52 destroy Canvas2D ContextClass destroy Canvas2D ContextClass Outline Deletes the object of Canvas2D ContextClass Header RGA h Declaration void Canvas2D ContextClass destroy Description Argument Return value 6 9 53 clearRect Canvas2D ContextClass clearRect Canvas2D_ContextClass Outline Clears the rectangle area Header RGA h Declaration void Canvas2D ContextClass clearRect int t MinX int t MinY int t Width int t Height Description Use R GRAPHICS SetBackgroundColor for setting the clear color Specify the c LanguageContext Canvas2D ContextClass property for the first argument Clear color can be gotten by RH GRAPHICS GetClearColor function Since the drawing buffer content is cleared clear
144. ting point type specified Header RGA h Declaration errnum t R GRAPHICS TranslateMatrix graphics t self graphics matrix float t tx graphics matrix float t ty Description 1 0 tx 1 t M M y 0 0 1 Argument graphics_t self Graphics drawing context graphics matrix float t tx Displacement When the origin is at the upper left graphics matrix float tty plus of X means right direction and plus of Y means downward direction Return value Error code If there is no error the return value is 0 6 9 1 19 GRAPHICS ScaleMatrix R GRAPHICS ScaleMatrix Outline Enlarges or reduces the current matrix M Header RGA h Declaration errnum_t R GRAPHICS ScaleMatrix graphics t self graphics matrix float t sx graphics matrix float t sy Description SX 0 0 0 Sy 0 MzM 0 0 1 When the library was ported take care computing error Argument graphics_t self Graphics drawing context graphics_matrix_float_t tx Magnification Enlargement reduction center Origin graphics matrix float tty Return value Error code If there is no error the return value is O RO1AN2162EJ0200 Rev 2 00 Page 52 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 1 20 R GRAPHICS RotateMatrixDegree R GRAPHICS RotateMatrixDegree Outline Rotates the current matrix M The center coordinates of rotation are 0 0 Header RGA h Declaration errnum_t R GRAPHICS RotateMatrixDegree graphics t self graphics matrix float t angle Descrip
145. tion cos angle sin angle 0 MM sin angle cos angle 0 0 0 1 When the library was ported take care computing error Argument graphics_t self Graphics drawing context graphics matrix float t angle Rotation angle degrees When the origin is at the upper left plus means clockwise direction Return value Error code If there is no error the return value is O 6 9 1 21 GRAPHICS ShearMatrix GRAPHICS ShearMatrix Outline Makes shear deformation of the current matrix M Header RGA h Declaration errnum t R GRAPHICS ShearMatrix graphics t self graphics matrix float t shx graphics matrix float t shy Description 1 shx 0 hy 1 a 0 0 When shx shy 1 0 0 0 a parallelogram is generated with perpendicular sides tilted 45 degrees Note however that the matrix is shifted unless the origin is at the upper left of the rectangle LL NON When shx shy 0 5 0 0 a parallelogram is generated with hypotenuses of a triangle base height 1 2 O Ln 1 When shx shy 0 0 1 0 a parallelogram is generated with horizontal sides tilted 45 degrees N R01AN2162EJ0200 Rev 2 00 Page 53 of 128 Jul 31 2015 RENESAS RZ A1 RGA When the library was ported take care computing error Argument graphics t self Graphics drawing context graphics matrix float t shx Rate of shear Shear center Origin graphics matrix float t shy Return value Error code If there is no e
146. to the structure of interrupt and r v sync async status t asynchronous operation out Status Return value Error code If there is no error the return value is O RO1AN2162EJ0200 Rev 2 00 Page 87 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 12 Functions Related to vram ex stack t class 6 9 12 1 List of Functions Section Function Name Description 6 9 12 2 R VRAM EX STACK Initialize Initialize the stack in the external RAM 6 9 12 3 VRAM EX STACK Alloc Allocates the off screen buffer from the external RAM 6 9 12 4 R VRAM EX STACK Free Frees the off screen buffer to the external RAM 6 9 122 VRAM EX STACK Initialize R VRAM EX STACK Initialize Outline Initialize the stack in the external RAM Header RGA h RGA SampleLib Port h Declaration errnum t R VRAM EX STACK Initialize vram ex stack t self void null config Description If to re initialize was done all allocated off screen buffer is freed Argument vram ex stack t self The stack in the external RAM void null config The reserved variable Pass NULL Return value Error code If there is no error the return value is O 6 9 123 VRAM EX STACK Alloc R VRAM EX STACK Alloc Outline Allocates the off screen buffer from the external RAM Header RGA h RGA SampleLib Port h Declaration errnum t R VRAM EX STACK Alloc vram ex stack t self frame bufer t in out frame buffer Descri
147. tronics Malaysia Sdn Bhd Unit 1207 Block B Menara Amcorp Amcorp Trade Centre No 18 Jin Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Tel 60 3 7955 9390 Fax 60 3 7955 9510 Renesas Electronics India Pvt Ltd No 777C 100 Feet Road HALII Stage Indiranagar Bangalore India Tel 91 80 67208700 Fax 91 80 67208777 Renesas Electronics Korea Co Ltd 12F 234 Teheran ro Gangnam Gu Seoul 135 080 Korea Tel 82 2 558 3737 Fax 82 2 558 5141 2015 Renesas Electronics Corporation All rights reserved Colophon 5 0
148. ts the upper 16 bits to OFF Components of the upper 16 bits are the same as those of the lower 16 bits Flag to be set to OFF Flag to be set to ON upper 16 bits lower 16 bits typedef BitField DefaultableFlagsType Flags of DefaultableFlagType enum DefaultableFlagType Set to ON ENABLE SAMPLE FLAG A 0x0001 ENABLE SAMPLE FLAG B 0x0002 ENABLE SAMPLE FLAG C 0x0004 Set to OFF DISABLE SAMPLE FLAG A ENABLE SAMPLE FLAG A lt lt 16 DISABLE SAMPLE FLAG B ENABLE SAMPLE FLAG B lt lt 16 DISABLE SAMPLE FLAG C ENABLE SAMPLE FLAG C lt lt 16 When the argument of the function to set flags SampleClass setDefaultableFlags below is defaultable flag only flags to be set to ON or OFF are connected by I Settings remain unchanged for flags that are not set to ON or OFF For initialization functions default values are used errnum t main DefaultableFlagsType flags e SampleClass setDefaultableFlags object ENABLE SAMPLE FLAG A DISABLE SAMPLE FLAG B IF e goto fin SAMPLE FLAG C is not modified e SampleClass getDefaultableFlags object amp flags IF e goto fin if flags amp ENABLE SAMPLE FLAG if flags amp DISABLE SAMPLE FLAG B if flag
149. uadrangle to a random profile quadrangle 6 9 1 25 R GRAPHICS SetBackgroundColor Sets the background color 6 9 1 26 GRAPHICS GetBackgroundColor Acquires the background color 6 9 1 27 R GRAPHICS GetClearColor Acquires the color used for R GRAPHICS Clear 6 9 1 28 GRAPHICS Clear Clears rectangle area 6 9 1 29 GRAPHICS Drawlmage Draws an image 6 9 1 30 R GRAPHICS DrawlmagehResized Enlarges or reduces an image and draws it in a rectangle 6 9 1 31 GRAPHICS DrawlmageChild Draws a part of an image 6 9 1 32 R GRAPHICS FillRect Fills a rectangle 6 9 1 33 R GRAPHICS SetFillColor Sets the color used for single color fill for the current fill paint object 6 9 1 34 GRAPHICS SetFillPattern Sets a pattern for the current fill paint object 6 9 1 35 GRAPHICS BeginPath Resets the default path content to null 6 9 1 36 GRAPHICS Rect Adds a rectangle to the default path 6 9 1 37 R GRAPHICS Clip Sets the shape of the current default path to a clipping area 6 9 1 38 R GRAPHICS SetGlobalAlpha Sets an alpha value opacity to be multiplied by all drawings R01AN2162EJ0200 Rev 2 00 Jul 31 2015 Page 46 of 128 RENESAS RZ A1 RGA 6 9 1 39 R GRAPHICS GetGlobalAlpha Acquires an alpha value opacity to be multiplied by all drawings 6 9 1 40 R GRAPHICS SetGlobalCompositeO Sets the calculation method for alpha blend peration 6 9 1 41 R G
150. ues or Read acquiring set values Constant Name Value Description ACCESS READ 1 Read values ACCESS WRITE 2 Write values 6 6 59 byte per pixel t include RGA h typedef int byte per pixel t This is a type of number of bytes per pixel See Table 1 2 When one pixel is less than one byte BitPerPixel 8 a value shifted from the number of bits per pixel is set R01AN2162EJ0200 Rev 2 00 Jul 31 2015 Page 34 of 128 RENESAS RZ A1 When 1 pixel is 1 byte or more When 1 pixel is less than 1 byte For related functions see section 6 9 10 6 6 5 10 pixel format t This is a pixel format type RGA 15 8 7 0 0 Number of bytes 15 8 7 0 Number of bits 0 Refer to Table 1 3 Combinations of Available Pixel Formats of Images and Pixel Formats of Drawing Destination include RGA h or frame buffer h Constant Name Value Value Description PIXEL_FORMAT_UNKNOWN 0 0x00 Unknown PIXEL_FORMAT_ARGB8888 1 0x01 ARGB8888 PIXEL_FORMAT_RGB565 3 0x03 RGB565 PIXEL_FORMAT_ARGB4444 5 0x05 ARGB4444 PIXEL FORMAT A1 13 0x0D 1bit alpha PIXEL_FORMAT_A4 14 OxOE 4bit alpha PIXEL FORMAT A8 11 0x0B 8bit alpha PIXEL_FORMAT_RGB888 15 OxOF RGB888 Reserved PIXEL FORMAT R8G8B8A8 6 1 lt lt 4 0x16 R8G8B8A8 PIXEL FORMAT XRGB8888 0 1 lt lt 6 0x40 XRGB8888 PIXEL FORMAT AR
151. ument graphics t self Graphics drawing context graphics image t image Image int tmin x int t min y Minimum X and Y coordinates int t width int t height Width and height of the drawing target Return value Error code If there is no error the return value is O 6 9 1 31 GRAPHICS DrawlmageChild R GRAPHICS DrawlmageChild Outline Draws a part of an image Header RGA h Declaration errnum t R GRAPHICS DrawlmageChild graphics t self graphics image t image int t source min x int t source min y int t source width int t source height int t destination min x t destination min y int t destination width int t destination height RO1AN2162EJ0200 Rev 2 00 Page 57 of 128 Jul 31 2015 RENESAS RZ A1 RGA Description midge SourceMinY Frame buffer SourceHeight gt Source Width DestinationMinY DestinationMinX DestinationHeight 4 DestinationWidth When source width Z destination width or source height 7 destination height images enlarged or reduced See the description on GRAPHICS DrawlImage function See 6 9 1 29 Argument graphics t self Graphics drawing context graphics image t image Image int t source min x Minimum X and Y coordinates in the image int t source min y int t source width Width and height in the image int t source height int t destination min x Minimum X and Y coordinates of the drawing target int t destination min y
152. ument of the R GRAPHICS DrawlImage section 6 9 1 29 GRAPHICS DrawlImageResized section 6 9 1 30 or R GRAPHICS DrawlImageChild section 6 9 1 31 function are used to identify image formats Therefore JPEG file data or PNG file data can be specified directly for the graphics image t type argument of the R GRAPHICS DrawlImage function Image Format First Few Bytes Note JPEG OxFF OxD8 SOI segment PNG 0x89 0x50 Ox4E 0x47 PNG header Raw Others graphics image t type structure Raw data RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 RENESAS Page 104 of 128 RZ A1 RGA 6 11 3 Changing RGAH and RGAS RZ A1H M can use RGA using hardware acceleration version RGAH and RGA using no hardware acceleration version RGAS But RZ A1L can use RGA using no hardware acceleration version RGAS only Initialize example and Video Display Controller 5 VDC5 driver are not same for RZ A1H as for RZ A1L Get the example for another target chip The way of changing RGAH and RGAS in RGA is the following steps 1 Change enabled macro IS RGAH ARM VERSION or 15 RGAS ARM VERSION in RGA_Sample armcc common src drivers RGA inc RGA_Config h 2 Inusing RGAH link RGA ForRGAH RGAH and PNG jpeg is not linked In using RGAS link RGA ForRGAS jpeg and PNG RGAH is not linked See Table 2 2 Library files 3 Convert the alignment of 1 line of drawing raw image to the specification of RGAH or RGAS See RGA
153. unction This is to prevent any exception from occurring even if the finalize function is called when an error occurs from another object before initialization Before calling the function that may cause an error first among functions call the initConst function first at a time for all objects that only exist in functions i e created and deleted in functions Even if the initConst function is called many functions methods are not made available until the initialize function is called In the case of the C language API of this library the initConst function responds to the constructor The initialize function responds to object creation functions such as RGA New Canvas2D ContextClass function The finalize function responds to the destroy member function For example when an error occurs before an object creation function is called after the constructor was called by the variable declaration no exception occurs even when the destroy member function is called RO1AN2162EJ0200 Rev 2 00 Page 112 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 11 10 Finalize Finalize Function The function that last name of is Finalize does the operation of finalize Finalize is close operation of file the operation in the destructor of C language the operation called from finally block of Java language and others Finalize Outline Does finalize operation Declaration errnum t _Finalize type self errnum t e
154. urn value None 6 9 7 Functions Related to Canvas2D PatternClass 6 9 7 1 List of Functions Description Section Function Name Deletes the Canvas2D PatternClass object 6 9 7 2 destroy 6 972 destroy Canvas2D_PatternClass destroy Canvas2D_PatternClass Outline Deletes the Canvas2D_PatternClass object Header RGA h Declaration void Canvas2D_PatternClass destroy Description Argument Return value None RO1AN2162EJ0200 Rev 2 00 Page 76 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 8 Functions Related to WindowSurfacesClass 6 9 8 1 List of Functions Section Function Name Description 6 9 8 2 initialize Initialize an object as WindowSurfacesClass 6 9 8 3 destroy Destroy an object as WindowSurfacesClass 6 9 8 4 get_layer_frame_buffer Acquires the pointer to the frame buffer structure of the specified layer 6 9 8 5 swap buffers Swaps the buffer of the specified layer and displays the drawn content 6 9 8 6 offscreen stack Allocates the off screen buffer from VRAM stack 6 9 8 7 free offscreen stack Frees the off screen buffer to VRAM stack 6 9 8 8 do message loop Enters the message loop 6 9 8 9 access layer attributes Accesses attributes of the specified display layer 6 9 82 initialize WindowSurfacesClass initialize WindowSurfacesClass Outline Initialize an object as WindowSurfacesClass Header RGA h Declar
155. v sync t structure Outline Synchronization with the V Sync signal of the display screen Header RGA h vsync h Description Function equivalent to the member function See section 6 9 11 Member Variable Access Inhibit 6 6 5 13 vram ex stack t vram ex stack t structure Outline This is a sample code of stack class for off screen buffer in external RAM Header RGA h RGA SampleLib Port h Description Function equivalent to the member function See section 6 9 12 For RZ A1H Video Display Controller 5 VDC5 must not show the frame buffer in external RAM Show the frame buffer in internal RAM copied from external RAM Member Variable Access Inhibit 6 6 5 14 graphics image properties t graphics image properties t structure Outline This is a type of image properties Header RGA h Description Related function 6 9 2 6 R GRAPHICS IMAGE GetProperties If the source image is created in the program call R GRAPHICS IMAGE InitByShareFrameBuffer function 6 9 2 5 Member Symbol Description Variable int fast32 t width Width of image pixel int fast32 t height Height of image pixel uint8 t data First address of array of image pixels If the image format is not R8G8B8A8 this value is NULL void pixels First address of array of image pixels Even if the image format is not R8G8B8A8 this value is available pixel format t Pixel format pixelFormat uint32 t CLUT CLUT Color Look Up Table Palette Array of colors If t
156. w surfaces config t in out config Description To control display independently directly use the frame buffer t structure instead of the window surfaces t class Initializes internal variables The entire screen becomes black after initialization After calling RR WINDOW SURFACES SwapBuffers function to show is started Argument window surfaces t self Frame buffers and screen display window surfaces config t in out config Error code If there is no error the return value is O See 6 6 5 6 Return value R01AN2162EJ0200 Rev 2 00 Jul 31 2015 Page 80 of 128 RENESAS RZ A1 RGA 6 9 94 R WINDOW SURFACES Finalize R WINDOW SURFACES Finalize Outline Finalizes the display device Header RGA h window surfaces h Declaration errnum t R WINDOW SURFACES Finalize window surfaces t self errnum t Description Argument window surfaces t self Frame buffers and screen display errnum te Errors that have occurred No error 0 Return value Error code or e 0 successful and e 0 6995 WINDOW SURFACES GetLayerFrameBuffer R WINDOW SURFACES GetLayerFrameBuffer Outline Acquires the pointer to the frame buffer structure of the specified layer Header RGA h window surfaces h Declaration errnum t R WINDOW SURFACES GetLayerFrameBuffer window surfaces t self int t layer num frame buffer 1 out frame buffer Description See 6 11 6 Layer structure of sample screen controller When the attribute of frame
157. was not specified the content specified by Header tag is used even if a section was specified If language C template filled at DeclareBinarylmageSymbol The following tags can be filled in the template Section Section name The value of ImagePackager OutputBinary section Symbol Variable name The value of ImagePackager OutputBinary symbol Size Size of the binary file bytes If language Binary template filled at DeclareBinarylmageSymbol The following tags can be filled in the template Section Section name The value of ImagePackager OutputBinary section Page 122 of 128 RENESAS RZ A1 RGA Symbol Variable name The value of ImagePackager OutputBinary symbol e StartAddress Start address of the binary data LastAddress Last address of the binary data ImagePackager SuperClass Zero one or more elements id ImagePackager SuperClass OutputBinary endian raw_image_alignment raw_stride_alignment raw_stride_alignment_4 ImagePackager SuperClass InputFiles File path alignment RO1AN2162EJ0200 Rev 2 00 Jul 31 2015 ID of SuperClass tag Essential This value is referred from ImagePackager OutputBinary super_class Zero or one Default value of ImagePackager OutputBinary endian This default value is LittleEndian Default value of ImagePackager OutputBinary raw_image_alignment This default value is
158. xelType R RGA BitPerPixelType To BytePerPixelType Outline Converts the number of bits per pixel to the number of bytes per pixel with decimal part Header RGA h Declaration byte per pixel 1 R RGA BitPerPixelType To BytePerPixelType int t bit per pixel Description Argument int t bit per pixel Number of bits per pixel Return value Number of bytes per pixel with decimal part 6 9 10 3 BytePerPixelType To BitPerPixelType R RGA BytePerPixelType To BitPerPixelType Outline Converts the number of bytes per pixel with decimal part to the number of bits per pixel Header RGA h Declaration int t R RGA BytePerPixelType To BitPerPixelType byte per pixel t byte per pixel Description Argument byte per pixel t byte per pixel Number of bytes per pixel with decimal part Return value Number of bits per pixel 6 9 10 4 BYTE PER PIXEL Islnteger BYTE PER PIXEL isInteger Outline Returns information on whether the number of bytes per pixel is an integer Header RGA h Declaration bool t R BYTE PER PIXEL islInteger byte per pixel t byte per pixel Description Argument byte per pixel t byte per pixel Number of bytes per pixel with decimal part Return value Information on whether the number of bits per pixel is an integer RO1AN2162EJ0200 Rev 2 00 Page 84 of 128 Jul 31 2015 RENESAS RZ A1 RGA 6 9 11 Functions Related to v sync t Class 6 9 11 1 List of Functions
Download Pdf Manuals
Related Search
Related Contents
Kwikset 604BL LH 11P Instructions / Assembly Pioneer FH-P4200MP User's Manual 33858-000 ECOPOWER+ - INTL LAPPEENRANTA UNIVERSITY OF TECHNOLOGY Faculty of PT-E831H-AC431x, PT-E831HS PDF簡易取扱説明書 John Deere 6430 ROPS Lawn Mower User Manual 6720608955-0809 (SENSOR)_pol.fm MANUALE D`USO E MANUTENZIONE Honda WH15X, WH20X Copyright © All rights reserved.
Failed to retrieve file