Tiny graphics library for STM32F746G-DISCO board

Dependents:   RadarDemo 3DDemo RadarDemoT

Committer:
karpent
Date:
Fri Nov 11 12:05:16 2016 +0000
Revision:
3:1ddc4aa1e5cb
Parent:
2:02b7b78e8510
Missing method DrawChar() added, DrawText() corrected.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
karpent 0:566855d63a2f 1 /*
karpent 0:566855d63a2f 2 DisplayBase.h - Graphics display base class declaration
karpent 0:566855d63a2f 3
karpent 0:566855d63a2f 4 Copyright(c) 2016 karpent at gmail.com, MIT License
karpent 0:566855d63a2f 5
karpent 0:566855d63a2f 6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"),
karpent 0:566855d63a2f 7 to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
karpent 0:566855d63a2f 8 and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
karpent 0:566855d63a2f 9
karpent 0:566855d63a2f 10 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
karpent 0:566855d63a2f 11
karpent 0:566855d63a2f 12 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
karpent 0:566855d63a2f 13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
karpent 0:566855d63a2f 14 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
karpent 0:566855d63a2f 15 THE USE OR OTHER DEALINGS IN THE SOFTWARE.
karpent 0:566855d63a2f 16 */
karpent 0:566855d63a2f 17
karpent 0:566855d63a2f 18 #pragma once
karpent 0:566855d63a2f 19
karpent 0:566855d63a2f 20 #include "stdint.h" // for uint32_t, uint16_t, uint8_t;
karpent 0:566855d63a2f 21
karpent 0:566855d63a2f 22 /// <summary>
karpent 0:566855d63a2f 23 /// Graphics display abstract base class
karpent 0:566855d63a2f 24 /// </summary>
karpent 0:566855d63a2f 25 class DisplayBase
karpent 0:566855d63a2f 26 {
karpent 0:566855d63a2f 27 public:
karpent 0:566855d63a2f 28 /// <summary>
karpent 0:566855d63a2f 29 /// Returns screen width.
karpent 0:566855d63a2f 30 /// </summary>
karpent 0:566855d63a2f 31 /// <returns></returns>
karpent 0:566855d63a2f 32 uint16_t virtual DisplayWidth() = 0;
karpent 0:566855d63a2f 33
karpent 0:566855d63a2f 34 /// <summary>
karpent 0:566855d63a2f 35 /// Redurns screen height.
karpent 0:566855d63a2f 36 /// </summary>
karpent 0:566855d63a2f 37 /// <returns></returns>
karpent 0:566855d63a2f 38 uint16_t virtual DisplayHeight() = 0;
karpent 0:566855d63a2f 39
karpent 0:566855d63a2f 40 /// <summary>
karpent 2:02b7b78e8510 41 /// Sets the color of the foreground.
karpent 0:566855d63a2f 42 /// </summary>
karpent 0:566855d63a2f 43 /// <param name="red">The red.</param>
karpent 0:566855d63a2f 44 /// <param name="green">The green.</param>
karpent 0:566855d63a2f 45 /// <param name="blue">The blue.</param>
karpent 0:566855d63a2f 46 /// <param name="alpha">The alpha.</param>
karpent 0:566855d63a2f 47 void virtual SetDrawColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) = 0;
karpent 2:02b7b78e8510 48
karpent 2:02b7b78e8510 49 /// <summary>
karpent 2:02b7b78e8510 50 /// Sets the color of the background.
karpent 2:02b7b78e8510 51 /// </summary>
karpent 2:02b7b78e8510 52 /// <param name="red">The red.</param>
karpent 2:02b7b78e8510 53 /// <param name="green">The green.</param>
karpent 2:02b7b78e8510 54 /// <param name="blue">The blue.</param>
karpent 2:02b7b78e8510 55 /// <param name="alpha">The alpha.</param>
karpent 2:02b7b78e8510 56 void virtual SetClearColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) = 0;
karpent 2:02b7b78e8510 57
karpent 2:02b7b78e8510 58 /// <summary>
karpent 2:02b7b78e8510 59 /// Clears the display.
karpent 2:02b7b78e8510 60 /// </summary>
karpent 2:02b7b78e8510 61 void virtual Clear() = 0;
karpent 0:566855d63a2f 62 };
karpent 0:566855d63a2f 63