| CustomiOSApi 1.09

Graphics.h
1//
2// Graphics.h
3// CustomiOSApi
4//
5// Created by CUSTOM on 08/07/13.
6// Copyright (c) 2013 CUSTOM. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "CustomPrinter.h"
11#import "CommPort.h"
12#import "CustomError.h"
13#import "LibLog.h"
14
15//Hide it in the documentation
16// @cond PRIVATE
17@interface BitmapData : NSObject
18{
19@public
20
21 NSInteger Width;
22 NSInteger Height;
23 Byte* rawData;
24
25@protected
26@private
27}
28
29-(id)initWithImage:(UIImage*)image;
30- (NSInteger) GetPixel:(NSInteger)x :(NSInteger)y;
31
32@end
33
34//Hide it in the documentation
35// @cond PRIVATE
36@interface BitmapIntData : NSObject
37{
38@public
39
40 Byte* bitmapIntData;
41 int* bitmapLastByteWrote;
42
43 NSInteger imgWidth;
44 NSInteger imgHeight;
45
46@protected
47@private
48}
49
50
51-(id)initWithSize:(NSInteger)iWidth :(NSInteger)iHeight;
52- (void)Fill;
53- (void) SetColor:(NSInteger)x :(NSInteger)y :(Byte)color;
54- (Byte) GetColor:(NSInteger)x :(NSInteger)y;
55- (NSInteger) GetLastByteWrote:(NSInteger)y;
56
57@end
58
59//Hide it in the documentation
60// @cond PRIVATE
61@interface Graphics : NSObject
62{
63 @public
64 //******************************************************************************************
65 //Enum
66 //******************************************************************************************
67 enum Compression
68 {
69 COMPRESSION_NONE, //No data compression
70 COMPRESSION_FE_RLE //FE-RLE data compression
71 };
72
73 @protected
74
75 @private
76}
77
78+ (void) ImageToBuffer:(CommPort*)comPort :(enum Compression)cmpType :(UIImage*)image :(NSInteger)prnResolution :(NSInteger)leftMargin :(enum ImageScale)widthOption :(NSInteger)imgWidth :(NSInteger)paperWidth :(Boolean)bAddPageWidth :(NSInteger)topmargin :(NSError**)error;
79
80+ (void) BarcodeToBuffer:(CommPort*)comPort :(enum Compression)cmpType :(NSData*)brcData :(NSInteger)prnResolution :(NSInteger)leftMargin :(NSInteger)brcHeight :(NSInteger)paperWidth :(Boolean)bAddPageWidth :(NSInteger)topmargin :(NSError**)error;
81
82+ (BitmapIntData*) ditherImageFloydSteinberg:(UIImage*)image :(NSInteger)destwidth :(NSInteger)destheight :(NSInteger)maximgwidth;
83+ (Byte) CalcGreyColor:(BitmapData*)bmpData :(NSInteger)srcX :(NSInteger)srcY;
84+ (BitmapIntData*) ditherBarcode:(NSData*)brcData :(NSInteger)destheight;
85
86+ (void) CompressBitmap_NONE:(CommPort*)comPort :(BitmapIntData*)imageBWcolors :(NSInteger)prnResolution :(NSInteger)leftMargin :(NSInteger)destheight :(NSInteger)paperWidth :(Boolean)bAddPageWidth :(NSInteger)topmargin :(NSError**)error;
87+ (NSMutableData*) GetGraphicLine_NONE:(BitmapIntData*)BuffImgBW :(NSInteger)iY :(NSInteger)iDotlineWidth :(NSInteger)leftMargin;
88
89+ (void) CompressBitmap_FERLE:(CommPort*)comPort :(BitmapIntData*)imageBWcolors :(NSInteger)prnResolution :(NSInteger)leftMargin :(NSInteger)destheight :(NSInteger)paperWidth :(Boolean)bAddPageWidth :(NSInteger)topmargin :(NSError**)error;
90+ (NSMutableData*) GetGraphicLine_FERLE:(BitmapIntData*)BuffImgBW :(NSInteger)iY :(NSInteger)iDotlineWidth :(NSInteger)leftMargin;
91
92@end
93
94
95
96