GithubHelp home page GithubHelp logo

myang-git / qr-code-encoder-for-objective-c Goto Github PK

View Code? Open in Web Editor NEW
391.0 391.0 110.0 635 KB

An implementation of QR code encoder for Objective-C ported from Psytec library

Home Page: http://myang-git.github.com/QR-Code-Encoder-for-Objective-C

License: Other

Ruby 0.84% Objective-C 16.82% C++ 82.35%

qr-code-encoder-for-objective-c's People

Contributors

cknitt avatar hafthor avatar koedal avatar myang-git avatar tyilo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qr-code-encoder-for-objective-c's Issues

Big padding when 5000 characters or more

When I encode something between 6000 and 7,089 numeric characters the padding on the UIImage is like 2/3 of the image. Are you aware of this problem and is there a fix?

how use in ios5 with storyboard

I tried to implement the qrencode in my project but I'm using storyboard and I have errors in this line
class CQR_Encode
the errors
unknown type name 'class'; did you mean 'Class'?
expected ';' after top level declarator

I already change the. m a. mm but equal does not work,I do not know if anyone has implemented in IOS5
i help a littler help

Other Linker Flags

For some reason i was required to add "-lstdc++" to other linker flags of my project. Otherwise it wouldn't let me compile.

C++ is great, but mass renaming is a quite awkward.

I love C++11 meta awesome as much as the next guy, but mass renaming, especially for existing apps, is painful configuration over convention.

I audited the class, it's not really doing anything C++ like except hiding some private instance vars that get passed around. And there's only one public method, so it seems kind of goofy to use classes. I'll demonstrate a C++ -> C trick of how to hide private instance data w/ public in 1 malloc.

Having it as a C99 QR library is also useful.

Legacy code-style transition:

  1. Keep the existing classes that proxy to C equivalents (no mm -> m required).
  2. Simple #ifdef to choose C or C++ version in the one place w/ new and delete.
  3. Optional deprecations notices later.

--excuses for not using this awesome library! :)

Mac cocoapod

  1. Dependency -> weak_dependency on UIKit
  2. Possibly weak_dependency on AppKit
  3. Do The Right Thing ™️

Can't show image in real iphone

Hi Myang, I downloaded your code and use it as you mentioned in readme file, it could work well in simulator, but in iphone there only show one black image, I have no idea why this problem exist, have you ever run this code in real device ?
any reply is appreciate, thanks a lot!

running the application

Hi myang,

Thank you for sharing the code. Can you please share an instruction file about how to run the code? I tried opening ReadMe, but it does not open.

Thanks!

Cheers!

armv6 architecture issue

Hi,

Thank you for this code and for related doc! Very helpful!

I face an issue trying to instal my app, build with QR Code Encoder, on iPhone 3G (armv6).
It looks impossible to build the QRCodeEncoderObjectiveC project with armv6 architecture.

If you have some help, I would be grateful!

Thank you,
Nicolas

Semantic Issue

I have renamed my implmentation file that makes use of QREncoder.h, yet I still "unknown type class" which flags QR_Encode.h. I even went all the way up to main.m and renamed it main.mm.

I realize this has been asked many times before, but I have followed those instructions, yet I still the error. Any ideas?

Getting errors in

I'm getting multiple errors in the QR_Encode.h file on line # 81 when I try to build a demo app. I've followed the instructions for dragging the project over, setting the dependency and adding the linked library.

The line contains:
class CQR_Encode

The errors are:
-Unknown type name 'class'; did you mean 'Class'?
-Expected ';' after top level declarator

Thanks

Licence

Great project, it was super easy for me to get working. Maybe I'm blind but I don't see any licence info in the project. Do you have any restriction on what I do with this?

High Resolution Image

Hi:
I Think this can make high resolution QR Image
( Make a bigger Matrix)

////////////////////////////////////////////////////////////////////////////////////////////////////

  • (UIImage *)imageForMatrix:(QRMatrix *)matrix {
    int width = matrix.width;
    int height = matrix.height;

    int bl = 8; // this is make more big matrix
    QRMatrix _newMatrix = [[QRMatrix alloc] initWithWidth:width_bl height:height*bl];
    for(int y = 0; y < height; y++) {
    for(int x = 0; x < width; x++) {
    int
    blx = x * bl,
    bly = y * bl;
    for(int blax = 0; blax<bl ; blax++){
    for(int blay = 0; blay<bl ;blay++){
    [newMatrix setX:blx+blax y:bly+blay value:[matrix getX:x y:y]];
    }
    }
    }
    }

    matrix = newMatrix;
    width = matrix.width;
    height = matrix.height;

    unsigned char *bytes = (unsigned char *)malloc(width * height * 4);
    for(int y = 0; y < height; y++) {
    for(int x = 0; x < width; x++) {
    BOOL bit = [matrix getX:x y:y];
    unsigned char intensity = bit ? 0 : 255;
    for(int i = 0; i < 3; i++) {
    bytes[y * width * 4 + x * 4 + i] = intensity;
    }
    bytes[y * width * 4 + x * 4 + 3] = 255;
    }
    }

    //int width = 32;
    //int height = 32;
    //unsigned char *bytes = (unsigned char *)malloc(width * height);
    //memset(bytes, 255, width * height * 4);

    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    CGContextRef c = CGBitmapContextCreate(bytes, width, height, 8, 4 * width, colorSpace, kCGImageAlphaPremultipliedLast);
    CFRelease(colorSpace);
    CGImageRef image = CGBitmapContextCreateImage(c);
    CFRelease(c);
    UIImage *image2 = [UIImage imageWithCGImage:image];
    CFRelease(image);
    return image2;
    }

Issues with Xcode 4.2 ??

Hello,

I'm using xcode 4.2 (4C199) and I followed every step about 5 or 6 times but it just doesn't work
I also tried to fix it on my own but I ALWAYS get these two issues:

QR_Encode.h:81:1: error: unknown type name 'class'; did you mean 'Class'? [3]
QR_Encode.h:81:17: error: expected ';' after top level declarator [1]

Hope you can help me.

Thx. Alex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.