Questions tagged [cfdata]

CFData provides support for data objects, object-oriented wrappers for byte buffers.

CFData and its derived mutable type, CFMutableData Reference, provide support for data objects, object-oriented wrappers for byte buffers. Data objects let simple allocated buffers (that is, data with no embedded pointers) take on the behavior of Core Foundation objects. CFData creates static data objects, and CFMutableData creates dynamic data objects. Data objects are typically used for raw data storage.

You use the CFDataCreate and CFDataCreateCopy functions to create static data objects. These functions make a new copy of the supplied data. To create a data object that uses the supplied buffer instead of making a separate copy, use the CFDataCreateWithBytesNoCopy function. You use the CFDataGetBytes function to retrieve the bytes and the CFDataGetLength function to get the length of the bytes.

Read more here.

36 questions
1
vote
1 answer

How do I upload data points for NACA airfoil into simflow to run cfd simulation?

I have a text file filled with points that consist of x, y, and z coordinates of a NACA airfoil. I want to ultimately run a cfd simulation over the wing at different angles of attack using software called simflow. How do I import this data into the…
A. L
  • 19
  • 2
1
vote
1 answer

Faster way of converting image hex dump to binary array in Swift

I need to edit the pixels' raw binary values of an image. For this, I did this steps: I obtained the CFData containing the hex dump of the image. I converted the CFData obtained to an array of characters (using convertToArray function) After…
ch_studend
  • 91
  • 2
  • 10
1
vote
3 answers

Get notifications when an NSData/CFData object is being read?

I'm using an API that takes a CFData object, and I need to generate the data on the fly, which is a time consuming operation. The CFData is read by the consumer in a random, non-contiguous manner, and it rarely actually needs the entire length of…
ldoogy
  • 2,819
  • 1
  • 24
  • 38
1
vote
0 answers

New CGIImage or CGImageRef from std::string using using base64

everyone: I've been working on this for days. Here's a little bit of background. I'm sending an image to a server using protobuf. The image is directly from the camera, so it is not a jpeg nor a png. I found code to get the data from the UIImage…
Patricia
  • 5,019
  • 14
  • 72
  • 152
1
vote
1 answer

How do I store the data within CFDataRef in unicode (BE) format?

I'm writing string data to a file in which the data should be written in ASCII and then essentially repeated in Unicode. The ASCII portion is working well, but the Unicode version is garbled. Attempts to explicitly create a Unicode string with…
user216661
  • 323
  • 3
  • 14
1
vote
1 answer

How to store CFBitVector (or any CFType) in Core Data using CFData/NSData?

I have limited experience working with the Core Foundation types & collections, so apologies if this is obvious. I'm using the CFBitVector type to store some bit sequences, and I need to store it in a binary data format (so that it can be added to a…
Stuart
  • 36,683
  • 19
  • 101
  • 139
0
votes
1 answer

PyFoam problem - ImportError: No module named PyFoam

I just install PyFoam using: pip install PyFoam Then I wrote a test.py file using: import PyFoam Now I got an error message: import PyFoam ImportError: No module named PyFoam Then I tried install again, and I got this: pip install…
Yana
  • 25
  • 1
  • 6
0
votes
1 answer

{length = 6, capacity = 6, bytes = 0x0022412b03ad}

Every time I start build my Xcode Project, I get this in the console: {length = 6, capacity = 6, bytes = 0x0022412b03ad} I have no idea, what it means and what it's causing it. Can someone help me? Thx! Edit: I…
Daniel
  • 1,473
  • 3
  • 33
  • 63
0
votes
0 answers

CFDataRef vs NSData file hashing

I want to hash a file (using SHA1 at the moment). Here is the function: static inline __attribute__((always_inline)) NSString *SHA1String(NSData *data) { uint8_t digest[CC_SHA1_DIGEST_LENGTH]; CC_SHA1(data.bytes, (CC_LONG)data.length,…
Janosch Hübner
  • 1,584
  • 25
  • 44
0
votes
1 answer

OpenFoam: Cannot find blockMeshDict file in polyMesh folder

Using the command terminal, I try to access the blockMeshDict file from the docker. I access the cavity folder, constant folder, then polyMesh folder. I know the blockMeshDict file is supposed to be within the polyMesh folder, but when I enter 'ls'…
A. L
  • 19
  • 2
0
votes
1 answer

CGDataProviderCreateWithCFData function not recognized in Xcode IOS

I am looking at a camera tutorial for IOS and the CGDataProviderCreateWithCFData function was used. However Xcode doesn't seem to recognize it. Was this function removed from the latest Xcode Swift update? I am using Xcode version 8.1 and Swift…
Lightsout
  • 3,454
  • 2
  • 36
  • 65
0
votes
1 answer

objective-c get pixel value from resized image

I have an issue with getting the value from a resized UIimage. The initial image size is 500x500. The method i'm using fails only when the image is resized (even to equal size) I'm using ImageContext and drawInRect to create new resized image. I'm…
msavic
  • 1
  • 1
0
votes
1 answer

Python: Plots not saving data in images

I'm plotting for the sensors and saving the images as png... the files save but they're blank and when I run the file, only the first plot is populated with information. and i need to separate these into their own arrays without hardcoding import…
AmyCS
  • 1
0
votes
1 answer

CGDataProviderCopyData builds up in memory causing crash

Okay, so I'm downloading a bunch of large-ish images (5mb) from a server in pieces, then stitching the pieces together and rendering the total image from a byte array. However, I've realized that the data for each image is not being released, and…
0
votes
1 answer

Memory issue while uploading multiple images to server

I am uploading multiple images to server using ASIHTTPRequest. -(void)uploadImagesToServer { [[self networkQueue] cancelAllOperations]; // Creating a new queue each time we use it means we don't have to worry about clearing delegates or resetting…
Ankur Arya
  • 4,693
  • 5
  • 29
  • 50