Пример #1
0
Document * PsdParser::parse()
{
  psd_status status = psd_image_load(&context_, (psd_char *)filename_);

  if (status != psd_status_done) {
    // Failed to load the file
    return NULL;
  }

  Document *doc = new Document(filename_, context_->width, context_->height);

  reset_layer_index();
  parse_psd(doc);

  psd_image_free(context_);
  context_ = NULL;

  return doc;
}
Пример #2
0
int main (int argc, char **argv)
{
	psd_context * context = NULL;
	psd_status status;
	
	if(argc <= 1)
		return -1;

	// parse the psd file to psd_context
	status = psd_image_load(&context, argv[1]);

	// use it...
	//
	
	// free if it's done
	psd_image_free(context);

	return (status == psd_status_done ? 0 : -1);
}
Пример #3
0
	/**
	 * PSD画像のロード
	 * @param filename ファイル名
	 * @return ロードに成功したら true
	 */
	bool load(const char *filename) {
		status = psd_image_load(&context, (char*)filename);
		return status == psd_status_done;
	}