<commit_before>Quartz Help Library
=======
![sample image](http://sonson.jp/wp/wp-content/uploads/2011/04/qhl.png)

This library helps image processing  programming on iOS. Currently, it includes a mutual converter CGImage <-> pixel array..
You can convert them mutually without complicated codes.

	// original pixel data
	int originalWidth = 32;
	int originalHeight = 32;
	unsigned char* original = (unsigned char*)malloc(sizeof(unsigned char) * originalWidth * originalHeight);
	
	// make test pattern
	for (int y = 0; y < originalHeight; y++) {
		for (int x = 0; x < originalWidth; x++) {
			if (y <= originalHeight / 2 && x <= originalWidth / 2) {
				original[y * originalWidth + x] = 0;
			}
			if (y <= originalHeight / 2 && x > originalWidth / 2) {
				original[y * originalWidth + x] = 85;
			}
			if (y > originalHeight / 2 && x <= originalWidth / 2) {
				original[y * originalWidth + x] = 170;
			}
			if (y > originalHeight / 2 && x > originalWidth / 2) {
				original[y * originalWidth + x] = 255;
			}
		}
	}
	
	CGImageRef image = CGImageGrayColorCreateWithGrayPixelBuffer(original, originalWidth, originalHeight);
	
	UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageWithCGImage:image]];
	[self addSubview:imageView];
	[imageView release];
        
How to use
=======
 * Import QuartzCVHelpLibrary.h/m into your project.
 
License
=======
BSD License.

UIImage Quartz Help Library Additions Reference
=======
	- (NSData*)PNGRepresentaion;
###Return value
An autoreleased NSData object containing the PNG data, or nil if there was a problem generating the data.
###Discussion
You can obtain PNG data as NSData from UIImage directly.

	- (NSData*)JPEGRepresentaion;
###Return value
An autoreleased NSData object containing the JPEG data, or nil if there was a problem generating the data. This method uses default JPG compression quiality.
###Discussion
You can obtain JPEG data as NSData from UIImage directly.

	- (NSData*)JPEGRepresentaionWithCompressionQuality:(float)compressionQuality;
###Parameters
###compressionQuality
The quality of the resulting JPEG image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality).
###Return value
An autoreleased NSData object containing the JPEG data, or nil if there was a problem generating the data. This method uses default JPG compression quiality.
###Discussion
You can obtain JPEG data as NSData from UIImage directly.

	- (UIImage*)getRotatedImage;
###Return value
An autoreleased bitmap image as UIImage.
###Discussion
Bitmap image is copied from UIImage which is rotated according to "imageOrienation" attribute. Therefore, the size of the image you obtain is not as same as the original UIImage's.

	- (CGImageRef)createCGImageRotated;
###Return value
A new Quartz bitmap image. You are responsible for releasing this object by calling CGImageRelease.
###Discussion
Bitmap image is copied from UIImage which is rotated according to "imageOrienation" attribute. Therefore, the size of the image you obtain is not as same as the original UIImage's.

	- (CGImageRef)createCGImageRotatedWithResizing:(float)scale;<commit_msg>Added description about getRotatedImageWithResizing to README.md.<commit_after>Quartz Help Library
=======
![sample image](http://sonson.jp/wp/wp-content/uploads/2011/04/qhl.png)

This library helps image processing  programming on iOS. Currently, it includes a mutual converter CGImage <-> pixel array..
You can convert them mutually without complicated codes.

	// original pixel data
	int originalWidth = 32;
	int originalHeight = 32;
	unsigned char* original = (unsigned char*)malloc(sizeof(unsigned char) * originalWidth * originalHeight);
	
	// make test pattern
	for (int y = 0; y < originalHeight; y++) {
		for (int x = 0; x < originalWidth; x++) {
			if (y <= originalHeight / 2 && x <= originalWidth / 2) {
				original[y * originalWidth + x] = 0;
			}
			if (y <= originalHeight / 2 && x > originalWidth / 2) {
				original[y * originalWidth + x] = 85;
			}
			if (y > originalHeight / 2 && x <= originalWidth / 2) {
				original[y * originalWidth + x] = 170;
			}
			if (y > originalHeight / 2 && x > originalWidth / 2) {
				original[y * originalWidth + x] = 255;
			}
		}
	}
	
	CGImageRef image = CGImageGrayColorCreateWithGrayPixelBuffer(original, originalWidth, originalHeight);
	
	UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageWithCGImage:image]];
	[self addSubview:imageView];
	[imageView release];
        
How to use
=======
 * Import QuartzCVHelpLibrary.h/m into your project.
 
License
=======
BSD License.

UIImage Quartz Help Library Additions Reference
=======
	- (NSData*)PNGRepresentaion;
###Return value
An autoreleased NSData object containing the PNG data, or nil if there was a problem generating the data.
###Discussion
You can obtain PNG data as NSData from UIImage directly.

	- (NSData*)JPEGRepresentaion;
###Return value
An autoreleased NSData object containing the JPEG data, or nil if there was a problem generating the data. This method uses default JPG compression quiality.
###Discussion
You can obtain JPEG data as NSData from UIImage directly.

	- (NSData*)JPEGRepresentaionWithCompressionQuality:(float)compressionQuality;
###Parameters
###compressionQuality
The quality of the resulting JPEG image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality).
###Return value
An autoreleased NSData object containing the JPEG data, or nil if there was a problem generating the data. This method uses default JPG compression quiality.
###Discussion
You can obtain JPEG data as NSData from UIImage directly.

	- (UIImage*)getRotatedImage;
###Return value
An autoreleased bitmap image as UIImage.
###Discussion
Bitmap image is copied from UIImage which is rotated according to "imageOrienation" attribute. Therefore, the size of the image you obtain is not as same as the original UIImage's.

	- (UIImage*)getRotatedImageWithResizing:(float)scale;
###Parameters
###scale
The scale factor to used when "imageRef" is resized.
###Return value
An autoreleased bitmap image as UIImage.
###Discussion
Resized bitmap image is copied from UIImage which is rotated according to "imageOrienation" attribute. Therefore, the size of the image you obtain is not as same as the original UIImage's.

	- (CGImageRef)createCGImageRotated;
###Return value
A new Quartz bitmap image. You are responsible for releasing this object by calling CGImageRelease.
###Discussion
Bitmap image is copied from UIImage which is rotated according to "imageOrienation" attribute. Therefore, the size of the image you obtain is not as same as the original UIImage's.

	- (CGImageRef)createCGImageRotatedWithResizing:(float)scale;
{'fraction_non_alphanumeric': 0.09130309159202543, 'fraction_numerical': 0.01069055186362323, 'mean_word_length': 4.542834267413931, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '545287', 'n_tokens_mistral': 2105, 'n_tokens_neox': 1880, 'n_words': 807}