Ejemplo n.º 1
0
ImageInfo ImageListModel::imageInfo(const QModelIndex &index) const
{
    if (!index.isValid() || index.row() >= m_imageInfoList.count())
        return ImageInfo();

    return m_imageInfoList.at(index.row());
}
Ejemplo n.º 2
0
void ImageWindow::loadImageInfos(const ImageInfoList& imageInfoList, const ImageInfo& imageInfoCurrent,
                                 const QString& caption)
{
    // Very first thing is to check for changes, user may choose to cancel operation
    if (!promptUserSave(d->currentUrl(), AskIfNeeded))
    {
        return;
    }

    d->currentImageInfo = ImageInfo();
    d->currentImageInfo = imageInfoCurrent;
    // Note: Addition is asynchronous, index not yet available
    d->imageInfoModel->setImageInfos(imageInfoList);
    d->setThumbBarToCurrent();

    if (!caption.isEmpty())
    {
        setCaption(i18n("Image Editor - %1",caption));
    }
    else
    {
        setCaption(i18n("Image Editor"));
    }

    // it can slightly improve the responsiveness when inserting an event loop run here
    QTimer::singleShot(0, this, SLOT(slotLoadImageInfosStage2()));
}
void CompositingWidget::dropEvent(QDropEvent* event) {
  if (event->mimeData()->hasFormat("image/thumbnail_with_data")) {
    QByteArray item_data = event->mimeData()->data("image/thumbnail_with_data");
    QDataStream data_stream(&item_data, QIODevice::ReadOnly);
    
    QPixmap pix_map;
    QImage* img;
    QString filename;
    
    data_stream >> pix_map;
    data_stream.readRawData((char*)&img, sizeof(img));
    data_stream >> filename;
    
    // Convert to coordinate system.
    QPoint pos = event->pos();

    pos -= QPoint(WIDGET_SIZE / 2, WIDGET_SIZE / 2);
    pos = pos / scale_;
    pos += QPoint(WIDGET_SIZE / 2 , WIDGET_SIZE / 2);
    
    pos -= offset_;
    
    images_.push_back(ImageInfo(img, pos - QPoint(img->width()/2, img->height()/2), 
                                filename.toStdString())); 
    repaint();
    
    event->setDropAction(Qt::MoveAction);
    event->accept();
  } else {
/* method: "add_frame([width,height])->frame\n
Appends a frame with the (optionally-specified) width and height" */
static PyObject* imageprops_add_frame(imagePropsObject& self,
  const Optional<IntSize>& size)
{
  self.props->AddFrame(ImageInfo(size.Or(IntSize(640,480)),
    create_bitmap(false)));
  return create_FrameProps(self, self.props->GetNumFrames() - 1);
}
Ejemplo n.º 5
0
EReaderStream::ImageInfo EReaderStream::imageLocation(const std::string& id) {
	if (myImagedataOffset != myMetadataOffset && myImages.empty()) {
		processImageHeaders();
	}
	const std::map<std::string, ImageInfo>::iterator it = myImages.find(id);
	if (it != myImages.end()) {
		return it->second;
	} else {
		return ImageInfo();
	}
}
Ejemplo n.º 6
0
void ImageListModel::addImages(const QFileInfoList &files)
{
    if (files.count() == 0)
        return;

    beginInsertRows(QModelIndex(), m_imageInfoList.count(), m_imageInfoList.count() + files.count() - 1);
    foreach (const QFileInfo &file, files)
        m_imageInfoList.append(ImageInfo(file));
    endInsertRows();

    emit changed();
}
Ejemplo n.º 7
0
YellowCar::YellowCar(char *name)
:NonRivalCar(name)
{
	addImage(ImageInfo("yellowcar", ROADFIGHTER_IMAGES_DIR, "yellowcar.bmp", 4, 32));
	myType = YELLOW_CAR;
	init();
	setWidth(16);
	setHeight(16);
	setStretchedWidth(9);
	setStretchedHeight(16);
	initMe();
	setSpeed(200);
	initImages();
}
Ejemplo n.º 8
0
Truck::Truck(char *name)
:NonRivalCar(name)
{
	addImage(ImageInfo("truck", ROADFIGHTER_IMAGES_DIR, "truck.bmp", 4, 32, 64));
	myType = TRUCK_CAR;
	init();
	setWidth(32);
	setHeight(64);
	setStretchedWidth(20);
	setStretchedHeight(64);
	initMe();
	setSpeed(200);
	initImages();
}
Ejemplo n.º 9
0
bool FileFormatInstance::Embed( const pcl::UInt8Image& thumbnail )
{
   try
   {
      if ( (*API->FileFormat->BeginThumbnailEmbedding)( handle ) == api_false )
         return false;

      thumbnail.PushSelections();
      thumbnail.ResetSelections();

      ImageInfo info( thumbnail );

      thumbnail.PopSelections();

      bool ok;

      if ( thumbnail.IsShared() )
         ok = (*API->FileFormat->SetThumbnail)( handle, thumbnail.Allocator().Handle() ) != api_false;
      else
      {
         UInt8Image tmp( (void*)0, 0, 0 );
         tmp.Assign( thumbnail );
         ok = (*API->FileFormat->SetThumbnail)( handle, tmp.Allocator().Handle() ) != api_false;
      }

      thumbnail.PushSelections();
      thumbnail.ResetSelections();

      if ( info != ImageInfo( thumbnail ) )
         APIHackingAttempt( "SetThumbnail" );

      thumbnail.PopSelections();

      (*API->FileFormat->EndThumbnailEmbedding)( handle );

      return ok;
   }
   catch ( ... )
   {
      if ( thumbnail.CanPopSelections() )
         thumbnail.PopSelections();
      (*API->FileFormat->EndThumbnailEmbedding)( handle );
      throw;
   }
}
Ejemplo n.º 10
0
FindDuplicatesAlbumItem::FindDuplicatesAlbumItem(QTreeWidget* const parent, SAlbum* const album)
    : QTreeWidgetItem(parent), d(new Private)
{
    d->album = album;

    if (d->album)
    {
        d->refImgInfo = ImageInfo(d->album->title().toLongLong());
        setText(0, d->refImgInfo.name());

        SearchXmlReader reader(d->album->query());
        reader.readToFirstField();
        QList<int> list;
        list << reader.valueToIntList();
        setText(1, QString::number(list.count()));
    }

    setThumb(SmallIcon("image-x-generic", parent->iconSize().width(), KIconLoader::DisabledState), false);
}
Ejemplo n.º 11
0
void
WebGLTexture::SetImageInfo(TexImageTarget texImageTarget, GLint level,
                           GLsizei width, GLsizei height, GLsizei depth,
                           TexInternalFormat effectiveInternalFormat,
                           WebGLImageDataStatus status)
{
    MOZ_ASSERT(depth == 1 || texImageTarget == LOCAL_GL_TEXTURE_3D);
    MOZ_ASSERT(TexImageTargetToTexTarget(texImageTarget) == mTarget);

    InvalidateStatusOfAttachedFBs();

    EnsureMaxLevelWithCustomImagesAtLeast(level);

    ImageInfoAt(texImageTarget, level) = ImageInfo(width, height, depth,
                                                   effectiveInternalFormat,
                                                   status);

    if (level > 0)
        SetCustomMipmap();

    SetFakeBlackStatus(WebGLTextureFakeBlackStatus::Unknown);
}
Ejemplo n.º 12
0
void Interface::SetPic( const QString pic )
{
    origImageFilename = pic;
    QFileInfo ImageInfo(pic);
    fi = ImageInfo;
    QString ext = ImageInfo.completeSuffix();
    ext.toUpper();
    extension = ext.toAscii();
    display = QPixmap(pic);
    original = QPixmap(pic);
    original2 = original;
    ///////////////QApplication::clipboard()->setImage(original.toImage(),QClipboard::Clipboard);
    wrapper->paint(display);
    spinBox_3->setValue(ratio);
    LargeReal = original.width();
    HighteReal = original.height();
    cento = 100.0;
    rotazione = 0;
    ratio = cento;
    
    CTRL_Pressed = false;
    moverecci = false;
    Top_startX = 0;
    QRect areaplace(QPoint(0,0),QPoint(0,0));
      TagliaPoi = areaplace;
    UpdateNow();
    /////////////////qDebug() << "####### size().width()  " << size().width(); 
    int nuovadim;
    if (LargeReal > size().width()) {
    nuovadim = ratio = (size().width()*cento) / LargeReal;
        ////////////qDebug() << "####### ratio sp   " << nuovadim;
     spinBox_3->setValue(ratio);
     SetZoom(nuovadim);
    return;
    }
}
Ejemplo n.º 13
0
void Images::add_to_image_list( ClutterTexture * texture , bool cached )
{
#ifndef TP_PRODUCTION

	g_assert( texture );

        if ( cached )
        {
            gchar * source = ( gchar * ) g_object_get_data( G_OBJECT( texture ), "tp-src" );
            const gchar * prepend = "* ";

            gint new_length = strlen( source ) + strlen( prepend ) + 2 ;

            gchar * new_source = g_new( gchar , new_length );

            snprintf( new_source , new_length , "%s%s" , prepend , source );\

            g_object_set_data_full( G_OBJECT( texture ) , "tp-src" , new_source , g_free );
        }

	add_to_image_list( texture , ImageInfo( texture ) );

#endif
}
Ejemplo n.º 14
0
void ImageWindow::slotPickLabelChanged(const KUrl& url, int pick)
{
    assignPickLabel(ImageInfo(url), pick);
}
Ejemplo n.º 15
0
ImageInfo KipiInterface::info(const KUrl& url)
{
    kipiDebug(QString( "Plugin wants information about image \"%1\"").arg( url.url() ));

    return ImageInfo( new KipiImageInfoShared(this, url ) );
}
Ejemplo n.º 16
0
status_t
LocalDebuggerInterface::_CreateDebugEvent(int32 messageCode,
	const debug_debugger_message_data& message, bool& _ignore,
	DebugEvent*& _event)
{
	DebugEvent* event = NULL;

	switch (messageCode) {
		case B_DEBUGGER_MESSAGE_THREAD_DEBUGGED:
			event = new(std::nothrow) ThreadDebuggedEvent(message.origin.team,
				message.origin.thread);
			break;
		case B_DEBUGGER_MESSAGE_DEBUGGER_CALL:
			event = new(std::nothrow) DebuggerCallEvent(message.origin.team,
				message.origin.thread,
				(target_addr_t)message.debugger_call.message);
			break;
		case B_DEBUGGER_MESSAGE_BREAKPOINT_HIT:
		{
			CpuState* state = NULL;
			status_t error = fArchitecture->CreateCpuState(
				&message.breakpoint_hit.cpu_state,
				sizeof(debug_cpu_state), state);
			if (error != B_OK)
				return error;

			event = new(std::nothrow) BreakpointHitEvent(message.origin.team,
				message.origin.thread, state);
			state->ReleaseReference();
			break;
		}
		case B_DEBUGGER_MESSAGE_WATCHPOINT_HIT:
		{
			CpuState* state = NULL;
			status_t error = fArchitecture->CreateCpuState(
				&message.watchpoint_hit.cpu_state,
				sizeof(debug_cpu_state), state);
			if (error != B_OK)
				return error;

			event = new(std::nothrow) WatchpointHitEvent(message.origin.team,
				message.origin.thread, state);
			state->ReleaseReference();
			break;
		}
		case B_DEBUGGER_MESSAGE_SINGLE_STEP:
		{
			CpuState* state = NULL;
			status_t error = fArchitecture->CreateCpuState(
				&message.single_step.cpu_state,
				sizeof(debug_cpu_state), state);
			if (error != B_OK)
				return error;

			event = new(std::nothrow) SingleStepEvent(message.origin.team,
				message.origin.thread, state);
			state->ReleaseReference();
			break;
		}
		case B_DEBUGGER_MESSAGE_EXCEPTION_OCCURRED:
			event = new(std::nothrow) ExceptionOccurredEvent(
				message.origin.team, message.origin.thread,
				message.exception_occurred.exception);
			break;
		case B_DEBUGGER_MESSAGE_TEAM_DELETED:
			if (message.origin.team != fTeamID) {
				_ignore = true;
				return B_OK;
			}
			event = new(std::nothrow) TeamDeletedEvent(message.origin.team,
				message.origin.thread);
			break;
		case B_DEBUGGER_MESSAGE_TEAM_EXEC:
			if (message.origin.team != fTeamID) {
				_ignore = true;
				return B_OK;
			}
			event = new(std::nothrow) TeamExecEvent(message.origin.team,
				message.origin.thread);
			break;
		case B_DEBUGGER_MESSAGE_THREAD_CREATED:
			event = new(std::nothrow) ThreadCreatedEvent(message.origin.team,
				message.origin.thread, message.thread_created.new_thread);
			break;
		case B_DEBUGGER_MESSAGE_THREAD_DELETED:
			event = new(std::nothrow) ThreadDeletedEvent(message.origin.team,
				message.origin.thread);
			break;
		case B_DEBUGGER_MESSAGE_IMAGE_CREATED:
		{
			const image_info& info = message.image_created.info;
			event = new(std::nothrow) ImageCreatedEvent(message.origin.team,
				message.origin.thread,
				ImageInfo(fTeamID, info.id, info.name, info.type,
					(addr_t)info.text, info.text_size, (addr_t)info.data,
					info.data_size));
			break;
		}
		case B_DEBUGGER_MESSAGE_IMAGE_DELETED:
		{
			const image_info& info = message.image_deleted.info;
			event = new(std::nothrow) ImageDeletedEvent(message.origin.team,
				message.origin.thread,
				ImageInfo(fTeamID, info.id, info.name, info.type,
					(addr_t)info.text, info.text_size, (addr_t)info.data,
					info.data_size));
			break;
		}
		case B_DEBUGGER_MESSAGE_POST_SYSCALL:
		{
			event = new(std::nothrow) PostSyscallEvent(message.origin.team,
				message.origin.thread,
				SyscallInfo(message.post_syscall.start_time,
					message.post_syscall.end_time,
					message.post_syscall.return_value,
					message.post_syscall.syscall, message.post_syscall.args));
			break;
		}
		case B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED:
		{
			event = new(std::nothrow) SignalReceivedEvent(message.origin.team,
				message.origin.thread,
				SignalInfo(message.signal_received.signal,
					message.signal_received.handler,
					message.signal_received.deadly));
			break;
		}
		default:
			printf("DebuggerInterface for team %" B_PRId32 ": unknown message "
				"from kernel: %" B_PRId32 "\n", fTeamID, messageCode);
			// fall through...
		case B_DEBUGGER_MESSAGE_TEAM_CREATED:
		case B_DEBUGGER_MESSAGE_PRE_SYSCALL:
		case B_DEBUGGER_MESSAGE_PROFILER_UPDATE:
		case B_DEBUGGER_MESSAGE_HANDED_OVER:
			_ignore = true;
			return B_OK;
	}

	if (event == NULL)
		return B_NO_MEMORY;

	if (message.origin.thread >= 0 && message.origin.nub_port >= 0)
		event->SetThreadStopped(true);

	_ignore = false;
	_event = event;

	return B_OK;
}
wxString ButcherProjectAreaConfigBase::GetFlagsDescription()
{
    wxString ret(wxEmptyString), tmp;
	if (area_->GetAreaClass() == ButcherProjectArea::AC_GLOBAL)
        ret+=wxT("<G>");
    switch (GetAreaKind())
    {
    case AK_NONE:
        ret+=wxT("N");
        break;
    case AK_IMAGE:
        ret+=wxT("I");
        break;
    case AK_MASK:
        ret+=wxT("M");
        break;
    default:
        ret+=wxT("?");
        break;
    }
    if (!GetIsDefault()) ret+=wxT("C");
    if (GetBackground()) ret+=wxT("B");
    if (GetIsBGColor()) ret+=wxT("L");
    if (GetImageSource()==IS_LINK) ret+=wxT("K");
    if (GetAlternateFile()>-1) ret+=wxT("A");
    if (GetInnerScrollable()) ret+=wxT("S");
    if (GetVariableSize()) ret+=wxT("Z");
    if (GetHaveMap()) ret+=wxT("P");
    if (ImageInfo().TransparentColors().size()>0) ret+=wxT("T");
    switch (GetAlign())
    {
    case AA_LEFT: ret+=wxT("@L"); break;
    case AA_CENTER: ret+=wxT("@C"); break;
    case AA_RIGHT: ret+=wxT("@R"); break;
    default: break;
    }
    switch (GetVAlign())
    {
    case AV_NONE: ret+=wxT("$N"); break;
    case AV_MIDDLE: ret+=wxT("$M"); break;
    case AV_BOTTOM: ret+=wxT("$B"); break;
    default: break;
    }
    switch (GetBGRepeat())
    {
    case BR_NONE: ret+=wxT("*N"); break;
    case BR_HORIZONTAL: ret+=wxT("*H"); break;
    case BR_VERTICAL: ret+=wxT("*V"); break;
    default: break;
    }
    tmp=wxEmptyString;
    for (int i=0; i<BUTCHERCONST_VIEW_MAXALTERNATE; i++)
    {
        if (altimageinfo_[i]->GetEnabled())
            tmp+=wxString::Format(wxT("%d"), i+1);
    }
    if (!tmp.IsEmpty())
    {
        ret+=wxT("+");
        ret+=tmp;
    }
    return ret;
}
Ejemplo n.º 18
0
TrackThree::TrackThree(string trackName, int cellSize):Track(trackName, cellSize)
{
	addImage(ImageInfo("Flying Route 3", ROADFIGHTER_IMAGES_DIR, "flying_route_track_3.bmp"));
}
Ejemplo n.º 19
0
TrackFour::TrackFour(string trackName, int cellSize):Track(trackName, cellSize)
{
	addImage(ImageInfo("Flying Route 4", ROADFIGHTER_IMAGES_DIR, "flying_route_track_4.bmp"));
}
Ejemplo n.º 20
0
void ProcessState::MakeChange() {
    changed = FALSE;
    img = change;
    change = ImageInfo(); }
Ejemplo n.º 21
0
void ImageWindow::slotRatingChanged(const KUrl& url, int rating)
{
    assignRating(ImageInfo(url), rating);
}
Ejemplo n.º 22
0
void ImageWindow::slotColorLabelChanged(const KUrl& url, int color)
{
    assignColorLabel(ImageInfo(url), color);
}
void ImagePropertiesVersionsTab::clear()
{
    d->filtersHistoryWidget->clearData();
    d->versionsWidget->setCurrentItem(ImageInfo());
}