//----------------------------------------------------------------------------------------------
//
//  gConsole+picloader.h : picLoader/cutLoader
//  X-BASIC'
//
//  Created by AIG-Soft(iMac) on 2013/01/23.
//  Copyright (c) 2013年 AIG-Soft. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "gConsole+bitmap.h"

//----------------------------------------------------------------------------------------------

@interface gConsole (picloader)
{
}

// MAGヘッダー内の文字列長
#define MAG_LEN_MACHINE		4	// 機種名(4バイト)
#define MAG_LEN_USERNAME	18	// ユーザー名(18バイト)

// v1.6 picLoader/cutLoader
-(int)picLoader:(NSString *)fname sx:(CGFloat)sx sy:(CGFloat)sy fbitmapOpen:(BOOL)fbitmapOpen fdirect:(BOOL)fdirect_ fNoBitmapClose:(BOOL)fNoBitmapClose;
-(int)cutLoader:(NSString *)fname sx:(CGFloat)sx sy:(CGFloat)sy fbitmapOpen:(BOOL)fbitmapOpen fdirect:(BOOL)fdirect_ fNoBitmapClose:(BOOL)fNoBitmapClose;
// fbitmapOpenはV2.0
// v2.0
-(int)bitmapImageFile:(NSString *)fname sx:(int)sx sy:(int)sy ex:(int)ex ey:(int)ey;
// v2.2
-(int)getPicHeader:(NSString *)fname fsquare:(BOOL *)fsquare mode:(int *)mode bitLength:(int *)bitLength wx:(int *)wx wy:(int *)wy comment:(UByte *)comment maxCommentLength:(int)maxCommentLength;
-(int)magLoader:(NSString *)fname sx:(CGFloat)sx sy:(CGFloat)sy fbitmapOpen:(BOOL)fbitmapOpen fdirect:(BOOL)fdirect_ fNoBitmapClose:(BOOL)fNoBitmapClose;
@end

// 以下は関数
int getCutHeader(NSString *fname,int *wx,int *wy);
int getMagHeader(NSString *fname,int *wx,int *wy,int *mode,UByte *machine,UByte *username,UByte *comment,int maxCommentLength);
int getJpegHeader(NSString *fname,int *wx,int *wy);
int getPngHeader(NSString *fname,SLong *wx,SLong *wy,int *bitLength);
int getGifHeader(NSString *fname,int *wx,int *wy);
int getBmpHeader(NSString *fname,SLong *wx,SLong *wy,int *bitLength);

//----------------------------------------------------------------------------------------------

