forked from rebolsource/r3
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: macOS image codecs cleanup and added support for
haif
encodin…
…g/decoding
- Loading branch information
Showing
8 changed files
with
115 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,7 @@ | ||
#pragma once | ||
|
||
#ifdef __OBJC__ | ||
#import <Foundation/Foundation.h> | ||
#include <objc/message.h> | ||
#include <objc/runtime.h> | ||
#include <dlfcn.h> | ||
|
||
#define CODECS_API | ||
//#define CODECS_API extern "C" | ||
|
||
//extern "C" { | ||
//#include "sys-utils.h" | ||
//#include "reb-types.h" | ||
//} | ||
#else | ||
#define CODECS_API | ||
#endif | ||
#include "sys-utils.h" | ||
#include "reb-codec.h" | ||
|
||
CODECS_API int codecs_init(); | ||
CODECS_API void codecs_fini(); | ||
CODECS_API int DecodeImageFromFile(const char *uri, unsigned int frame, REBCDI *codi); | ||
CODECS_API int EncodeImageToFile(const char *uri, REBCDI *codi); | ||
int DecodeImageFromFile(const char *uri, unsigned int frame, REBCDI *codi); | ||
int EncodeImageToFile(const char *uri, REBCDI *codi); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
//#define TRACES // to enable trace output | ||
|
||
#ifdef __OBJC__ | ||
#import <Foundation/Foundation.h> | ||
#include <objc/message.h> | ||
#include <objc/runtime.h> | ||
#include <dlfcn.h> | ||
|
||
CFURLRef urlFromCString(const char* cString); | ||
|
||
#ifdef TRACES | ||
#define TRACE printf | ||
#define TRACE NSLog | ||
#else | ||
static void _no_log(const char* fmt, ...) {} | ||
#define TRACE _no_log | ||
static void _no_log(NSString *format, ...){} | ||
#define TRACE _no_log | ||
#endif | ||
|
||
//#define TRACE_ERR_(msg, err) TRACE("FAILED: " msg " [%lu]", (err)) | ||
//#define TRACE_ERR(msg) TRACE("FAILED: " msg " [%lu]", GetLastError()) | ||
#define TRACE_FAILED(msg) TRACE("FAILED: " msg " [%lx]") | ||
//#define TRACE_HR_(msg, hr) TRACE(msg " [%lx]", (hr)) | ||
//#define TRACE_HR(msg) TRACE(msg " [%lx]", hr) | ||
#define TRACE_PTR(msg, ptr) TRACE(msg " [%0lX]", ptr) | ||
#define TRACE_MSG(msg) TRACE(@"" msg) | ||
#define TRACE_FAILED(msg, err) TRACE(@"FAILED: " msg " [%i]", (err)) | ||
#define TRACE_PTR(msg, ptr) TRACE(@"" msg " [%0lX]", ptr) | ||
|
||
#define ASSERT_NOT_NULL(v, e, msg) if(!v) {TRACE_FAILED(msg); error = e; break;} | ||
#define ASSERT_NOT_NULL(v, e, msg) if(!v) {TRACE_FAILED(msg, e); error = e; break;} | ||
|
||
#define SAFE_CF_RELEASE(obj) if(obj != NULL) {CFRelease(obj); obj = NULL;} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*********************************************************************** | ||
** | ||
** REBOL [R3] Language Interpreter and Run-time Environment | ||
** | ||
** Copyright 2021 Oldes | ||
** | ||
** Licensed under the Apache License, Version 2.0 (the "License"); | ||
** you may not use this file except in compliance with the License. | ||
** You may obtain a copy of the License at | ||
** | ||
** http://www.apache.org/licenses/LICENSE-2.0 | ||
** | ||
** Unless required by applicable law or agreed to in writing, software | ||
** distributed under the License is distributed on an "AS IS" BASIS, | ||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
** See the License for the specific language governing permissions and | ||
** limitations under the License. | ||
** | ||
************************************************************************ | ||
** | ||
** Title: osx objective-c common code | ||
** Author: Oldes | ||
** Purpose: various common osx functions | ||
** | ||
************************************************************************/ | ||
|
||
#include "sys-utils.h" | ||
|
||
CFURLRef urlFromCString(const char* cString){ | ||
NSString *myNSString = [NSString stringWithUTF8String:cString]; | ||
NSString *path = [myNSString stringByExpandingTildeInPath]; | ||
return CFURLCreateWithFileSystemPath(NULL, (CFStringRef)path, 0, false); | ||
} |