Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 527d738

Browse filesBrowse files
committed
Remove unused _read_ppm_image from macosx.m.
It's not used anywhere since d8a08bc
1 parent 54b4263 commit 527d738
Copy full SHA for 527d738

File tree

Expand file treeCollapse file tree

1 file changed

+0
-40
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+0
-40
lines changed

‎src/_macosx.m

Copy file name to clipboardExpand all lines: src/_macosx.m
-40Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -458,46 +458,6 @@ static CGFloat _get_device_scale(CGContextRef cr)
458458
Py_RETURN_NONE;
459459
}
460460

461-
static NSImage* _read_ppm_image(PyObject* obj)
462-
{
463-
int width;
464-
int height;
465-
const char* data;
466-
int n;
467-
int i;
468-
NSBitmapImageRep* bitmap;
469-
unsigned char* bitmapdata;
470-
471-
if (!obj) return NULL;
472-
if (!PyTuple_Check(obj)) return NULL;
473-
if (!PyArg_ParseTuple(obj, "iit#", &width, &height, &data, &n)) return NULL;
474-
if (width*height*3 != n) return NULL; /* RGB image uses 3 colors / pixel */
475-
476-
bitmap = [[NSBitmapImageRep alloc]
477-
initWithBitmapDataPlanes: NULL
478-
pixelsWide: width
479-
pixelsHigh: height
480-
bitsPerSample: 8
481-
samplesPerPixel: 3
482-
hasAlpha: NO
483-
isPlanar: NO
484-
colorSpaceName: NSDeviceRGBColorSpace
485-
bitmapFormat: 0
486-
bytesPerRow: width*3
487-
bitsPerPixel: 24];
488-
if (!bitmap) return NULL;
489-
bitmapdata = [bitmap bitmapData];
490-
for (i = 0; i < n; i++) bitmapdata[i] = data[i];
491-
492-
NSSize size = NSMakeSize(width, height);
493-
NSImage* image = [[NSImage alloc] initWithSize: size];
494-
if (image) [image addRepresentation: bitmap];
495-
496-
[bitmap release];
497-
498-
return image;
499-
}
500-
501461
static PyObject*
502462
FigureCanvas_start_event_loop(FigureCanvas* self, PyObject* args, PyObject* keywords)
503463
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.