diff --git a/ImageStreams.xcodeproj/project.pbxproj b/ImageStreams.xcodeproj/project.pbxproj index 23e6eec..18d65d0 100644 --- a/ImageStreams.xcodeproj/project.pbxproj +++ b/ImageStreams.xcodeproj/project.pbxproj @@ -7,12 +7,27 @@ objects = { /* Begin PBXBuildFile section */ - 4263431015FA676F00977AF9 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4263430F15FA676F00977AF9 /* main.cpp */; }; - 4263431215FA676F00977AF9 /* ImageStreams.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4263431115FA676F00977AF9 /* ImageStreams.1 */; }; - 4263431C15FA6A3200977AF9 /* libpng.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4263431B15FA6A3200977AF9 /* libpng.framework */; }; - 4263431F1604CA3900977AF9 /* libjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4263431E1604CA3900977AF9 /* libjpeg.a */; }; + 42212F6216064B920050F651 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42212F6116064B920050F651 /* main.cpp */; }; + 42212F6716064BD20050F651 /* basics.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 42212F6316064BA00050F651 /* basics.hpp */; }; + 42212F6816064BD20050F651 /* bmp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 42212F6416064BA00050F651 /* bmp.hpp */; }; + 42212F6916064BD20050F651 /* jpg.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 42212F6516064BA00050F651 /* jpg.hpp */; }; + 42212F6A16064BD20050F651 /* png.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 42212F6616064BA00050F651 /* png.hpp */; }; + 42212F6D16064C100050F651 /* libpng.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4263431B15FA6A3200977AF9 /* libpng.framework */; }; + 42212F6E16064C110050F651 /* libjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4263431E1604CA3900977AF9 /* libjpeg.a */; }; + 42771697160649E700A9BFC8 /* libpng.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4263431B15FA6A3200977AF9 /* libpng.framework */; }; + 42771698160649E900A9BFC8 /* libjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4263431E1604CA3900977AF9 /* libjpeg.a */; settings = {ATTRIBUTES = (Required, ); }; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 42212F6B16064BEE0050F651 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4263430215FA676F00977AF9 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 42771692160649DF00A9BFC8; + remoteInfo = ImageStreams; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXCopyFilesBuildPhase section */ 4263430915FA676F00977AF9 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; @@ -20,22 +35,21 @@ dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( - 4263431215FA676F00977AF9 /* ImageStreams.1 in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 1; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 4263430B15FA676F00977AF9 /* ImageStreams */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ImageStreams; sourceTree = BUILT_PRODUCTS_DIR; }; - 4263430F15FA676F00977AF9 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 4263431115FA676F00977AF9 /* ImageStreams.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = ImageStreams.1; sourceTree = ""; }; - 4263431815FA679600977AF9 /* bmp.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = bmp.hpp; sourceTree = ""; }; - 4263431915FA67D500977AF9 /* png.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = png.hpp; sourceTree = ""; }; - 4263431A15FA686300977AF9 /* basics.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = basics.hpp; sourceTree = ""; }; + 42212F6116064B920050F651 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = examples/main.cpp; sourceTree = SOURCE_ROOT; }; + 42212F6316064BA00050F651 /* basics.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = basics.hpp; path = include/basics.hpp; sourceTree = SOURCE_ROOT; }; + 42212F6416064BA00050F651 /* bmp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = bmp.hpp; path = include/bmp.hpp; sourceTree = SOURCE_ROOT; }; + 42212F6516064BA00050F651 /* jpg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = jpg.hpp; path = include/jpg.hpp; sourceTree = SOURCE_ROOT; }; + 42212F6616064BA00050F651 /* png.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = png.hpp; path = include/png.hpp; sourceTree = SOURCE_ROOT; }; + 4263430B15FA676F00977AF9 /* ImageStreams */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = ImageStreams; path = Examples; sourceTree = BUILT_PRODUCTS_DIR; }; 4263431B15FA6A3200977AF9 /* libpng.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libpng.framework; path = Library/Frameworks/libpng.framework; sourceTree = SDKROOT; }; - 4263431D1604A79F00977AF9 /* jpg.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = jpg.hpp; sourceTree = ""; }; 4263431E1604CA3900977AF9 /* libjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libjpeg.a; path = ../../../../../usr/local/lib/libjpeg.a; sourceTree = ""; }; + 42771693160649DF00A9BFC8 /* libImageStreams.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libImageStreams.a; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -43,8 +57,17 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4263431C15FA6A3200977AF9 /* libpng.framework in Frameworks */, - 4263431F1604CA3900977AF9 /* libjpeg.a in Frameworks */, + 42212F6D16064C100050F651 /* libpng.framework in Frameworks */, + 42212F6E16064C110050F651 /* libjpeg.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42771690160649DF00A9BFC8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 42771697160649E700A9BFC8 /* libpng.framework in Frameworks */, + 42771698160649E900A9BFC8 /* libjpeg.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -56,7 +79,8 @@ children = ( 4263431E1604CA3900977AF9 /* libjpeg.a */, 4263431B15FA6A3200977AF9 /* libpng.framework */, - 4263430E15FA676F00977AF9 /* ImageStreams */, + 427716A016064A3100A9BFC8 /* examples */, + 4263430E15FA676F00977AF9 /* include */, 4263430C15FA676F00977AF9 /* Products */, ); sourceTree = ""; @@ -65,29 +89,52 @@ isa = PBXGroup; children = ( 4263430B15FA676F00977AF9 /* ImageStreams */, + 42771693160649DF00A9BFC8 /* libImageStreams.a */, ); name = Products; sourceTree = ""; }; - 4263430E15FA676F00977AF9 /* ImageStreams */ = { + 4263430E15FA676F00977AF9 /* include */ = { isa = PBXGroup; children = ( - 4263430F15FA676F00977AF9 /* main.cpp */, - 4263431115FA676F00977AF9 /* ImageStreams.1 */, - 4263431A15FA686300977AF9 /* basics.hpp */, - 4263431815FA679600977AF9 /* bmp.hpp */, - 4263431915FA67D500977AF9 /* png.hpp */, - 4263431D1604A79F00977AF9 /* jpg.hpp */, + 42212F6316064BA00050F651 /* basics.hpp */, + 42212F6416064BA00050F651 /* bmp.hpp */, + 42212F6516064BA00050F651 /* jpg.hpp */, + 42212F6616064BA00050F651 /* png.hpp */, ); + name = include; + path = ImageStreams; + sourceTree = ""; + }; + 427716A016064A3100A9BFC8 /* examples */ = { + isa = PBXGroup; + children = ( + 42212F6116064B920050F651 /* main.cpp */, + ); + name = examples; path = ImageStreams; sourceTree = ""; }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + 42771691160649DF00A9BFC8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 42212F6716064BD20050F651 /* basics.hpp in Headers */, + 42212F6816064BD20050F651 /* bmp.hpp in Headers */, + 42212F6916064BD20050F651 /* jpg.hpp in Headers */, + 42212F6A16064BD20050F651 /* png.hpp in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ - 4263430A15FA676F00977AF9 /* ImageStreams */ = { + 4263430A15FA676F00977AF9 /* Examples */ = { isa = PBXNativeTarget; - buildConfigurationList = 4263431515FA676F00977AF9 /* Build configuration list for PBXNativeTarget "ImageStreams" */; + buildConfigurationList = 4263431515FA676F00977AF9 /* Build configuration list for PBXNativeTarget "Examples" */; buildPhases = ( 4263430715FA676F00977AF9 /* Sources */, 4263430815FA676F00977AF9 /* Frameworks */, @@ -96,12 +143,30 @@ buildRules = ( ); dependencies = ( + 42212F6C16064BEE0050F651 /* PBXTargetDependency */, ); - name = ImageStreams; + name = Examples; productName = ImageStreams; productReference = 4263430B15FA676F00977AF9 /* ImageStreams */; productType = "com.apple.product-type.tool"; }; + 42771692160649DF00A9BFC8 /* ImageStreams */ = { + isa = PBXNativeTarget; + buildConfigurationList = 42771694160649DF00A9BFC8 /* Build configuration list for PBXNativeTarget "ImageStreams" */; + buildPhases = ( + 4277168F160649DF00A9BFC8 /* Sources */, + 42771690160649DF00A9BFC8 /* Frameworks */, + 42771691160649DF00A9BFC8 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ImageStreams; + productName = ImageStreams; + productReference = 42771693160649DF00A9BFC8 /* libImageStreams.a */; + productType = "com.apple.product-type.library.static"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -123,7 +188,8 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 4263430A15FA676F00977AF9 /* ImageStreams */, + 4263430A15FA676F00977AF9 /* Examples */, + 42771692160649DF00A9BFC8 /* ImageStreams */, ); }; /* End PBXProject section */ @@ -133,12 +199,27 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 4263431015FA676F00977AF9 /* main.cpp in Sources */, + 42212F6216064B920050F651 /* main.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4277168F160649DF00A9BFC8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 42212F6C16064BEE0050F651 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 42771692160649DF00A9BFC8 /* ImageStreams */; + targetProxy = 42212F6B16064BEE0050F651 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 4263431315FA676F00977AF9 /* Debug */ = { isa = XCBuildConfiguration; @@ -203,6 +284,22 @@ }; name = Release; }; + 42771695160649DF00A9BFC8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + EXECUTABLE_PREFIX = lib; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 42771696160649DF00A9BFC8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + EXECUTABLE_PREFIX = lib; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -215,13 +312,23 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 4263431515FA676F00977AF9 /* Build configuration list for PBXNativeTarget "ImageStreams" */ = { + 4263431515FA676F00977AF9 /* Build configuration list for PBXNativeTarget "Examples" */ = { isa = XCConfigurationList; buildConfigurations = ( 4263431615FA676F00977AF9 /* Debug */, 4263431715FA676F00977AF9 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 42771694160649DF00A9BFC8 /* Build configuration list for PBXNativeTarget "ImageStreams" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 42771695160649DF00A9BFC8 /* Debug */, + 42771696160649DF00A9BFC8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/ImageStreams/ImageStreams.1 b/ImageStreams/ImageStreams.1 deleted file mode 100644 index 1dae2f4..0000000 --- a/ImageStreams/ImageStreams.1 +++ /dev/null @@ -1,79 +0,0 @@ -.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. -.\"See Also: -.\"man mdoc.samples for a complete listing of options -.\"man mdoc for the short list of editing options -.\"/usr/share/misc/mdoc.template -.Dd 9/7/12 \" DATE -.Dt ImageStreams 1 \" Program name and manual section number -.Os Darwin -.Sh NAME \" Section Header - required - don't modify -.Nm ImageStreams, -.\" The following lines are read in generating the apropos(man -k) database. Use only key -.\" words here as the database is built based on the words here and in the .ND line. -.Nm Other_name_for_same_program(), -.Nm Yet another name for the same program. -.\" Use .Nm macro to designate other names for the documented program. -.Nd This line parsed for whatis database. -.Sh SYNOPSIS \" Section Header - required - don't modify -.Nm -.Op Fl abcd \" [-abcd] -.Op Fl a Ar path \" [-a path] -.Op Ar file \" [file] -.Op Ar \" [file ...] -.Ar arg0 \" Underlined argument - use .Ar anywhere to underline -arg2 ... \" Arguments -.Sh DESCRIPTION \" Section Header - required - don't modify -Use the .Nm macro to refer to your program throughout the man page like such: -.Nm -Underlining is accomplished with the .Ar macro like this: -.Ar underlined text . -.Pp \" Inserts a space -A list of items with descriptions: -.Bl -tag -width -indent \" Begins a tagged list -.It item a \" Each item preceded by .It macro -Description of item a -.It item b -Description of item b -.El \" Ends the list -.Pp -A list of flags and their descriptions: -.Bl -tag -width -indent \" Differs from above in tag removed -.It Fl a \"-a flag as a list item -Description of -a flag -.It Fl b -Description of -b flag -.El \" Ends the list -.Pp -.\" .Sh ENVIRONMENT \" May not be needed -.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 -.\" .It Ev ENV_VAR_1 -.\" Description of ENV_VAR_1 -.\" .It Ev ENV_VAR_2 -.\" Description of ENV_VAR_2 -.\" .El -.Sh FILES \" File used or created by the topic of the man page -.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact -.It Pa /usr/share/file_name -FILE_1 description -.It Pa /Users/joeuser/Library/really_long_file_name -FILE_2 description -.El \" Ends the list -.\" .Sh DIAGNOSTICS \" May not be needed -.\" .Bl -diag -.\" .It Diagnostic Tag -.\" Diagnostic informtion here. -.\" .It Diagnostic Tag -.\" Diagnostic informtion here. -.\" .El -.Sh SEE ALSO -.\" List links in ascending order by section, alphabetically within a section. -.\" Please do not reference files that do not exist without filing a bug report -.Xr a 1 , -.Xr b 1 , -.Xr c 1 , -.Xr a 2 , -.Xr b 2 , -.Xr a 3 , -.Xr b 3 -.\" .Sh BUGS \" Document known, unremedied bugs -.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file diff --git a/README.md b/README.md index 1d8c41c..5c8c652 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ For the png format libpng is required. For the jpg format libjpeg or libjpeg-tur TODO ---- * Make output iterators +* Input streams (plus iterators) * Add alpha support (where possible) * Some interface for parameters (eg. jpg quality) * Add appropriate license diff --git a/ImageStreams/main.cpp b/examples/main.cpp similarity index 100% rename from ImageStreams/main.cpp rename to examples/main.cpp diff --git a/ImageStreams/basics.hpp b/include/basics.hpp similarity index 96% rename from ImageStreams/basics.hpp rename to include/basics.hpp index 1a2ead6..9fa2d13 100644 --- a/ImageStreams/basics.hpp +++ b/include/basics.hpp @@ -21,7 +21,7 @@ The order in the ctor is rgb even though the internal structure may be different - It should be trivially writable with memcpy (TODO: check exact requirement) + It should be trivially copyable (for memcpy). Furthermore it should have a static constexpr size_t num_colors indicating the number of colors and a static constexpr size_t bit_per_color indicating the diff --git a/ImageStreams/bmp.hpp b/include/bmp.hpp similarity index 100% rename from ImageStreams/bmp.hpp rename to include/bmp.hpp diff --git a/ImageStreams/jpg.hpp b/include/jpg.hpp similarity index 100% rename from ImageStreams/jpg.hpp rename to include/jpg.hpp diff --git a/ImageStreams/png.hpp b/include/png.hpp similarity index 100% rename from ImageStreams/png.hpp rename to include/png.hpp