rockbox/rbutil/ibassoboot/jni/qdbmp.h

134 lines
3.9 KiB
C
Raw Normal View History

Introducing Targets iBasso DX50 & iBasso DX90 The port to for this two targets has been entirely developped by Ilia Sergachev (alias Il or xzcc). His source can be found at https://bitbucket.org/isergachev/rockbox . The few necesary modifications for the DX90 port was done by headwhacker form head-fi.org. Unfortunately i could not try out the final state of the DX90 port. The port is hosted on android (without java) as standalone app. The official Firmware is required to run this port. Ilia did modify the source files for the "android" target in the rockbox source to make the DX port work. The work I did was to separate the code for DX50 (&DX90) from the android target. On this Target Ilia used source from tinyalsa from AOSP. I did not touch that part of the code because I do not understand it. What else I changed from Ilias sources besides the separation from the target "android": * removed a dirty hack to keep backlight off * changed value battery meter to voltage battery meter * made all plugins compile (named target as "standalone") and added keymaps * i added the graphics for the manual but did not do anything else for the manual yet * minor optimizations known bugs: * timers are slowed donw when playback is active (tinyalsa related?) * some minor bugs Things to do: * The main prolem will be how to install the app correctly. A guy called DOC2008 added a CWM (by androtab.info) to the official firmware and Ilia made a CWM installation script and a dualboot selector (rbutils/ibassoboot, build with ndk-build). We will have to find a way to install rockbox in a proper way without breaking any copyrights. Maybe ADB is an option but it is not enable with OF by default. Patching the OF is probably the way to go. * All the wiki and manual to build: needed: android ndk installed, android sdk installed with additional build-tools 19.1.0 installed ./tools/configure select iBasso DX50 or iBasso DX90 make -j apk the content of rockbox.zip/.rockbox needs to be copied to /system/rockbox/app_rockbox/rockbox/ (rockbox app not needed) the content of libs/armeabi to /system/rockbox/lib/ (rockbox app needed) The boot selector is needed as /system/bin/MangoPlayer and the iBasso app as /system/bin/MangoPlayer_original. There is also the "vold" file. The one from OF does not work with DX50 rockbox (DX90 works!?), the one from Ilia is necessary. Until we have found a proper way to install it, it can only be installed following the instructions of Ilia on his bitbucket page, using the CWM-OF and his installation script package. Change-Id: Ic4faaf84824c162aabcc08e492cee6e0068719d0 Reviewed-on: http://gerrit.rockbox.org/941 Tested: Chiwen Chang <rock1104.tw@yahoo.com.tw> Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
2014-08-30 11:15:53 +00:00
#ifndef _BMP_H_
#define _BMP_H_
/**************************************************************
QDBMP - Quick n' Dirty BMP
v1.0.0 - 2007-04-07
http://qdbmp.sourceforge.net
The library supports the following BMP variants:
1. Uncompressed 32 BPP (alpha values are ignored)
2. Uncompressed 24 BPP
3. Uncompressed 8 BPP (indexed color)
QDBMP is free and open source software, distributed
under the MIT licence.
Copyright (c) 2007 Chai Braudo (braudo@users.sourceforge.net)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, 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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
**************************************************************/
#include <stdio.h>
/* Type definitions */
#ifndef UINT
#define UINT unsigned long int
#endif
#ifndef USHORT
#define USHORT unsigned short
#endif
#ifndef UCHAR
#define UCHAR unsigned char
#endif
/* Version */
#define QDBMP_VERSION_MAJOR 1
#define QDBMP_VERSION_MINOR 0
#define QDBMP_VERSION_PATCH 1
/* Error codes */
typedef enum
{
BMP_OK = 0, /* No error */
BMP_ERROR, /* General error */
BMP_OUT_OF_MEMORY, /* Could not allocate enough memory to complete the operation */
BMP_IO_ERROR, /* General input/output error */
BMP_FILE_NOT_FOUND, /* File not found */
BMP_FILE_NOT_SUPPORTED, /* File is not a supported BMP variant */
BMP_FILE_INVALID, /* File is not a BMP image or is an invalid BMP */
BMP_INVALID_ARGUMENT, /* An argument is invalid or out of range */
BMP_TYPE_MISMATCH, /* The requested action is not compatible with the BMP's type */
BMP_ERROR_NUM
} BMP_STATUS;
/* Bitmap image */
typedef struct _BMP BMP;
/*********************************** Public methods **********************************/
/* Construction/destruction */
BMP* BMP_Create ( UINT width, UINT height, USHORT depth );
void BMP_Free ( BMP* bmp );
/* I/O */
BMP* BMP_ReadFile ( const char* filename );
void BMP_WriteFile ( BMP* bmp, const char* filename );
/* Meta info */
UINT BMP_GetWidth ( BMP* bmp );
UINT BMP_GetHeight ( BMP* bmp );
USHORT BMP_GetDepth ( BMP* bmp );
/* Pixel access */
void BMP_GetPixelRGB ( BMP* bmp, UINT x, UINT y, UCHAR* r, UCHAR* g, UCHAR* b );
void BMP_SetPixelRGB ( BMP* bmp, UINT x, UINT y, UCHAR r, UCHAR g, UCHAR b );
void BMP_GetPixelIndex ( BMP* bmp, UINT x, UINT y, UCHAR* val );
void BMP_SetPixelIndex ( BMP* bmp, UINT x, UINT y, UCHAR val );
/* Palette handling */
void BMP_GetPaletteColor ( BMP* bmp, UCHAR index, UCHAR* r, UCHAR* g, UCHAR* b );
void BMP_SetPaletteColor ( BMP* bmp, UCHAR index, UCHAR r, UCHAR g, UCHAR b );
/* Error handling */
BMP_STATUS BMP_GetError ();
const char* BMP_GetErrorDescription ();
/* Useful macro that may be used after each BMP operation to check for an error */
#define BMP_CHECK_ERROR( output_file, return_value ) \
if ( BMP_GetError() != BMP_OK ) \
{ \
fprintf( ( output_file ), "BMP error: %s\n", BMP_GetErrorDescription() ); \
return( return_value ); \
} \
#endif