Skip to content

Commit

Permalink
Implementation of CGImage using Windows Imaging Component. (#1185)
Browse files Browse the repository at this point in the history
- Implementation of CGImage via WIC
- Remove circular dependencies between CGImage and UIImage
- Implement UIImage interms of CGImage
- Fix issues in UIImage
- Increase code quality in UIImage
- Remove libpng depencie of CGImage
- Improvements to result.h Macros for conditional checks
- Improve code quality for existing image interaction
- Added unit tests
  • Loading branch information
msft-Jeyaram authored Oct 28, 2016
1 parent c10efe5 commit 7553524
Show file tree
Hide file tree
Showing 31 changed files with 1,228 additions and 1,323 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.tiff filter=lfs diff=lfs merge=lfs -text
*.nef filter=lfs diff=lfs merge=lfs -text
*.xcf filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text
2 changes: 1 addition & 1 deletion Frameworks/Accelerate/vImage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ vImage_Error vImageBuffer_InitWithCGImage(
if (result == kvImageNoError) {
const uint32_t srcPitch = CGImageGetBytesPerRow(image);
const uint32_t dstPitch = buffer->rowBytes;
BYTE* srcData = reinterpret_cast<BYTE*>(_CGImageGetData(image));
const BYTE* srcData = static_cast<const BYTE *>([static_cast<NSData*>(CGImageGetDataProvider(image)) bytes]);
BYTE* dstData = reinterpret_cast<BYTE*>(buffer->data);
const uint32_t bytesPerPixel = format->bitsPerPixel >> 3;
const uint32_t bytesToCopy = width * bytesPerPixel;
Expand Down
5 changes: 5 additions & 0 deletions Frameworks/CoreGraphics/CGColorSpace.mm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ CGColorSpaceRef CGColorSpaceCreateDeviceGray() {
return (CGColorSpaceRef) new __CGColorSpace(kCGColorSpaceModelMonochrome);
}


CGColorSpaceRef _CGColorSpaceCreate(CGColorSpaceModel model) {
return static_cast<CGColorSpaceRef>(new __CGColorSpace(model));
}

/**
@Status Caveat
@Notes Only GenericRGB, GenericRGBLinear and GenericGray supported
Expand Down
Loading

0 comments on commit 7553524

Please sign in to comment.